FAQ
Dear all,

I have a custom fact, that reads a file and then generate the values
dynamically based on the file content. It's something like this:


inFile = "/home/admin/OSs.txt"
gos = {}

if File.exist?(inFile)
open(inFile, 'r').each do |line|
next if line =~ /^\s*(#|$)/
parts = line.split(',').map(&:strip)

case parts[1]
when /^Mac/
(gos[:mac] ||= []) << parts[0]
when /_Win$/
(gos[:win] ||= []) << parts[0]
else
(gos[:linux] ||= []) << parts[0]
end
end
end

Facter.add(:am_running_oss) do
has_weight 100
if gos.count >= 1
setcode { gos.keys.join(',') }
else
setcode { 'undefined' }
end
end

The file is on the PuppetMaster. Hence the custom fact 'am_running_oss' is
not available or empty when it runs on the agent. What are the options I
have to make the custom facts(s) available on every single puppet agent?
Thanks in advance. Cheers!!

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedOct 13, '13 at 9:00a
activeOct 13, '13 at 9:00a
posts1
users1
websitepuppetlabs.com

1 user in discussion

Sans: 1 post

People

Translate

site design / logo © 2021 Grokbase