puppet-module(8) - Linux man page

Name

puppet-module - Creates, installs and searches for modules on the Puppet Forge.

Synopsis

puppet module action

Description

This subcommand can find, install, and manage modules from the Puppet Forge, a repository of user-contributed Puppet code. It can also generate empty modules, and prepare locally developed modules for release on the Forge.

Options

Note that any configuration parameter that's valid in the configuration file is also a valid long argument, although it may or may not be relevant to the present action. For example, server is a valid configuration parameter, so you can specify --server <servername> as an argument.

See the configuration file documentation at http://docs.puppetlabs.com/references/stable/configuration.html for the full list of acceptable parameters. A commented list of all configuration options can also be generated by running puppet with --genconfig.

--mode MODE
The run mode to use for the current action. Valid modes are user, agent, and master.
--render-as FORMAT
The format in which to render output. The most common formats are json, s (string), yaml, and console, but other options such as dot are sometimes available.
--verbose
Whether to log verbosely.
--debug
Whether to log debug information.

Actions

build - Build a module release package.

SYNOPSIS
puppet module build path

DESCRIPTION

Prepares a local module for release on the Puppet Forge by building a ready-to-upload archive file.

This action uses the Modulefile in the module directory to set metadata used by the Forge. See http://links.puppetlabs.com/modulefile for more about writing modulefiles.

After being built, the release archive file can be found in the module's pkg directory.

RETURNS

Pathname object representing the path to the release archive.

changes - Show modified files of an installed module.
SYNOPSIS
puppet module changes path

DESCRIPTION

Shows any files in a module that have been modified since it was installed. This action compares the files on disk to the md5 checksums included in the module's metadata.

RETURNS

Array of strings representing paths of modified files.

generate - Generate boilerplate for a new module.
SYNOPSIS
puppet module generate name

DESCRIPTION

Generates boilerplate for a new module by creating the directory structure and files recommended for the Puppet community's best practices.

A module may need additional directories beyond this boilerplate if it provides plugins, files, or templates.

RETURNS

Array of Pathname objects representing paths of generated files.

install - Install a module from the Puppet Forge or a release archive.
SYNOPSIS
puppet module install [--force | -f] [--target-dir DIR | -i DIR] [--ignore-dependencies] [--modulepath MODULEPATH] [--version VER | -v VER] [--environment NAME] name

DESCRIPTION

Installs a module from the Puppet Forge or from a release archive file.

The specified module will be installed into the directory specified with the --target-dir option, which defaults to /Users/matthaus/.puppet/modules.

OPTIONS

--environment NAME - The target environment to install modules into. Only applicable if multiple environments (with different modulepaths) have been configured in puppet.conf.

--force | -f - Force overwrite of existing module, if any.

--ignore-dependencies - Do not attempt to install dependencies.

--modulepath MODULEPATH - The list of directories to check for modules. When installing a new module, this setting determines where the module tool will look for its dependencies. If the --target dir option is not specified, the first directory in the modulepath will also be used as the install directory.

When installing a module into an environment whose modulepath is specified in puppet.conf, you can use the --environment option instead, and its modulepath will be used automatically.

This setting should be a list of directories separated by the path separator character. (The path separator is : on Unix-like platforms and ; on Windows.)

--target-dir DIR | -i DIR - The directory into which modules are installed; defaults to the first directory in the modulepath.

Specifying this option will change the installation directory, and will use the existing modulepath when checking for dependencies. If you wish to check a different set of directories for dependencies, you must also use the --environment or --modulepath options.

--version VER | -v VER - Module version to install; can be an exact version or a requirement string, eg '>= 1.0.3'. Defaults to latest version.

RETURNS

Pathname object representing the path to the installed module.

list - List installed modules
SYNOPSIS
puppet module list [--environment NAME] [--modulepath MODULEPATH] [--tree]

DESCRIPTION

Lists the installed puppet modules. By default, this action scans the modulepath from puppet.conf's [main] block; use the --modulepath option to change which directories are scanned.

The output of this action includes information from the module's metadata, including version numbers and unmet module dependencies.

OPTIONS

--environment NAME - Which environments' modules to list.

--modulepath MODULEPATH - Which directories to look for modules in; use the system path separator character (: on Unix-like systems and ; on Windows) to specify multiple directories.

--tree - Whether to show dependencies as a tree view

RETURNS

hash of paths to module objects

search - Search the Puppet Forge for a module.
SYNOPSIS
puppet module search search_term

DESCRIPTION

Searches the Puppet Forge for modules whose names, descriptions, or keywords match the provided search term.

RETURNS

Array of module metadata hashes

uninstall - Uninstall a puppet module.
SYNOPSIS
puppet module uninstall [--force | -f] [--environment NAME] [--version=] [--modulepath=] name

DESCRIPTION

Uninstalls a puppet module from the modulepath (or a specific target directory).

OPTIONS

--environment NAME - The target environment to uninstall modules from.

--force | -f - Force the uninstall of an installed module even if there are local changes or the possibility of causing broken dependencies.

--modulepath= - The target directory to search for modules.

--version= - The version of the module to uninstall. When using this option, a module matching the specified version must be installed or else an error is raised.

RETURNS

Hash of module objects representing uninstalled modules and related errors.

upgrade - Upgrade a puppet module.
SYNOPSIS
puppet module upgrade [--force | -f] [--ignore-dependencies] [--environment NAME] [--version=] name

DESCRIPTION

Upgrades a puppet module.

OPTIONS

--environment NAME - The target environment to search for modules.

--force | -f - Force the upgrade of an installed module even if there are local changes or the possibility of causing broken dependencies.

--ignore-dependencies - Do not attempt to install dependencies

--version= - The version of the module to upgrade to.

RETURNS

Hash

Examples

build

Build a module release:

$ puppet module build puppetlabs-apache notice: Building /Users/kelseyhightower/puppetlabs-apache for release puppetlabs-apache/pkg/puppetlabs-apache-0.0.1.tar.gz

changes

Show modified files of an installed module:

$ puppet module changes /etc/puppet/modules/vcsrepo/ warning: 1 files modified lib/puppet/provider/vcsrepo.rb

generate

Generate a new module in the current directory:

$ puppet module generate puppetlabs-ssh notice: Generating module at /Users/kelseyhightower/puppetlabs-ssh puppetlabs-ssh puppetlabs-ssh/tests puppetlabs-ssh/tests/init.pp puppetlabs-ssh/spec puppetlabs-ssh/spec/spec_helper.rb puppetlabs-ssh/spec/spec.opts puppetlabs-ssh/README puppetlabs-ssh/Modulefile puppetlabs-ssh/metadata.json puppetlabs-ssh/manifests puppetlabs-ssh/manifests/init.pp

install

Install a module:

$ puppet module install puppetlabs-vcsrepo Preparing to install into /etc/puppet/modules ... Downloading from http://forge.puppetlabs.com ... Installing -- do not interrupt ... /etc/puppet/modules └── puppetlabs-vcsrepo (v0.0.4)

Install a module to a specific environment:

$ puppet module install puppetlabs-vcsrepo --environment development Preparing to install into /etc/puppet/environments/development/modules ... Downloading from http://forge.puppetlabs.com ... Installing -- do not interrupt ... /etc/puppet/environments/development/modules └── puppetlabs-vcsrepo (v0.0.4)

Install a specific module version:

$ puppet module install puppetlabs-vcsrepo -v 0.0.4 Preparing to install into /etc/puppet/modules ... Downloading from http://forge.puppetlabs.com ... Installing -- do not interrupt ... /etc/puppet/modules └── puppetlabs-vcsrepo (v0.0.4)

Install a module into a specific directory:

$ puppet module install puppetlabs-vcsrepo --target-dir=/usr/share/puppet/modules Preparing to install into /usr/share/puppet/modules ... Downloading from http://forge.puppetlabs.com ... Installing -- do not interrupt ... /usr/share/puppet/modules └── puppetlabs-vcsrepo (v0.0.4)

