The module layout
A module is simply a directory tree with the following structure:
manifests
: This contains the manifests in the modulefiles
: This folder contains the static files that are used by the moduletemplates
: This contains templates that will be used by the Puppet manifestslib
: This contains plugins, such as custom facts and resource types
After the basic structure definition, we will start with our first modules in the next section.
Note
Because each module needs to have an init.pp
file with a class name the same as its module, we will see that in Foreman the class names are exactly same as the module names.
You can also create a module with the puppet generate module
command. The following are the details of how to write the command. For more details, please refer to https://docs.puppetlabs.com/puppet/latest/reference/modules_fundamentals.html#writing-modules. The command is as follows:
puppet module generate <USERNAME>-<MODULE NAME>