Hello,

> I have a facter question, is the use of ruby environmental variables
> encouraged or discouraged? I noticed that path.rb uses the ruby ENV
> object, but id.rb does not use it. However, if id.rb did use it then
> it could be reduced to 5 lines like so:
> 
> Facter.add(:id) do
>     setcode do
>         ENV['USER']
>     end
> end


Not really answering your question, but when I just want to have
environment variables appear as facts, I use the (little known) ability
of facter to transform every variable prepended with "FACTER_" to a
fact:

$ FACTER_foo="bar" facter foo
bar
$ FACTER_now=$(date) facter now
Sun May 30 14:07:19 CEST 2010

Cheers,
Marc


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to