Issue #17871 has been updated by Toby McLaughlin.
I get this on Puppet 3.0.1 with PuppetDB 1.0.2.
The following fragment produces one record on the first run, a duplicate record
on the second run, then no further records.
Nagios_host <<||>> {
notify => Service['nagios3'],
target => "/etc/nagios3/conf.d/puppet_hosts.cfg",
require => File['/etc/nagios3/conf.d/puppet_hosts.cfg']
}
----------------------------------------
Bug #17871: Nagios types creating duplicate entries
https://projects.puppetlabs.com/issues/17871#change-78216
Author: Chris Mague
Status: Unreviewed
Priority: Normal
Assignee:
Category:
Target version:
Affected Puppet version: 3.0.1
Keywords: nagios
Branch:
Actual behavior:
When creating a group of nagios resources ( nagios_contactgroups and
nagios_commands were the two types I tested ) puppet writes duplicate entries
in the configuration file.
Expected behavior:
A single entry is created for each resource
Note: I reverted to 2.7.11 and the issue stopped
Repro steps:
1) crate the manifest below
2) run "puppet apply contactgroups.pp" more than once
example manifest
nagios_contactgroup { 'admins':
ensure => present,
alias => 'Nagios_Admins',
members => 'root, mague',
target => '/tmp/a.cfg',
}
nagios_contactgroup { 'pd_oncall':
ensure => present,
alias => 'PagerDuty_Controlled_Oncall_Group',
members => 'mague',
target => '/tmp/a.cfg',
}
nagios_contactgroup { 'icingaadmin':
ensure => present,
alias => 'Contacts_for_when_Icinga_goes_bad',
members => 'mague, pagerduty',
target => '/tmp/a.cfg',
}
nagios_contactgroup { 'org-contact-oncall':
ensure => present,
alias => 'org_contact_oncall',
members => 'mague, pagerduty',
target => '/tmp/a.cfg',
}
nagios_contactgroup { 'pd_hbase':
ensure => present,
alias => 'Contactgroup_Pagerduty_HBase',
members => 'mague',
target => '/tmp/a.cfg',
}
================================================================================================
example output
[cmague@puppet01:/dev/pts/0 ] /tmp
$ puppet apply contactgroups.pp
/dev/mem: Permission denied
racc/parser.rb:27: warning: already initialized constant Racc_Runtime_Version
racc/parser.rb:28: warning: already initialized constant Racc_Runtime_Revision
racc/parser.rb:30: warning: already initialized constant
Racc_Runtime_Core_Version_R
racc/parser.rb:31: warning: already initialized constant
Racc_Runtime_Core_Revision_R
racc/parser.rb:35: warning: already initialized constant
Racc_Runtime_Core_Revision_C
racc/parser.rb:39: warning: already initialized constant
Racc_Main_Parsing_Routine
racc/parser.rb:40: warning: already initialized constant Racc_YY_Parse_Method
racc/parser.rb:41: warning: already initialized constant
Racc_Runtime_Core_Version
racc/parser.rb:42: warning: already initialized constant
Racc_Runtime_Core_Revision
racc/parser.rb:43: warning: already initialized constant Racc_Runtime_Type
/dev/mem: Permission denied
/Stage[main]//Nagios_contactgroup[org-contact-oncall]/ensure: created
/Stage[main]//Nagios_contactgroup[admins]/ensure: created
/Stage[main]//Nagios_contactgroup[icingaadmin]/ensure: created
/Stage[main]//Nagios_contactgroup[pd_oncall]/ensure: created
/Stage[main]//Nagios_contactgroup[pd_hbase]/ensure: created
Finished catalog run in 0.65 seconds
[cmague@puppet01:/dev/pts/0 ] /tmp
$ puppet apply contactgroups.pp
/dev/mem: Permission denied
racc/parser.rb:27: warning: already initialized constant Racc_Runtime_Version
racc/parser.rb:28: warning: already initialized constant Racc_Runtime_Revision
racc/parser.rb:30: warning: already initialized constant
Racc_Runtime_Core_Version_R
racc/parser.rb:31: warning: already initialized constant
Racc_Runtime_Core_Revision_R
racc/parser.rb:35: warning: already initialized constant
Racc_Runtime_Core_Revision_C
racc/parser.rb:39: warning: already initialized constant
Racc_Main_Parsing_Routine
racc/parser.rb:40: warning: already initialized constant Racc_YY_Parse_Method
racc/parser.rb:41: warning: already initialized constant
Racc_Runtime_Core_Version
racc/parser.rb:42: warning: already initialized constant
Racc_Runtime_Core_Revision
racc/parser.rb:43: warning: already initialized constant Racc_Runtime_Type
/dev/mem: Permission denied
/Stage[main]//Nagios_contactgroup[org-contact-oncall]/ensure: created
Finished catalog run in 0.68 seconds
architecture => amd64
arp_eth0 => fe:ff:ff:ff:ff:ff
arp => fe:ff:ff:ff:ff:ff
facterversion => 1.6.14
hardwareisa => x86_64
hardwaremodel => x86_64
hostname => puppet01
id => cmague
interfaces => eth0,lo
ipaddress => 10.101.21.47
ipaddress_eth0 => 10.101.21.47
ipaddress_lo => 127.0.0.1
is_virtual => false
kernel => Linux
kernelmajversion => 3.2
kernelrelease => 3.2.0-29-virtual
kernelversion => 3.2.0
lsbdistcodename => precise
lsbdistdescription => Ubuntu 12.04.1 LTS
lsbdistid => Ubuntu
lsbdistrelease => 12.04
lsbmajdistrelease => 12
macaddress => 12:31:3b:0f:16:c5
macaddress_eth0 => 12:31:3b:0f:16:c5
memoryfree => 5.85 GB
memorysize => 7.28 GB
memorytotal => 7.28 GB
netmask => 255.255.255.0
netmask_eth0 => 255.255.255.0
netmask_lo => 255.0.0.0
network_eth0 => 10.101.21.0
network_lo => 127.0.0.0
operatingsystemrelease => 12.04
operatingsystem => Ubuntu
osfamily => Debian
path => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
physicalprocessorcount => 1
processor0 => Intel(R) Xeon(R) CPU E5507 @ 2.27GHz
processor1 => Intel(R) Xeon(R) CPU E5507 @ 2.27GHz
processorcount => 2
ps => ps -ef
puppetversion => 3.0.1
rubysitedir => /usr/local/lib/site_ruby/1.9.1
rubyversion => 1.9.3
selinux => false
swapfree => 2.00 GB
swapsize => 2.00 GB
timezone => UTC
uniqueid => 650a2f15
uptime => 1 day
uptime_days => 1
uptime_hours => 24
uptime_seconds => 89835
virtual => physical
--
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.