Can I access environment variables with Facter in Puppet

0 votes

Can I access environment variables with Facter in Puppet?

Feb 15, 2019 in Puppet by Ruth
3,656 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, 2019 by Krishti

edited Feb 15, 2019

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, 2019 in Puppet by Sirajul
• 59,230 points
791 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, 2019 in Puppet by Sirajul
• 59,230 points
1,043 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, 2019 in Puppet by Sirajul
• 59,230 points
853 views
+15 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,036 views
+2 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, 2019 in Puppet by Sirajul
• 59,230 points
802 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP