----- Original Message -----
> From: "Sans" <r.santanu....@gmail.com>
> To: "puppet-users" <puppet-users@googlegroups.com>
> Sent: Wednesday, 25 January, 2017 15:17:19
> Subject: Re: [Puppet Users] how to use external facts in a template?

>> Hi Sans,
>>
>> I think your ERB syntax may be off. Here's an example doing something
>> similar. Instead of Facter.value() just put an @ in front of the fact
>> name.
>>
>> <% @nameservers.each do |nameserver| -%>
>> nameserver <%= nameserver %>
>> <% end -%>
>>
>> Best regards,
>> -g
>>
>>  
> AFAIK (and understand), when you gave this: @nameservers compiler just
> treat that as variable, regardless of the fact it's actually a Fact or
> otherwise. Facter.value() is a valid syntax, which I use very often in my
> template and custom fact. The part of template, also try to determine if
> the fact is defined at all or not. It's not working for any external fact.
> As I already mentioned, it works for other facts, like "hostname" etc.
> 

not been following, but if you're on a recent version @facts["foo"] is the 
best

-- 
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/788926786.267818.1485354014084.JavaMail.zimbra%40devco.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to