0

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 the template?

Peter Souter
  • 5,110
  • 1
  • 33
  • 62
Malintha
  • 4,512
  • 9
  • 48
  • 82
  • 1
    What you tried Should Work. Is `key1` the actual name? If not, can you provide it? There may be a variable name issue. – Felix Frank Jun 17 '14 at 12:15
  • This is my values.txt file which is inside the facts.d folder key1=value1 key2=value2 key3=value3 Still I couln't solve this issue – Malintha Jun 18 '14 at 04:32
  • I could solve the issue. Actuaaly I used "portOffset" as my key name. I changed it to "portoffset" (without any capital letter) and it works fine. Is this a issue with external facters ? – Malintha Jun 18 '14 at 04:59
  • 2
    That is **precisely** why I asked for the actual fact name. I'm not aware that fact names are forced to lower case, but seeing as all core facts use lower case only, that may indeed be a limitation. – Felix Frank Jun 18 '14 at 10:15

0 Answers0