Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate declaration: Package[gnupg] introduced with v2.0.0 #186

Open
saz opened this issue Jul 7, 2022 · 5 comments
Open

Duplicate declaration: Package[gnupg] introduced with v2.0.0 #186

saz opened this issue Jul 7, 2022 · 5 comments

Comments

@saz
Copy link

saz commented Jul 7, 2022

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.27.0
  • Ruby: 2.7
  • Distribution: Ubuntu
  • Module version: 2.0.0

How to reproduce (e.g Puppet code you use)

Use apt and rvm at the same time

What are you seeing

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Package[gnupg] is already declared at (file: /etc/puppetlabs/code/environments/production/modules/apt/manifests/init.pp, line: 372); cannot redeclare (file: /etc/puppetlabs/code/environments/production/modules/gnupg/manifests/install.pp, line: 4) (file: /etc/puppetlabs/code/environments/production/modules/gnupg/manifests/install.pp, line: 4, column: 3) on node some-host.example.com

What behaviour did you expect instead

Successful management of rvm

Any additional information you'd like to impart

The apt module uses ensure_packages(['gnupg']) while the gnupg module (introduced in 1c71b55) uses package { 'gnupg':... with some parameters.

Except for either fixing the gnupg module (which is outdated anyways - last release 2016) or getting rid of it, I don't have any idea how to properly fix this.

@saz
Copy link
Author

saz commented Jul 7, 2022

Maybe dropping include gnupg (it's only installing the package) and adding ensure_packages(['gnupg']) might be an option?

But package name differs on e.g. Debian, RedHat and Suse, which the gnupg module handles properly.

@choffee
Copy link

choffee commented Feb 16, 2023

The gnupg module it relies on has not been touched in many years. It might be good to move this into the module.

@choffee
Copy link

choffee commented Feb 16, 2023

Ah looks like there is now an install_gnupg parmeter in the main branch which fixes it for me. Any chance of a release?

@ekohl
Copy link
Member

ekohl commented Jan 9, 2024

The gnupg module it relies on has not been touched in many years. It might be good to move this into the module.

Agreed it's poorly maintained and needs attention. Right now it's blocking Puppet 8 support as well.

Maybe dropping include gnupg (it's only installing the package) and adding ensure_packages(['gnupg']) might be an option?

It does use more of the module:

gnupg_key { $key['id']:
ensure => 'present',
user => 'root',
key_id => $key['id'],
key_source => $key['source'],
key_type => public,
before => Exec['system-rvm'],
require => $dep,
}

I don't know if that could be easily replaced by something else.

@saz
Copy link
Author

saz commented Jan 9, 2024

I've just suggested to drop the include gnupg part, as this isn't adding anything else, except the package.

Maybe https://forge.puppet.com/modules/h0tw1r3/gnupg/readme is a potential replacement?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants