Sounds like you want @servers[@hostname]['node'] ? If you want to match on the 
ip address that sounds like you'd have to loop over it or build an ip=>hostname 
mapping.

http://docs.puppetlabs.com/guides/templating.html#referencing-variables

On Thu, May 29, 2014 at 08:08:53AM -0700, Christopher Fitchett wrote:
> Hi,  I have a YAML file constructed like this:
> 
> servers:
>    server1:
>        host: 1.1.1.1
>        node: 1
>    server2:
>        host: 1.1.1.2
>        node: 2
> 
> I have an erb template that needs the node id where the it address belongs to 
> the machine it is running on.  Is there a way in ruby to select the node 
> value the host matches a value returned from facter?
> 
> -- 
> 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 puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/72475b39-c846-4549-9f37-36a5995a4b93%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20140529165916.GA3767%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.

Reply via email to