Issue #20151 has been reported by Patricia Jung.

----------------------------------------
Bug #20151: Nagios types behave differently when config is to be written into 
existing .cfg file
https://projects.puppetlabs.com/issues/20151

* Author: Patricia Jung
* Status: Unreviewed
* Priority: Normal
* Assignee: 
* Category: nagios
* Target version: 
* Affected Puppet version: 3.1.1
* Keywords: 
* Branch: 
----------------------------------------
I'm trying to use exported resources to generate nagios configuration files. 
When the path parameter is set to an existing file containing manually written 
Nagios objects, the nagios types behave inconsistently:

- @@nagios_serviceescalation and @@nagios_servicedependency leave the existing 
Nagios objects intact (though with the Nagios parameters reordered) and add the 
exported resources' content to the end of the file. This way existing 
definitions are being preserved, and, if necessary, overwritten by puppet. For 
example:

===================================================================
--- serviceescalations/<escalation>.cfg (revision 5831)
+++ serviceescalations/<escalation>.cfg (working copy)
@@ -1,4 +1,13 @@
+# HEADER: This file was autogenerated at Tue Apr 09 13:28:38 +0200 2013
+# HEADER: by puppet.  While it can still be managed manually, it
+# HEADER: is definitely not recommended.
 define serviceescalation {
-    use         <escalation>
-    host_name   
host-01,host-02,host-03,host-04,host-05,host-06,host-07,host-08,host-09,host-10
+host_name                      
host-01,host-02,host-03,host-04,host-05,host-06,host-07,host-08,host-09,host-10
+use                           <escalation>
 }
+
+define serviceescalation {
+host_name                      host-05
+## --PUPPET_NAME-- (called '_naginator_name' in the manifest)                
<escalation>
+use                            <escalation>
+}
===================================================================

- @@nagios-service however simply depletes the original content of the file 
given in path so that the resulting file contains generated content only.

Consistent behaviour of all Nagios types would be a major plus, favouring the 
solution already implemented for @@nagios-serviceescalation.


-- 
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.


Reply via email to