Hi there,
First of all, if it's a fact, then you really should be doing *${::key1}*
instead.
To use it in template, *<%= @key1 %>* should work just fine. Otherwise,
you can have this: *$localkey = ${::key1}* in your init.pp and then *<%=
@localkey %>* in the template but I don't think you gonna get anything
thing better.
On the agent, if you do: *facter -p key1*, do you get the result that you
expect? Best!
On Tuesday, June 17, 2014 12:33:06 PM UTC+1, Malintha Adikari wrote:
>
>
> I have defined some key value pairs in /etc/facter/facts.d/value.txt
> file. I could use those keys inside my init.pp script and successfully for
> the values using
>
> *${key1}*
>
>
> I want to get those values inside my template file. I have used
>
> *<%= @key1 %>*
>
>
> but it doesn't give me the value. What is the correct way to get the value
> of the external fact inside template.
>
> Regards,
>
> Malintha
>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/35dcdb3b-0209-4b66-a350-42705df5c542%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.