Can I access environment variables with Facter in Puppet?

0 votes

Can I access environment variables with Facter in Puppet?

Feb 15 in Puppet by Ruth
152 views

1 answer to this question.

0 votes

Hey @Ruth, 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 Factor runs.

example:

$ FACTER_FOO=”bar”
$ export FACTER_FOO</span>
$ facter | grep  ‘foo’</span>
   foo => bar

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
.

answered Feb 15 by Krishti

edited Feb 15

Related Questions In Puppet

0 votes
1 answer

Can I revoke puppet host's certificate?

Hey @Garima, yes of course you can ...READ MORE

answered Feb 21 in Puppet by Laila
29 views
0 votes
1 answer
0 votes
0 answers
0 votes
1 answer

What are profiles in Puppet?

Wrapper classes that use multiple component modules ...READ MORE

answered Feb 15 in Puppet by Sheela
13 views
+13 votes
2 answers
0 votes
1 answer
0 votes
1 answer

Can I install puppet on windows?

Hey Neha, well, you cannot have puppet ...READ MORE

answered Feb 27 in Puppet by Anvit
22 views
0 votes
1 answer

Service already defines error in Puppet

Hey @Rohan, try this: class MyClass { ...READ MORE

answered Feb 9 in Puppet by Monish
25 views