Chapter 2. Managing Puppet modules
2.1. Installing a Puppet module on Satellite server Copy linkLink copied to clipboard!
You can install a pre-built Puppet module from the Puppet Forge. The Puppet Forge is a repository that provides Puppet modules contributed by the community. Puppet modules flagged as supported are officially supported and tested by Puppet Inc.
This example shows how to add the ntp module to hosts.
Procedure
-
Navigate to forge.puppet.com and search for
ntp. One of the first modules is puppetlabs/ntp. Connect to your Satellite Server using SSH and install the Puppet module:
puppet module install puppetlabs-ntp -i /etc/puppetlabs/code/environments/production/modules
# puppet module install puppetlabs-ntp -i /etc/puppetlabs/code/environments/production/modulesCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
-iparameter to specify the path and Puppet environment, for exampleproduction.Once the installation is completed, the output looks as follows:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
An alternative way to install a Puppet module is to copy a folder containing the Puppet module to the module path as mentioned above. Ensure to resolve its dependencies manually.
2.2. Updating a Puppet module Copy linkLink copied to clipboard!
You can update an existing Puppet module using the puppet command.
Procedure
Connect to your Puppet server using SSH and find out where the Puppet modules are located:
puppet config print modulepath
# puppet config print modulepathCopy to Clipboard Copied! Toggle word wrap Toggle overflow This returns output as follows:
/etc/puppetlabs/code/environments/production/modules:/etc/puppetlabs/code/environments/common:/etc/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules:/usr/share/puppet/modules
/etc/puppetlabs/code/environments/production/modules:/etc/puppetlabs/code/environments/common:/etc/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules:/usr/share/puppet/modulesCopy to Clipboard Copied! Toggle word wrap Toggle overflow If the module is located in the path as displayed above, the following command updates a module:
puppet module upgrade module name
# puppet module upgrade module nameCopy to Clipboard Copied! Toggle word wrap Toggle overflow