Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
1  
Which versions of Puppet, Augeas and ruby-augeas are you using? As a note, "/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's puppet::config definition which does exactly that. –  ℝaphink Mar 22 '13 at 10:59
    
Sorry, I really should no better. Just realized myself that I forgot vital information =/ –  Larsen Mar 22 '13 at 11:43
    
@Raphink Debian Squeeze Puppet 2.6.2 Augeas 0.10.0 No package "ruby-augeas" Regarding "context": In the meantime I switched to specifying a lens so speedup things, so context has been removed. Boy, why is it so hard to edit comments? Enter saves the comment instead of inserting a line break and copied line breaks get removed... –  Larsen Mar 22 '13 at 11:49
    
Just to add, if you're using Puppet 3, you will now get the speedup when specifying only the context without needing to do lens/incl. –  m0dlx Mar 22 '13 at 12:19

1 Answer 1

up vote 1 down vote accepted

Thanks for the version info. It looks like you're hitting Puppet bug #11414, which is due to a combination of the new Augeas 0.10.0 and an old version of Puppet.

The provider in Puppet is misinterpreting the Augeas version number as being a very old version (string instead of proper version comparison) and it doesn't work as expected.

You'll need to either use Puppet 2.7.18 from squeeze-backports (or the Puppet Labs repo) which has the bug fix, or use an older or newer version of Augeas (1.0.0 or 0.9.0).

share|improve this answer
    
Thx a lot! I grabbed your patch for puppet 2.6 and now I get the expected "Skipping because no files were changed" wget github.com/domcleal/puppet/commit/e3fc5c49.patch patch -u /usr/lib/ruby/1.8/puppet/provider/augeas/augeas.rb < e3fc5c49.patch –  Larsen Mar 22 '13 at 13:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.