theforeman / puppet-foreman

Puppet module for Foreman
GNU General Public License v3.0
104 stars 269 forks source link

Consider using stdlib::ensure_packages #1137

Closed mikeweilgart closed 10 months ago

mikeweilgart commented 10 months ago

I expanded the scope of an old in-house puppet manifest for utilities installation to apply it to more servers, and ran into:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Duplicate declaration: Package[wget] is already declared at (file: /etc/puppetlabs/code/environments/production/site/packages/manifests/wget.pp, line: 2); cannot redeclare (file: /etc/puppetlabs/code/environments/production/modules/foreman_proxy/manifests/tftp.pp, line: 47) (file: /etc/puppetlabs/code/environments/production/modules/foreman_proxy/manifests/tftp.pp, line: 47, column: 5) on node my-foreman-proxy.example.com

I fixed this by correcting the old in-house puppet manifest to use the preferred form, stdlib::ensure_packages(['wget']) rather than directly declaring the package resource.

It would be nice if this could be fixed within the foreman installer puppet modules as well.

ekohl commented 10 months ago

Wrong module. You're confusing it with https://github.com/theforeman/puppet-foreman_proxy. There we already use ensure_packages() and have a foreman_proxy::tftp_manage_wget parameter.