> <%= @int_name = Resolv.new.getname @int_ip %>
??

Maybe this would work better as a custom fact though?

HTH
Den

> On 26 Nov 2015, at 06:57, Dayton Jones <jones.day...@gmail.com> wrote:
> 
> I'm writing a template to populate a file - easy enough...
> 
> What I want is to to grab the list of interfaces, get the ip assigned to that 
> interface and then do a lookup of the ip to get the dns name.
> 
> I'm able to get the interfaces/ips just fine, but can't figure out how to 
> then pass the IP to the function to do the lookup.  Any help is greatly 
> appreciated...
> 
> =======================
> start ERB
> 
> <% scope.lookupvar('interfaces').split(",").each do |interface| %>
> <% @int_ip = scope.lookupvar('ipaddress_'+interface) %>
> <% @int_name = Resolv.new.getname @int_ip %>
> ...
> <% end %>
> 
> end ERB
> ========================
> 
> @int_ip gets popluated and I can manipulate it as needed, but how do I 
> properly pass it to 'Resolv.new.getname' to set the int_name string?
> -- 
> 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/6bf51a8e-eb7f-4bcd-ac77-2451bcbec5ce%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/70A7C917-8436-4688-A6FD-44DC88ED984D%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to