You can set 
Nagios_host {
    target => "/etc/nagios/conf.d/${::fqdn}.cfg",
}

somewhere in site.pp file; just make sure it is in the global scope.

This is just defining a default parameter for the resource. Note that
this is a bad practice as everything global


-- 
Nikola

On Mon, Jul 22, 2013 at 03:08:49PM +0100, Jonathan Gazeley wrote:
> Hi all,
> 
> We've been using Puppet to write out our Nagios configs for ages. I
> think I understand it pretty well. Recently we've had reason to set
> 'target' on all Nagios resources, based on the fqdn of the monitored
> host. However I don't want to have to set 'target' by hand on all
> Nagios resources (nor remember to set it on all future ones).
> 
> So my question is: what's the easiest way to bulk-set the 'target'
> parameter according to the fqdn?
> 
> So far I tried setting it on the Nagios server, which didn't work
> because $::fqdn is always the name of the Nagios server, not the
> monitored host
> 
>   Nagios_host <<| |>> {
>     notify => Service['nagios'],
>     target => "/etc/nagios/conf.d/${::fqdn}.cfg",
>   }
> 
> I also tried including this on the monitored host, which didn't work
> because it attempts to realise all Nagios_host resources on the
> monitored host, not the Nagios server.
> 
> Nagios_host <<| |>> { target => "/etc/nagios/conf.d/${::fqdn}.cfg", }
> 
> Is there an easy way to easily making all nagios_* resources have a
> fqdn-specific target?
> 
> Thanks,
> Jonathan
> 
> -- 
> 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 post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to