On 07/23/2012 11:59 AM, asq wrote:
> i don't want to define nagiosip - it should be inherited from fact
> (current set IP address on given node). ie.
> project A: $nagiosip = $ipaddress_bond0_1234
> project B: $nagiosip = $ipaddress_bond0_1235
> project C: $nagiosip = $ipaddress_eth2
> project D: $nagiosip = $ipaddress_bond0_555

This is what I meant, sort of.

Your hiera stores will probably have a "project" hierarchy layer. What
you want to do is add a "vlan" value to this layer. Each node can lookup
hiera("vlan") then, e.g. $vlan = hiera("vlan").

In your baseclass (or nagios::host class proper), you can retrieve the
IP e.g. via
inline_template("<%= scope.lookupvar('ipaddress_bond0_'+vlan) %>")

(code is untested)

HTH
Felix

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" 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-users?hl=en.

Reply via email to