I'm experiencing some difficulty getting custom facts to run. I've
installed them on the puppetmaster in:
${modulepath}/${module}/lib/facter/*.rb
and from there they appear to be copied properly onto the clients, where
they end up in:
/var/lib/puppet/lib/facter/*.rb
On all clients, in puppet.log, the output of puppet-agent mentions
"Loading facts" and seems to do the right thing. However, running facter
on the client, the facts do not show up, even with --debug and with sudo.
On the puppetmaster, they do show up in facter output as expected.
So what's going wrong? I'm running CentOS 6 and Puppet 2.6.6.
Thanks,
Jonathan
I guess facter as a standalone executable doesn't look into
/var/lib/puppet. Try running
FACTERLIB=/var/lib/puppet/lib/facter facter
as described in the custom facts guide [1]
[1] http://docs.puppetlabs.com/guides/custom_facts.html#an-example
-Stefan
Thank you. This fix enables me to view the facts on the command line.
Will any further action be necessary to use the facts in Puppet?
Jonathan
Or use the -p | --puppet option to facter.
--
Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When buying and selling are controlled by legislation, the first
things to be bought and sold are legislators.
-- P.J. O'Rourke
I tried the -p option, and it didn't seem to have any effect. But
setting the FACTERLIB variable as Stefan suggested has worked.
Thanks,
Jonathan
Worth noting that if you set this environment variable in one of your shell environment config files , like .bashrc, you would need to export it.Like thisexport FACTERLIB=/var/lib/puppet/lib/facter
Good point John, though you must remember a lot of users utilise cron to drive the puppet run's on standalone and agents.
So this environment variable is important , especially for cloud based deployments that don't use a puppet master.