March 2017
Beginner to intermediate
925 pages
18h 11m
English
Another handy way to get information into Puppet and Facter is to pass it using environment variables. Any environment variable whose name starts with FACTER_ will be interpreted as a fact. For example, ask facter the value of hello using the following command:
[root@cookbook ~]# facter -p hello Hello, world
Now override the value with an environment variable and ask again:
[root@cookbook ~]# FACTER_hello='Howdy!' facter -p hello Howdy!
It works just as well with Puppet, so let's run through an example.
In this example we'll set a fact using an environment variable:
node cookbook {
notify {"$::hello": }
}Read now
Unlock full access