puppet module command reference

The puppet module command manages modules with several actions and options.

puppet module actions

Action Description Arguments Example
build Deprecated. Prepares a local module for release on the Forge by building a ready-to-upload archive file. Will be removed in a future release; use Puppet Development Kit instead. A valid directory path to a module. puppet module build modules/apache
changes Compares the files on disk to the md5 checksums and returns an array of paths of modified files. A valid directory path to a module. puppet module changes /etc/code/modules/stdlib
install Installs a module. The full name <username-module_name> of the module to uninstall. puppet module install puppetlabs-apache
list Lists the modules installed in the modulepath specified in the [main] block in the puppet.conf file. None. puppet module list
search Deprecated. Visit the Forge to search for modules. This command searched the Forge for modules matching search values. Deprecated. Deprecated
uninstall Uninstalls a module. The full name <username-module_name> of the module to uninstall. puppet module uninstall puppetlabs-apache
upgrade Upgrades a module to the most recent release or to the specified version. Does not upgrade dependencies. The full name <username-module_name> of the module to upgrade. puppet module upgrade puppetlabs-apache --version 0.0.3

puppet module install action

Installs a module from the Forge or another specified release archive.

Usage:

Copy
puppet module install [--debug] [--environment] [--force | -f] [--ignore-dependencies]
  [--module_repository <REPOSITORY_URL>] [--strict-semver]
  [--target-dir <DIRECTORY/PATH> | -i <DIRECTORY/PATH>] [--version <x.x.x> | -v <x.x.x>]
  <full_module_name>

For example:

Copy
puppet module install --environment testing --ignore-dependencies --version 1.0.0-pre1 --strict-semver false puppetlabs-apache

 

Option Description Value Default
--debug, -d Displays additional information about what the puppet module command is doing. None. If not specified, additional information is not displayed.
--environment Installs the module into the specified environment. An environment name. By default, installs the module into the default environment specified in the puppet.conf file.
--force, -f Installs the module regardless of dependency tree, checksum changes, or whether the module is already installed. By default, installs the module in the default modulepath, even if the module is already installed in another directory. Does not install dependencies. None. If not specified, puppet module install exits and returns information if it encounters installation errors or conflicts.
--ignore-dependencies Does not install any modules required by this module. None. If not specified, the puppet module install action installs the module and its dependencies.
--module_repository Specifies a module repository. A valid URL for a module repository. If not specified, installs modules from the module repository specified in from the puppet.conf file. By default, this is the URL for the Forge.
--strict-semver Whether to exclude pre-release versions. A value of false allows installation of pre-release versions. true, false Defaults to true, excluding pre-release versions.
--target-dir, -i Specifies a directory to install modules. A valid directory path. By default, installs modules into $codedir/environments/production/modules
--version, -v Specifies the module version to install. A semantic version number, such as 1.2.1 or a string specifying a requirement, such as ">=1.0.3". If not specified, installs the most recent version available on the Forge.

puppet module list action

Lists the Puppet modules installed in the modulepath specified in the puppet.conf file's [main] block. Use the --modulepath option to change which directories are scanned.

Usage:

Copy
puppet module list [--tree] [--strict-semver]

For example:

Copy
puppet module list --tree --modulepath etc/testing/modules

 

Option Description Value Default
--modulepath Specifies another modulepath to scan for modules. A valid directory path. By default, scans the default modulepath from the [main] block in the puppet.conf file.
--strict-semver Whether to exclude pre-release versions. A value of false allows uninstallation of pre-release versions. true, false Defaults to true, excluding pre-release versions.
--tree Displays the module list as a tree showing dependencies. None. By default, puppet module list lists installed modules but does not show dependency relationships.

puppet module uninstall action

Uninstalls a module from the default modulepath.

Usage:

Copy
puppet module uninstall [--force | -f] [--ignore-changes | -c] [--strict-semver] [--version=]  <full_module_name>

For example:

Copy
puppet module uninstall --ignore-changes --version 0.0.2 puppetlabs-apache

 

Option Description Value Default
--force, -f Uninstalls the module regardless of dependency tree or checksum changes. None. By default, puppet module uninstall exits and returns an error if it encounters changes, namespace errors, or dependencies.
--ignore-changes Does not use the checksum and uninstalls regardless of modified files. None. By default, if the puppet module uninstall action finds modified files in the module, it exits and returns an error.
--strict-semver Whether to exclude pre-release versions. A value of false allows uninstallation of pre-release versions. true, false Defaults to true, excluding pre-release versions.
--version, -v Specifies the module version to uninstall. A semantic version number, such as 1.2.1 or a string specifying a requirement, such as ">=1.0.3".. By default, puppet module uninstall uninstalls the version installed in the modulepath.

puppet module upgrade action

This command upgrades modules to the most recent released version of the module. This includes upgrades to the most recent major version.

Usage:

Copy
puppet module upgrade [--force | -f] [--ignore-changes | -c] [--ignore-dependencies] 
  [--strict-semver] [--version=] <full_module_name>

For example:

Copy
puppet module upgrade --force --version 2.1.2 puppetlabs-apache

 

Option Description Value Default
--force, -f Upgrades the module regardless of dependency tree or checksum changes. None. By default, puppet module upgrade exits and returns an error if it encounters changes, namespace errors, or dependencies.
--ignore-changes Does not use the checksum and upgrades regardless of modified files. None. By default, if the puppet module upgrade action finds modified files in the module, it exits and returns an error.
--ignore-dependencies Does not attempt to install any missing modules required by this module. None. If not specified, the puppet module upgrade action installs missing module dependencies.
--strict-semver Whether version ranges must exclude pre-release versions. true, false Defaults to true, excluding pre-release versions.
--version, -v Specifies the module version to uninstall. A semantic version number, such as 1.2.1 or a string specifying a requirement, such as ">=1.0.3". By default, puppet module uninstall uninstalls the version installed in the modulepath.