Hello, I''m trying to add an environment variable as fact like this : #export $FACTER_test="infof" #facter | grep test test => infof But my fact don''t synchronize with puppet master. I don''t see it in / var/puppet/yaml/clientfile.yaml If I want this works, I''ve need to start puppet like this : #puppetd -vt --factsync but factsync''s setting only works with test''s setting I''ve recently seen that adding custom fact method has changed so I''ve followed the wiki "plugin in module" to create my own fact. I successfully create this fact : # home.rb Facter.add("home") do setcode do ENV[''HOME''] end end And try unsuccessfully this one : # salle.rb Facter.add("salle") do setcode do ENV[''FACTER_test''] end end Puppet refuse to synchronize my own environments variables unless I run the deamon manually : #puppetd -vt --factsync With my settings, Custom fact works but no with custom environments variables What''s wrong ? Serge FELIX On puppet master : ------------------ # puppet.conf [puppetmasterd] modulepath = /etc/puppet/modules ------------------ ------------------ #fileserver.conf [files] path /etc/puppet/files #[facts] # I comment this according to the "plugin in module" new method # path /etc/puppet/modules/custom/plugins/facter [plugins] [modules] ---------------------- On client : --------------------- #puppet.conf [main] server = toto.toto.fr # Where Puppet stores dynamic and growing data. # The default value is ''/var/puppet''. vardir = /var/lib/puppet # The Puppet log directory. # The default value is ''$vardir/log''. logdir = /var/log/puppet # Where Puppet PID files are kept. # The default value is ''$vardir/run''. rundir = /var/run/puppet # Where SSL certificates are kept. # The default value is ''$confdir/ssl''. ssldir = $vardir/ssl # I comment this according to the "plugin in module" new method # pluginsync = true factpath = $vardir/lib/facter ------------------------- -- 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.
Legrave wrote:> Facter.add("salle") do > setcode do > ENV[''FACTER_test''] > end > end > > Puppet refuse to synchronize my own environments variables unless I > run the deamon manually : > #puppetd -vt --factsync >Where are you setting `FACTER_test''? =scott -- 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.
I''m on Gentoo. I''ve created /etc/env.d/99facter with FACTER_test=infof and in console : env_update && source /etc/profile All my custom facts works when I run puppetd with -vt --factsync If I start it normally, only the fact with ENV[''HOME''] works. I run puppet 0.24.8 thanks On 21 déc, 23:41, Scott Smith <sc...@ohlol.net> wrote:> Legrave wrote: > > Facter.add("salle") do > > setcode do > > ENV[''FACTER_test''] > > end > > end > > > Puppet refuse to synchronize my own environments variables unless I > > run the deamon manually : > > #puppetd -vt --factsync > > Where are you setting `FACTER_test''? > > =scott-- 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.
Scott Smith
2009-Dec-22 00:39 UTC
Re: [Puppet Users] Re: custom fact and environment variable
Legrave wrote:> I''m on Gentoo. > I''ve created /etc/env.d/99facter > with FACTER_test=infof > and in console : env_update && source /etc/profile >If you want puppetd to inherit environment variables, set them in the puppetd init script. I really don''t see any value to gain by setting facts this way, but that''s another discussion. -scott -- 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.
The --factsync only works in test mode. And the flag factsync=true in puppet.conf has no effect I want to target a pool of machines that have an environment variable in common. The FAQ says : "Facter has a special types of facts that can be set from environment variables. Any environment variable with a prefix of FACTER will be taken by Facter and converted into a fact" This works well in local but there is no synchronize with puppetmaster unless I run the client with : puppetd -vt --factsync It make me crazy> If you want puppetd to inherit environment variables, set them in the puppetd init script. > > I really don''t see any value to gain by setting facts this way, but that''s another discussion. > > -scott-- 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.
I find the problem. I need to specify which environments variables are passed to rc script via the file /etc/conf.d/env_whitelist On 23 déc 2009, 12:09, Legrave <legr...@gmail.com> wrote:> The --factsync only works in test mode. > And the flag factsync=true in puppet.conf has no effect > > I want to target a pool of machines that have an environment variable > in common. > > The FAQ says : > "Facter has a special types of facts that can be set from environment > variables. Any environment variable with a prefix of FACTER will be > taken by Facter and converted into a fact" > > This works well in local but there is no synchronize with puppetmaster > unless I run the client with : puppetd -vt --factsync > > It make me crazy > > > If you want puppetd to inherit environment variables, set them in the puppetd init script. > > > I really don''t see any value to gain by setting facts this way, but that''s another discussion. > > > -scott-- 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.