A Puppet module to load other Puppet modules, i.e. include classes into the manifest.
The purpose of puppet-module-loader is to allow both adding to and removing from the list of classes defined in Hiera.
The common pattern for loading modules (classes) through Hiera is to use the array-type parameter "classes". The classes specified in this array is typically loaded into the manifest by hiera_include("classes") in site.pp.
While it is possible to add items to the classes array in different levels of Hiera, it is not possible to remove a class name already in the list.
This drives a Hiera pattern where e.g. common.yaml can only contain the minimal set of common modules to load. There is no way to define any exceptions.
The loader module is built for use with both Puppet 3.x, 4.x and 5.x. The module is platform independent.
Include basic set of modules in Hiera common.yaml:
loader::classes:
hosts: true
ntp: true
pam: true
rsyslog: true
ssh: true
Include additional modules in a group, e.g. groups/webserver.yaml:
loader::classes:
apache: true
postgresql: true
Exclude modules from a particular host, e.g. fqdn/host1.example.com.yaml:
loader::classes:
hosts: false
ssh: false
The string 'present' or 'absent'. If 'present' the loader module will be active, otherwise it will have no effect.
- Default: 'present'
A hash specifying the modules to include. The key is the module name and the value is a boolean. If the value is true the module will be included, if the value is false it will not be included.
- Default: {}
A boolean controlling whether the classes parameter should be merged together from all instances of loader::classes in Hiera.
- Default: true