Hey gang, During the build of our Linux (EL4 and EL5) images, the kickstart process writes out a file (/etc/sysconfig/soe) that contains: SOE_VERSION="Version string" SOE_BUILD_DATE="2009-03-06" I then have /etc/profile.d/facter.sh scripts that has this: . /etc/sysconfig/puppet . /etc/sysconfig/soe FACTER_PUPPETMASTER=$PUPPET_SERVER FACTER_SOE_VERSION=$SOE_VERSION FACTER_SOE_BUILD_DATE=$SOE_BUILD_DATE If I login, obviously the profile is loaded, the envvars are created and running puppetd manually means that Facter can see those envvars and my motd template works (it inserts those values). However, when Puppet runs as a service, it doesn''t seem to instantiate a full profile for Facter, so those envvars are not visible. Is there a preferred/recommended way to ensure that Facter, when called by Puppet as a service, sees particular envvars? Thanks, Avi --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frank Sweetser
2009-Mar-05 21:36 UTC
[Puppet Users] Re: Exposing environment variables to Facter
Avi Miller wrote:> Hey gang, > > During the build of our Linux (EL4 and EL5) images, the kickstart > process writes out a file (/etc/sysconfig/soe) that contains: > > SOE_VERSION="Version string" > SOE_BUILD_DATE="2009-03-06" > > I then have /etc/profile.d/facter.sh scripts that has this: > > . /etc/sysconfig/puppet > . /etc/sysconfig/soe > FACTER_PUPPETMASTER=$PUPPET_SERVER > FACTER_SOE_VERSION=$SOE_VERSION > FACTER_SOE_BUILD_DATE=$SOE_BUILD_DATE > > If I login, obviously the profile is loaded, the envvars are created and > running puppetd manually means that Facter can see those envvars and my > motd template works (it inserts those values). > > However, when Puppet runs as a service, it doesn''t seem to instantiate a > full profile for Facter, so those envvars are not visible. > > Is there a preferred/recommended way to ensure that Facter, when called > by Puppet as a service, sees particular envvars?The files in /etc/profile.d are, as you found out, only loaded for interactive login sessions. I''d recommend putting those lines directly into /etc/sysconfig/puppet (except for the first one, of course), as it''s considered a config file anyway. -- Frank Sweetser fs at wpi.edu | For every problem, there is a solution that WPI Senior Network Engineer | is simple, elegant, and wrong. - HL Mencken GPG fingerprint = 6174 1257 129E 0D21 D8D4 E8A3 8E39 29E3 E2E8 8CEC --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Avi Miller
2009-Mar-05 21:39 UTC
[Puppet Users] Re: Exposing environment variables to Facter
Frank Sweetser wrote:> The files in /etc/profile.d are, as you found out, only loaded for interactive > login sessions. I''d recommend putting those lines directly into > /etc/sysconfig/puppet (except for the first one, of course), as it''s > considered a config file anyway.That seems like an elegant and simple solution. :) Thanks Frank, I blame lack of adequate amounts of coffee for not seeing it sooner. Thanks, Avi --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Possibly Parallel Threads
- [PATCH 1/2] dib: Make the interface between cmdline.ml and dib.ml explicit.
- Re: How to get uuid info inside a lxc container created by libvirt_lxc
- Pipe creation problem: From Java app using rsync + ssh on windows with cygwin
- [PATCH 2/2] dib: Turn a few progress messages into info messages.
- use of exec in puppet