2017-08-21 14:03:20,146 WARN [qtp2051525912-14813] [puppetserver] Puppet Attempt to override an already evaluated resource, defined at /etc/puppetlabs/code/environments/production/modules/puppet/manifests/collections.pp:45, with new values at /etc/puppetlabs/code/environments/production/modules/puppet/manifests/collections.pp:40
The code leading to these warnings is this:
if $::operatingsystem == 'Debian' {
$remove_packages = [
'facter',
'hiera',
'puppet',
'puppet-common'
]
linux::package { $remove_packages: ensure => purged }
Linux::Package['puppet-agent'] {
require => Linux::Package[$remove_packages],
}
}
linux::package { 'puppet-agent':
ensure => installed,
}
I found
PUP-6290, which seems related to this, but I am not sure the use case described in that ticket is the same. Also, I don't think that adding a 'require' metaparam to an already evaluated resource should require a re-evaluation of the resource body.
If my pattern of conditionally adding to a resource's parameters is wrong, how should I go about this?
Martijn.