How do I access an environment variable (from the puppet daemon's environment) in a puppet manifest?
feedback
|
|
From what I can tell Puppet runs without any Bash environment variables. It seems to get all its environment from Facter. There is a script here to import your regular envvars as Facter envvars. | |||
|
feedback
|
|
I think we need more informations on what you are trying to achieve... Facter exposes by default FACTER_ environment variables : http://docs.reductivelabs.com/guides/faq.html#can_i_access_environmental_variables_with_facter
But for $PATH or $USER... Why not tells puppet to use a given path or a user (for an exec ?) explicitly ? | |||
feedback
|
|
You'd need to use a server side function for this if you want the puppetmaster's environment. Since facter gets you client facts. $RUBYLIB/puppet/parser/functions/env.rb:
Use it in your manifests like:
| ||||
|
feedback
|