Facter has the feature that it will turn any environment variable named FACTER_* into a fact. I can do this on the commandline no problem, but when I attempt this in puppet it seems to ignore that parts. Is anyone else seeing this? (Is this expected behavior?) I don''t see a ticket or a mail thread on it - though my searching powers have been weak the last couple of weeks... Thanks, --mac
Luke Kanies
2007-Feb-21 09:44 UTC
Re: Facter environment variables being ignored in puppet?
On Feb 21, 2007, at 6:40 AM, Chris McEniry wrote:> Facter has the feature that it will turn any environment variable > named FACTER_* into a fact. I can do this on the commandline > no problem, but when I attempt this in puppet it seems to ignore > that parts. > > Is anyone else seeing this? (Is this expected behavior?) I don''t > see a ticket or a mail thread on it - though my searching powers > have been weak the last couple of weeks...You appear to have found a bug in facter. These facts are only set once, when the library is loaded, which means that they get lost in the shuffle of Puppet. Please file it as a facter bug, or Ben or I can do so if you prefer. -- The conception of two people living together for twenty-five years without having a cross word suggests a lack of spirit only to be admired in sheep. --Alan Patrick Herbert --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Chris McEniry
2007-Feb-21 14:55 UTC
Re: Facter environment variables being ignored in puppet?
> You appear to have found a bug in facter. These facts are only set > once, when the library is loaded, which means that they get lost in > the shuffle of Puppet.I did some more digging and it does seem to be sticking with a value. If I use the simple manifest node ''HOST'' { notify { "FACTER": message => "If a bug, \$sample should not be set: $factspuppetser" } } [root@HOST manifests]# FACTER_FACTSPUPPETSER=BUTIAM \> puppetd \ > -o \ > --server=HOST \ > --verbosenotice: Ignoring --listen on onetime run info: Caching configuration at /var/scea/puppet/etc/localconfig.yaml notice: Starting configuration run notice: //HOSTA/Notify[FACTER]/message: If a bug, $sample should not be set: BUTIAM info: Sent transaction report in 0.18 seconds notice: Finished configuration run in 0.29 seconds [root@HOST manifests]# FACTER_FACTSPUPPETSER=DIFFERENT \> puppetd \ > -o \ > --server=HOST \ > --verbosenotice: Ignoring --listen on onetime run info: Config is up to date notice: Starting configuration run notice: //the-puppet-master002.scea.com/Notify[FACTER]/message: If a bug, $sample should not be set: BUTIAM info: Sent transaction report in 0.19 seconds notice: Finished configuration run in 0.27 seconds> Please file it as a facter bug, or Ben or I can do so if you prefer.Ticket #34 Thanks, --mac
Luke Kanies
2007-Feb-24 11:09 UTC
Re: Facter environment variables being ignored in puppet?
On Feb 21, 2007, at 3:55 PM, Chris McEniry wrote:> [root@HOST manifests]# FACTER_FACTSPUPPETSER=DIFFERENT \ >> puppetd \ >> -o \ >> --server=HOST \ >> --verbose > notice: Ignoring --listen on onetime run > info: Config is up to dateThis is the key line here -- puppetd did not notice that the fact list changed, which means that it considered the configuration up to date. So, it''s a puppet bug, not a facter bug. -- Chase after truth like hell and you''ll free yourself, even though you never touch its coat-tails. -- Clarence Darrow --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Hi! I can´t realy grasp if my error is the exact same one as described here or if its just me being stupid, so I´ll just ask because its a real showstopper for me right now, we still use about 500+ machines with some kind of SuSE installed. (which kinda sucks anyway but what can I do..) :/ I (try to) use a custom fact suse_version (http://reductivelabs.com/trac/puppet/wiki/SuSE_VersionRecipe), which works just fine when I call facter from cli and have set the $RUBYLIB correctly, however when the configuration gets compiled I get the error "err: Could not retrieve configuration: No value for selector param '' '' at /myconfigfile" (returnvalue of suse_version is used as selector), it doesn´t matter if the factfile already exists in the factdir or if it gets pulled in the run that drops the error and if RUBYLIB is set or not. Writing this I´m starting to think this is the same error.. I´d like some confirmation though, please! Thanks! Luke Kanies schrieb:> On Feb 21, 2007, at 3:55 PM, Chris McEniry wrote: > >> [root@HOST manifests]# FACTER_FACTSPUPPETSER=DIFFERENT \ >> >>> puppetd \ >>> -o \ >>> --server=HOST \ >>> --verbose >>> >> notice: Ignoring --listen on onetime run >> info: Config is up to date >> > > This is the key line here -- puppetd did not notice that the fact > list changed, which means that it considered the configuration up to > date. So, it''s a puppet bug, not a facter bug. > > -- > Chase after truth like hell and you''ll free yourself, even though > you never touch its coat-tails. -- Clarence Darrow > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >
Chris McEniry
2007-Feb-26 19:20 UTC
Re: Facter environment variables being ignored in puppet?
I''m not sure if this is the same bug. It seems to be more an issue with the RUBYLIB. Is puppetd running with the same RUBYLIB as you run the cli facter? I believe the default value for any unknown fact is the empty string. So if facter is not finding the library you put in place for the suse_version, it will return an empty string which would produce the error you''re getting. The error from this thread is that changes to facts do not trigger a refresh of the configuration. You can verify this by manually forcing a refresh. Currently, the only way to do that is to make sure that /etc/puppet/localconfig.yaml is older then your site.pp - I''ve just been touching site.pp before the puppetd run to make sure. --mac> I can?t realy grasp if my error is the exact same one as described here > or if its just me being stupid, so I?ll just ask because its a real > showstopper for me right now, we still use about 500+ machines with some > kind of SuSE installed. (which kinda sucks anyway but what can I do..) :/ > > I (try to) use a custom fact suse_version > (http://reductivelabs.com/trac/puppet/wiki/SuSE_VersionRecipe), which > works just fine when I call facter from cli and have set the $RUBYLIB > correctly, however when the configuration gets compiled I get the error > "err: Could not retrieve configuration: No value for selector param '' '' > at /myconfigfile" (returnvalue of suse_version is used as selector), it > doesn?t matter if the factfile already exists in the factdir or if it > gets pulled in the run that drops the error and if RUBYLIB is set or not. > Writing this I?m starting to think this is the same error.. I?d like > some confirmation though, please!
simon
2007-Feb-27 13:38 UTC
Bug in facter/puppet parser - single digit returnvalue from fact is ignored
Hi! Okay, this definitvely is another bug - If a fact returns a single digit, the puppetparser fails for some reason to "see" that value, facter started from cli however is working properly. ##################### require ''facter'' Facter.add("foo_digit") do setcode do 7 end end ###################### used as a selector returns "[...] No value for selector param '' ''[...] ", however ##################### require ''facter'' Facter.add("foo_digit") do setcode do 7 end end ###################### used as a selector returns "[...] No value for selector param ''78'' [...]". /simon Chris McEniry schrieb:> > I''m not sure if this is the same bug. It seems to be more an issue > with the RUBYLIB. Is puppetd running with the same RUBYLIB as you > run the cli facter? > > I believe the default value for any unknown fact is the empty > string. So if facter is not finding the library you put in place > for the suse_version, it will return an empty string which would > produce the error you''re getting. > > The error from this thread is that changes to facts do not trigger > a refresh of the configuration. You can verify this by manually > forcing a refresh. Currently, the only way to do that is to make > sure that /etc/puppet/localconfig.yaml is older then your site.pp - > I''ve just been touching site.pp before the puppetd run to make sure. > > --mac > > > I can?t realy grasp if my error is the exact same one as described here > > or if its just me being stupid, so I?ll just ask because its a real > > showstopper for me right now, we still use about 500+ machines with some > > kind of SuSE installed. (which kinda sucks anyway but what can I > do..) :/ > > > > I (try to) use a custom fact suse_version > > (http://reductivelabs.com/trac/puppet/wiki/SuSE_VersionRecipe), which > > works just fine when I call facter from cli and have set the $RUBYLIB > > correctly, however when the configuration gets compiled I get the error > > "err: Could not retrieve configuration: No value for selector param '' '' > > at /myconfigfile" (returnvalue of suse_version is used as selector), it > > doesn?t matter if the factfile already exists in the factdir or if it > > gets pulled in the run that drops the error and if RUBYLIB is set or > not. > > Writing this I?m starting to think this is the same error.. I?d like > > some confirmation though, please! > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >
Luke Kanies
2007-Feb-27 16:55 UTC
Re: Facter environment variables being ignored in puppet?
On Feb 26, 2007, at 11:12 AM, simon wrote:> Hi! > > I can´t realy grasp if my error is the exact same one as described > here > or if its just me being stupid, so I´ll just ask because its a real > showstopper for me right now, we still use about 500+ machines with > some > kind of SuSE installed. (which kinda sucks anyway but what can I > do..) :/ > > I (try to) use a custom fact suse_version > (http://reductivelabs.com/trac/puppet/wiki/SuSE_VersionRecipe), which > works just fine when I call facter from cli and have set the $RUBYLIB > correctly, however when the configuration gets compiled I get the > error > "err: Could not retrieve configuration: No value for selector param > '' '' > at /myconfigfile" (returnvalue of suse_version is used as > selector), it > doesn´t matter if the factfile already exists in the factdir or if it > gets pulled in the run that drops the error and if RUBYLIB is set > or not. > Writing this I´m starting to think this is the same error.. I´d like > some confirmation though, please!If you''re using sudo to run puppetd, it will unset RUBYLIB by default. You need to add ''Defaults env_keep=RUBYLIB'' to your sudoers file. -- One of the Ten Commandments for Technicians (7) Work thou not on energized equipment, for if thou dost, thy fellow workers will surely buy beers for thy widow and console her in other ways. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Luke Kanies
2007-Feb-27 16:57 UTC
Re: Bug in facter/puppet parser - single digit returnvalue from fact is ignored
On Feb 27, 2007, at 7:38 AM, simon wrote:> Hi! > > Okay, this definitvely is another bug - > If a fact returns a single digit, the puppetparser fails for some > reason > to "see" that value, facter started from cli however is working > properly.I can''t reproduce this problem. Do you get it when you just use ''puppet'' (as opposed to ''puppetd'')? -- The only thing that saves us from the bureaucracy is inefficiency. An efficient bureaucracy is the greatest threat to liberty. --Eugene McCarthy --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
simon
2007-Feb-28 09:10 UTC
Re: Bug in facter/puppet parser - single digit returnvalue from fact is ignored
Hi! I´m very sorry for calling this _your_ bug - it seems like there went something wrong while I built the puppetpackages for our SuSE 8 boxes, neither puppetd nor puppet handled this corryectly. I just tested this on a debianbox and it worked perfectly. Sorry I didn´t do this before writing the complaint, once again ignored the most basic rules of conduct :/ Luke Kanies schrieb:> On Feb 27, 2007, at 7:38 AM, simon wrote: > > >> Hi! >> >> Okay, this definitvely is another bug - >> If a fact returns a single digit, the puppetparser fails for some >> reason >> to "see" that value, facter started from cli however is working >> properly. >> > > I can''t reproduce this problem. > > Do you get it when you just use ''puppet'' (as opposed to ''puppetd'')? > > -- > The only thing that saves us from the bureaucracy is inefficiency. An > efficient bureaucracy is the greatest threat to liberty. > --Eugene McCarthy > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >