Argha Chattopadhyay
2012-Jan-06 09:57 UTC
[Puppet Users] Facter pick up variables from ENV hash of non-root USER
Hi, Does anyone have an idea to pick up custom facts from the ENV hash of a non-root user. I''m asking as I believe the plugin modules for facter pick up the ENV variables of the root user by default. Cheers -- Argha Chattopadhyay -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Michael Stahnke
2012-Jan-06 16:58 UTC
Re: [Puppet Users] Facter pick up variables from ENV hash of non-root USER
On Fri, Jan 6, 2012 at 1:57 AM, Argha Chattopadhyay <orgho@thoughtworks.com> wrote:> Hi, > > Does anyone have an idea to pick up custom facts from the ENV hash of a > non-root user. I''m asking as I believe the plugin modules for facter pick up > the ENV variables of the root user by default.Facter will pickup ENV variables for whatever user is running Puppet. In nearly all cases, that is root on an agent. So, that''s not extremely simple. If you have a look at Puppet Labs stdlib[1], you could drop facts into a facts.d directory with it, and possibly achieve the same thing as environment variables from other users. You could optionally write custom facts with those values, or somehow pass them into root''s environment. In any case, I don''t see a straightforward way to do exactly what you asked. [1] http://forge.puppetlabs.com/puppetlabs/stdlib> > Cheers > > -- > Argha Chattopadhyay > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Felix Frank
2012-Jan-10 08:22 UTC
Re: [Puppet Users] Facter pick up variables from ENV hash of non-root USER
Hi, On 01/06/2012 10:57 AM, Argha Chattopadhyay wrote:> Hi, > > Does anyone have an idea to pick up custom facts from the ENV hash of a > non-root user. I''m asking as I believe the plugin modules for facter > pick up the ENV variables of the root user by default.there seems to be a misconception: The environment is process-specific, not user specific. You will typically alter your user account''s login shell configuration to ensure that shell has a certain environment, but that''s all it is - customization of one chosen process. Don''t try and alter puppet''s behaviour by altering you bashrc or similar, you *will* shoot yourself in the foot. Depending on what you need to achieve, there might be several ways to go about the problem. A simple way might be to write a simple shell wrapper around puppet that exports all your desired environment variables etc. HTH, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.