Custom Fact to Foreman

728 views
Skip to first unread message

zjhe...@gmail.com

unread,
Sep 12, 2014, 1:11:57 PM9/12/14
to puppet...@googlegroups.com
Trying to get a custom fact to pushed up to foreman so it can be reported on or viewed by other people.  Seems like the reason it doesn't get uploaded is because it only runs with when using
$ facter --puppet

Been searching for how to do this and everything I get is about distributing facts through puppet and pluginsync.  That is all working fine.  I can use the fact in my MOTD module. 

Where do I need to put the file to have it displayed in a normal facter run?

# facter bday

$ facter
-p bday
Jul 31 20:45

If it helps, here is the code from /etc/puppet/environments/test/modules/admin/lib/facter/bday.rb
require 'facter'
Facter.add(:bday) do
        setcode
do
               
Facter::Util::Resolution.exec("/bin/ls -l /root/anaconda-ks.cfg | /bin/awk '{print \$6 \" \" \$7 \" \" \$8}'")
       
end
end


Cristian Falcas

unread,
Sep 12, 2014, 1:18:11 PM9/12/14
to puppet...@googlegroups.com
It will be uploaded on every puppet run. You shouldn't need to do anything.


--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/d75315e2-c8f8-45b2-8227-0cf0b4415bb7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages