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/
>             (g_C[:mac] ||= []) << parts[0]
>         when /_Win$/
>             (g_C[:win] ||= []) << parts[0]
>         else
>             (g_C[: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+unsubscr...@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.

Reply via email to