I have installed puppet-dashboard and noticed that all my augeas tasks are shown as "changed". I would expect that augeas automatically checks wether the value to be set is already set and in such case would do nothing.
My recipe:
$puppet_conf = "/etc/puppet/puppet.conf"
file { "${puppet_conf}": }
augeas { "puppet_conf":
context => "/files/${puppet_conf}/",
changes => [
"set agent/report true",
],
require => File["${puppet_conf}"],
}
Normal run when the value has already been set before:
info: Applying configuration version '1363882751'
debug: Augeas[puppet_conf](provider=augeas): Opening augeas with root /, lens path , flags 0
debug: Augeas[puppet_conf](provider=augeas): Closed the augeas connection
debug: Augeas[puppet_conf](provider=augeas): Opening augeas with root /, lens path , flags 0
debug: Augeas[puppet_conf](provider=augeas): sending command 'set' with params ["/files//etc/puppet/puppet.conf/agent/report", "true"]
debug: Augeas[puppet_conf](provider=augeas): Closed the augeas connection
notice: /Stage[main]/Puppet_agent/Augeas[puppet_conf]/returns: executed successfully
The date/time of the file has not changed, so it apparently doesn´t change the file. Though, puppet-dashboard shows the file as "changed". If I put in an "onlyif", that part won´t show up, but I don´t want to repeat everything in the onlyif, also I could only set one config option at a time.
Debian Squeeze
Puppet 2.6.2
Augeas 0.10.0
What is the proper way to configure this?
"/files/${puppet_conf}/"
is wrong that is will use/files//etc/puppet/puppet.conf
which will do a deep-level search. You could also use Camptocamp'spuppet::config
definition which does exactly that.