Issue #17871 has been updated by Simon Sellar.
Same issue here using puppet 3.1.1, ruby 1.9.3-p392
After some investigation I have found the following:
1) First run through, everything works properly.<br/>
2) Second run through, only the first resource found in the file resulting
config file (created on the first run) is repeated again.<br/>
3) Subsequent runs leave the configuration file as it is.<br/>
I enabled some debugging output in
puppet-3.1.1/lib/puppet/external/nagios/parser.rb to see what tokens are picked
up, and can confirm that each resource (contact in my case) are parsed
correctly (i.e 2 resources are parsed in on the second run through).
>From the looks of it, when comparing the manifest against the parsed config,
>it is skipping the comparison with the first item in the list from the parsed
>config.
i.e.
<pre>
Manifest Parsed Config
A---. A<---(parsed in, but missed in comparison with Manifest,
then written out anyway on second run)
B----`-------------->B
`--->A<---(created on second run)
</pre>
I'm (very) new to the puppet code, so am having trouble finding the place where
the comparison is taking place to see if I can fix it. Happy to have a look if
someone can point me in the right direction.
----------------------------------------
Bug #17871: Nagios types creating duplicate entries
https://projects.puppetlabs.com/issues/17871#change-89248
* Author: Chris Mague
* Status: Investigating
* Priority: Normal
* Assignee:
* Category: nagios
* 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
<pre>
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',
}
</pre>
================================================================================================
example output
<pre>
[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
</pre>
--
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.