1.

Can I Access Environment Variables With Facter?

Answer»

Not DIRECTLY. However, Facter reads in custom facts from a special subset of environment VARIABLES. Any environment variable with a prefix of FACTER_ will be converted into a fact when Facter runs. For example:

 The value of the FACTER_FOO environment variable would now be available in your Puppet manifests as $FOO, and would have a value of ‘bar’. Using shell SCRIPTING to export an arbitrary subset of environment variables as facts is left as an exercise for the reader.

Not directly. However, Facter reads in custom facts from a special subset of environment variables. Any environment variable with a prefix of FACTER_ will be converted into a fact when Facter runs. For example:

 The value of the FACTER_FOO environment variable would now be available in your Puppet manifests as $foo, and would have a value of ‘bar’. Using shell scripting to export an arbitrary subset of environment variables as facts is left as an exercise for the reader.



Discussion

No Comment Found