Writing Custom Facts Puppet

Posted by / 12-Mar-2020 05:24

Secure Shell, or SSH, is a protocol that is widely used for remote connectivity between computers.

It enables you to create a secure connection from one computer to another.

Since the elements of a structured fact's value are not facts in their own right, they need to be specified in the resolution of the fact itself: aggregate and chunk to get it to work.

I also combined it with a defined function, with the end result being based on the code below.

This produces the following Puppet report: When comparing the output of the commands, puppet agent -t and puppet apply, we can see that the function applied to the puppet agent -t command returns a certname learning.that belongs to the Puppet Master.

The puppet apply command returns a certname web.development.vm, which is the certname that belongs to the web server.

Once you have both the nodes running, you can apply the flib class by running the puppet apply -t command to the Web Server node.When running Puppet in “master-less” mode (puppet apply — modulepath …), functions are executed on the Puppet Agent node.When Puppet is run against the Puppet Master (puppet agent -t), functions are executed on the Puppet Master node.Once the functions have been synchronized, they can be referenced from the Puppet manifests.There is one important thing to remember about how functions are executed.

Writing Custom Facts Puppet-58Writing Custom Facts Puppet-49Writing Custom Facts Puppet-15

Let’s create a new module for functions with the following set of commands: Now that we have created a module to store our custom functions, we can write our first function.