r10k command reference

The r10k command accepts actions, options, and subcommands.

Use this format for r10k commands:
r10k <ACTION> <ACTION_OPTIONS> <SUBCOMMANDS>

r10k command actions

The r10k command supports these actions and action options.

Action Description
deploy Performs a specified subcommand operation on environments. Accepts r10k deploy subcommands.
help Returns r10k command embedded help documentation
puppetfile Performs a specified subcommand operation on an environment's Puppetfile. Environment determined by the current working directory. Accepts r10k puppetfile subcommands.
version Returns your r10k version.

r10k action options

You can modify r10k <ACTION> commands with these options:
Action option Description
--color Enable color-coded log messages.
--help or -h Returns embedded help documentation for a specific action.
--trace or-t Returns stack traces on application crash.
--verbose or -v Specify one of the following log verbosity levels: fatal, error, warn, notice, info, debug, debug1, debug2

r10k deploy subcommands

You can use the following subcommand and subcommand options with the r10k deploy command.

Subcommand Description Subcommand options
display Returns information about environments and their modules.

Refer to: Get environment details with r10k

  • -p: Return module information
  • --detail: Return detailed information
  • --fetch: Query environment sources so you can check for missing environments
  • Append one or more environment names to get information about specific environments.
environment Deploys environment content and modules.

Refer to: Updating environments

  • Append an environment name to deploy a specific environment.
  • -p: Install or update modules declared in the Puppetfile
module Deploys modules only.

Refer to: Installing and updating modules

  • -e: Deploy modules for a specific environment.
  • Append one or more module names to deploy only specific modules.
  • no-force: Prevents overwriting local changes to Git-based modules.

r10k puppetfile subcommands

The r10k puppetfile command accepts these subcommands.

Important: The puppetfile command act on the Puppetfile in the current working directory. Make sure you're in the directory containing the Puppetfile for the environment you want to act on.

The puppetfile command requires write access to an environment’s modules directory. Either switch to an appropriately-provisioned user or use elevated privileges to run these commands.

Append subcommands after the puppetfile action, such as:
r10k puppetfile install
Subcommand Description Subcommand options
check Verifies the Puppetfile syntax is correct.
install Installs all modules declared in the Puppetfile.
  • --puppetfile <FILE_PATH>: Install modules in the current working directory from a Puppetfile at the supplied file path.
  • --moduledir <FILE_PATH>: Install modules declared in the Puppetfile to a custom module directory location.
  • --update_force: Install modules declared in the Puppetfile and forcefully overwrite local changes to Git-based modules.
purge Purges modules not declared in the Puppetfile.