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
70 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
27 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
11 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
11 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
18 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.