Install a module into a specific directory and check for dependencies in other directories:

$ puppet module install puppetlabs-vcsrepo --target-dir=/usr/share/puppet/modules --modulepath /etc/puppet/modules Preparing to install into /usr/share/puppet/modules ... Downloading from http://forge.puppetlabs.com ... Installing -- do not interrupt ... /usr/share/puppet/modules └── puppetlabs-vcsrepo (v0.0.4)

Install a module from a release archive:

$ puppet module install puppetlabs-vcsrepo-0.0.4.tar.gz Preparing to install into /etc/puppet/modules ... Downloading from http://forge.puppetlabs.com ... Installing -- do not interrupt ... /etc/puppet/modules └── puppetlabs-vcsrepo (v0.0.4)

Install a module from a release archive and ignore dependencies:

$ puppet module install puppetlabs-vcsrepo-0.0.4.tar.gz --ignore-dependencies Preparing to install into /etc/puppet/modules ... Installing -- do not interrupt ... /etc/puppet/modules └── puppetlabs-vcsrepo (v0.0.4)

list

List installed modules:

$ puppet module list /etc/puppet/modules ├── bodepd-create_resources (v0.0.1) ├── puppetlabs-bacula (v0.0.2) ├── puppetlabs-mysql (v0.0.1) ├── puppetlabs-sqlite (v0.0.1) └── puppetlabs-stdlib (v2.2.1) /usr/share/puppet/modules (no modules installed)

List installed modules in a tree view:

$ puppet module list --tree /etc/puppet/modules └─┬ puppetlabs-bacula (v0.0.2)

├── puppetlabs-stdlib (v2.2.1)
├─┬ puppetlabs-mysql (v0.0.1)
│ └── bodepd-create_resources (v0.0.1)
└── puppetlabs-sqlite (v0.0.1)
/usr/share/puppet/modules (no modules installed)

List installed modules from a specified environment:

$ puppet module list --environment production /etc/puppet/modules ├── bodepd-create_resources (v0.0.1) ├── puppetlabs-bacula (v0.0.2) ├── puppetlabs-mysql (v0.0.1) ├── puppetlabs-sqlite (v0.0.1) └── puppetlabs-stdlib (v2.2.1) /usr/share/puppet/modules (no modules installed)

List installed modules from a specified modulepath:

$ puppet module list --modulepath /usr/share/puppet/modules /usr/share/puppet/modules (no modules installed)

search

Search the Puppet Forge for a module:

$ puppet module search puppetlabs NAME DESCRIPTION AUTHOR KEYWORDS bacula This is a generic Apache module @puppetlabs backups

uninstall

Uninstall a module:

$ puppet module uninstall puppetlabs-ssh Removed /etc/puppet/modules/ssh (v1.0.0)

Uninstall a module from a specific directory:

$ puppet module uninstall puppetlabs-ssh --modulepath /usr/share/puppet/modules Removed /usr/share/puppet/modules/ssh (v1.0.0)

Uninstall a module from a specific environment:

$ puppet module uninstall puppetlabs-ssh --environment development Removed /etc/puppet/environments/development/modules/ssh (v1.0.0)

Uninstall a specific version of a module:

$ puppet module uninstall puppetlabs-ssh --version 2.0.0 Removed /etc/puppet/modules/ssh (v2.0.0)

upgrade

upgrade an installed module to the latest version

$ puppet module upgrade puppetlabs-apache /etc/puppet/modules └── puppetlabs-apache (v1.0.0 -> v2.4.0)

upgrade an installed module to a specific version

$ puppet module upgrade puppetlabs-apache --version 2.1.0 /etc/puppet/modules └── puppetlabs-apache (v1.0.0 -> v2.1.0)

upgrade an installed module for a specific environment

$ puppet module upgrade puppetlabs-apache --environment test /usr/share/puppet/environments/test/modules └── puppetlabs-apache (v1.0.0 -> v2.4.0)

Copyright And License

Copyright 2012 by Puppet Labs Apache 2 license; see COPYING