[Puppet Users] Re: Puppet agent daemon not seeing a Facter fact

2013-02-20 Thread Eugene Brodsky
A bit of an update: I ended up doing something very hackish, but it works.
Basically, after installing Puppet, I stop the agent, and add a line to 
/etc/init.d/puppet to source /etc/environment. Then I start the agent.
Works fantastically.
I do realize this is a little ugly, but in this case was simpler to 
implement and easier to manage going forward than distributing custom 
Facter plugins.
Thank you John for pointing me in the right direction.
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Re: Puppet agent daemon not seeing a Facter fact

2013-02-15 Thread jcbollinger


On Friday, February 15, 2013 9:56:09 AM UTC-6, Eugene Brodsky wrote:

 Hi all, first post here... reposting this from Stack Overflow as it didn't 
 get much traction there...

 I am using puppet to read a fact from facter, and based on that I apply a 
 different configuration to my modules.
 Problem:

 the puppet agent isn't seeing this fact. Running puppet agent --test 
 interactively 
 works as expected. Even running it non-interactively from a script seems to 
 work fine. Only the agent *daemon* is screwing up.


You seem to be assuming that the daemon will have the environment of a 
login shell, and that when it runs Facter it will provide its own full 
environment to the child process.  Neither of those is a safe assumption.

There are several ways to reliably provide custom facts to Puppet.  The 
customary way is to write a bona fide Facter pluginand distribute it via 
Puppet's automatic pluginsync mechanism, and that's what I would 
recommend.  If you want something simpler, however, then you might want to 
check out this plugin: 
https://github.com/ripienaar/facter-facts/tree/master/facts-dot-d.


John

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.