On Tuesday, January 14, 2014 5:42:54 AM UTC-6, Jonathan Gazeley wrote: > > On 13/01/14 23:00, jcbollinger wrote: > > Puppet expects a comma-delimited string of contact group names (as will > appear in the target config file) rather than an array. Upon receiving an > array, it somehow chooses just one of its elements. > > > It seems your second suggestion was correct. The nagios_* types expect a > comma-separated string, not an array. >
Go, me! > This is ridiculous and bizarre behaviour and seems to defy the whole point > of having a managed resource, and there is an old, open bug for it. > > http://projects.puppetlabs.com/issues/4020 > > I think "ridiculous and bizarre" is a bit strong. It's strange that the type selects one element and ignores the rest, but it's not so surprising that's what's wanted in the first place is whatever string is supposed to be plugged in to the corresponding hole in the Nagios config file. That's even a viable way to read the documentation for the type. And I certainly don't understand what any of this has to do with "the whole point of having a managed resource". > There's a workaround using templates as a filthy hack: > > # manifest.pp > nagios_host { "$fqdn": > address => "$ipaddress", > hostgroups => template("join_hostgroups.erb") > } > > You seem angry about this. I don't understand why. Anyway, if you have Puppetlabs's "stdlib" add-in module installed, then it provides a join() function that can replace the template. Or at minimum it would probably be better to use an inline_template() instead of an external one. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/eae76922-01c5-4352-acaa-4052e6933b5c%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
