Is there a recommended way to set $FACTERLIB so that Puppet will be able to access custom facts when running as a Red Hat service? If I export $FACTERLIB=/var/puppet/facts and then run Puppet manually I have no problems, but I''m not sure how I should be setting $FACTERLIB when Puppet is running automatically. Cheers, James ********************************************************************************* Important Note This email (including any attachments) contains information which is confidential and may be subject to legal privilege. If you are not the intended recipient you must not use, distribute or copy this email. If you have received this email in error please notify the sender immediately and delete this email. Any views expressed in this email are not necessarily the views of AXA-Tech Australia. Thank you. **********************************************************************************
On Jul 16, 2007, at 10:42 PM, HARRIS Jimmy ((AXA-Tech-AU)) wrote:> Is there a recommended way to set $FACTERLIB so that Puppet will be > able > to access custom facts when running as a Red Hat service? > > If I export $FACTERLIB=/var/puppet/facts and then run Puppet > manually I > have no problems, but I''m not sure how I should be setting $FACTERLIB > when Puppet is running automatically.Are you copying facts there manually, instead of using factsync? It looks like my code assumes that you''ll be using factsync, rather than copying them yourself, and it only looks there if factsync is enabled. If you''re doing that, you should just put the facts in the libdir, in a facter/ subdirectory. -- God loved the birds and invented trees. Man loved the birds and invented cages. -- Jacques Deval --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
> > Is there a recommended way to set $FACTERLIB so that Puppet will be > > able to access custom facts when running as a Red Hat service? > > > > If I export $FACTERLIB=/var/puppet/facts and then run Puppetmanually> > I have no problems, but I''m not sure how I should be setting > > $FACTERLIB when Puppet is running automatically. > > Are you copying facts there manually, instead of using > factsync? It looks like my code assumes that you''ll be using > factsync, rather than copying them yourself, and it only > looks there if factsync is enabled. > > If you''re doing that, you should just put the facts in the > libdir, in a facter/ subdirectory.No, I''m using factsync and the facts are being copied across with no problems, but facter doesn''t seem to find them. I have factpath and factdest both set to $vardir/facts - should I change that? ********************************************************************************* Important Note This email (including any attachments) contains information which is confidential and may be subject to legal privilege. If you are not the intended recipient you must not use, distribute or copy this email. If you have received this email in error please notify the sender immediately and delete this email. Any views expressed in this email are not necessarily the views of AXA-Tech Australia. Thank you. **********************************************************************************
> No, I''m using factsync and the facts are being copied across > with no problems, but facter doesn''t seem to find them. I > have factpath and factdest both set to $vardir/facts - should > I change that?Scratch this - I have just tested whether the facts are being used by Puppet by embedding them in an erb template file and they do work. It''s just when I run facter manually that they aren''t recognised. I can live with that or work around it by exporting $FACTERLIB. James ********************************************************************************* Important Note This email (including any attachments) contains information which is confidential and may be subject to legal privilege. If you are not the intended recipient you must not use, distribute or copy this email. If you have received this email in error please notify the sender immediately and delete this email. Any views expressed in this email are not necessarily the views of AXA-Tech Australia. Thank you. **********************************************************************************
On Jul 16, 2007, at 11:33 PM, HARRIS Jimmy ((AXA-Tech-AU)) wrote:> Scratch this - I have just tested whether the facts are being used by > Puppet by embedding them in an erb template file and they do work. > It''s > just when I run facter manually that they aren''t recognised. I can > live > with that or work around it by exporting $FACTERLIB.Exactly. Factsync is a Puppet thing, so Facter doesn''t know about it by default. -- It is dangerous to be right when the government is wrong. -- Voltaire --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
On Tue, 2007-07-17 at 13:42 +1000, HARRIS Jimmy (AXA-Tech-AU) wrote:> Is there a recommended way to set $FACTERLIB so that Puppet will be able > to access custom facts when running as a Red Hat service? > > If I export $FACTERLIB=/var/puppet/facts and then run Puppet manually I > have no problems, but I''m not sure how I should be setting $FACTERLIB > when Puppet is running automatically.You can put the export statement into /etc/sysconfig/puppet - that file is sourced by the puppet init script. Not ideal because you have to make sure all your clients have that modified file in sysconfig, but that will work. David