can we use facts in file location of puppet facts

37 views
Skip to first unread message

Spriya

unread,
Oct 29, 2014, 11:48:34 AM10/29/14
to puppet...@googlegroups.com
Hi,

I am trying to id fact in path location for new puppet facts.

logfile = "/home/${::id}/javaapp.txt"

log = Facter::Util::FileRead.read(logfile)


can we use like this?

Please help me

Felix Frank

unread,
Nov 9, 2014, 6:58:56 PM11/9/14
to puppet...@googlegroups.com
Hi,

it is not at all clear what you are trying to do here. The code you post lacks any relevant context.

I will go ahead and assume that you have a custom fact called 'id', and that you wish to use its value in the code for other custom facts. This is how you do it:

id = Facter.value(:id)
logfile = "/home/#{id}/javaapp.txt"

or even just

logfile = "/home/#{Facter.value(:id)}/javaapp.txt"

HTH,
Felix
Reply all
Reply to author
Forward
0 new messages