Issue #4537 has been reported by martin krafft.

----------------------------------------
Bug #4537: nagios_* resources interact wrongly with purge-directories
http://projects.puppetlabs.com/issues/4537

Author: martin krafft
Status: Unreviewed
Priority: Normal
Assigned to: 
Category: nagios
Target version: 
Affected version: 0.25.5
Keywords: 
Branch: 


Given the following resources:

<pre>
file { "/etc/icinga/puppet-objects":
    ensure  => directory,
    mode    => 644,
    owner   => root,
    group   => root,
    purge   => true,
    recurse => true,
    require => Class["icinga::master::install"]
}

nagios_host { "localhost":
    address => '127.0.0.1',
    alias   => 'localhost',
    use     => 'generic-host',
    target  => '/etc/icinga/puppet-objects/hosts.cfg',
    require => File["/etc/icinga/puppet-objects"]
}

file { "/etc/icinga/puppet-objects/foo.cfg":
    content => "test",
    require => File["/etc/icinga/puppet-objects"]
}
</pre>

puppetd will do something strange: while the interaction between the directory
and the file resource is exactly how I would expect it (see related issues),
the nagios resource will be created in one run, removed in the next,
recreated, re-removed, etc.:

<pre>
fishbowl:~% sudo puppetd -t
info: Retrieving plugin
info: Caching catalog for fishbowl.rw.madduck.net
info: Applying configuration version '1281773694'
notice: //icinga::master/File[/etc/icinga/puppet-objects/foo.cfg]/checksum: 
defined 'checksum' as '{md5}098f6bcd4621d373cade4e832627b4f6'
notice: //icinga::master/File[/etc/icinga/puppet-objects/foo.cfg]/content: 
defined content as 'unknown checksum'
notice: //icinga::master/File[/etc/icinga/puppet-objects/foo.cfg]/owner: 
defined 'owner' as 'root'
notice: //icinga::master/File[/etc/icinga/puppet-objects/foo.cfg]/group: 
defined 'group' as 'root'
notice: //icinga::master/File[/etc/icinga/puppet-objects/foo.cfg]/mode: defined 
'mode' as '444'
notice: //icinga::master/Nagios_host[localhost]/ensure: created
notice: Finished catalog run in 30.89 seconds
sudo puppetd -t  30.21s user 1.92s system 88% cpu 36.150 total
fishbowl:~% sudo puppetd -t
info: Retrieving plugin
info: Caching catalog for fishbowl.rw.madduck.net
info: Applying configuration version '1281773694'
info: Filebucket[/var/lib/puppet/clientbucket]: Adding 
/etc/icinga/puppet-objects/hosts.cfg(10f47cf228f0148796032749444dd4da)
info: /File[/etc/icinga/puppet-objects/hosts.cfg]: Filebucketed 
/etc/icinga/puppet-objects/hosts.cfg to mainbucket with sum 
10f47cf228f0148796032749444dd4da
notice: /File[/etc/icinga/puppet-objects/hosts.cfg]/ensure: removed
notice: Finished catalog run in 29.78 seconds
sudo puppetd -t  29.26s user 1.78s system 89% cpu 34.658 total
fishbowl:~% sudo puppetd -t
info: Retrieving plugin
info: Caching catalog for fishbowl.rw.madduck.net
info: Applying configuration version '1281773694'
notice: //icinga::master/Nagios_host[localhost]/ensure: created
notice: Finished catalog run in 30.14 seconds
sudo puppetd -t  29.71s user 1.75s system 89% cpu 35.249 total
</pre>

Note how the file resource is not affected once it's created. If I remvoe the
file resource from the module definition, it gets removed as expected.



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to