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
468 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

How can i avoid the "environment leakage" in puppet?

Environment leakage is one of the limitations ...READ MORE

answered Jul 25 in Puppet by Sirajul
• 40,980 points
37 views
0 votes
1 answer

Puppet: How many slave nodes can i configure with a single puppet master?

Open source Puppet doesn't have any kind ...READ MORE

answered Aug 9 in Puppet by Sirajul
• 40,980 points
40 views
0 votes
1 answer

Puppet in Docker: Can i run puppet in docker on windows?

With the release of the recent Docker ...READ MORE

answered Aug 20 in Puppet by Sirajul
• 40,980 points
27 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
242 views
0 votes
1 answer
0 votes
1 answer

Docker with puppet: Can I validate the puppetlabs/docker module?

Yes, you can! This module is compliant with ...READ MORE

answered Aug 16 in Puppet by Sirajul
• 40,980 points
24 views
0 votes
1 answer