Skip to content

Latest commit

 

History

History
149 lines (108 loc) · 4.26 KB

File metadata and controls

149 lines (108 loc) · 4.26 KB

r10k

Killer robot powered Puppet environment deployment. (No, seriously, that's the tagline.)

← Back to CLI Reference


r10k (pronounced "are-ten-kay") deploys Puppet environments from Git branches and installs modules from the Forge. The name is a reference to the Mandalorian R10K assassin droids — because this tool is killer at deployment.

r10k help

$ r10k help

NAME
    r10k - Killer robot powered Puppet environment deployment

USAGE
    r10k <subcommand> [options]

DESCRIPTION
    r10k is a suite of commands to help deploy and manage puppet code for
    complex environments.

COMMANDS
    deploy         Puppet dynamic environment deployment
    help           show help
    puppetfile     Perform operations on a Puppetfile
    version        Print the version of r10k

OPTIONS
    -c --config=<value>         Specify a global configuration file
       --color                  Enable colored log messages
    -h --help                   Show help for this command
    -t --trace                  Display stack traces on application crash
    -v --verbose[=<value>]      Set log verbosity. Valid values: fatal,
                                error, warn, notice, info, debug, debug1,
                                debug2

r10k version

$ r10k version
r10k 5.0.2

r10k deploy

$ r10k help deploy

NAME
    deploy - Puppet dynamic environment deployment

USAGE
    r10k deploy <subcommand>

DESCRIPTION
    `r10k deploy` implements the Git branch to Puppet environment workflow.

SUBCOMMANDS
    display         Display environments and modules in the deployment
    environment     Deploy environments and their dependent modules
    module          Deploy modules in all environments

OPTIONS
       --cachedir=<value>              Specify a cachedir, overriding the value in config
       --exclude-spec[=<value>]        Exclude the module's spec dir for deployment
       --generate-types                Run `puppet generate types` after updating an environment
       --github-app-id=<value>         Github App id. Only valid with rugged provider
       --github-app-key=<value>        Github App private key. Only valid with rugged provider
       --no-force                      Prevent the overwriting of local module modifications
       --oauth-token=<value>           Path to OAuth token for cloning (rugged provider only)
       --private-key=<value>           Path to SSH key for cloning (rugged provider only)
       --puppet-conf=<value>           Path to puppet.conf
       --puppet-path=<value>           Path to puppet executable

r10k puppetfile

$ r10k help puppetfile

NAME
    puppetfile - Perform operations on a Puppetfile

USAGE
    r10k puppetfile <subcommand>

DESCRIPTION
    `r10k puppetfile` provides an implementation of the librarian-puppet
    style Puppetfile.

SUBCOMMANDS
    check       Try and load the Puppetfile to verify the syntax is correct.
    install     Install all modules from a Puppetfile
    purge       Purge unmanaged modules from a Puppetfile managed directory

Common Usage Patterns

# Deploy ALL environments (the most common command)
sudo r10k deploy environment --verbose

# Deploy a specific environment
sudo r10k deploy environment production --verbose

# Deploy environments AND update modules from Puppetfile
sudo r10k deploy environment --modules --verbose

# Deploy a single module across all environments
sudo r10k deploy module stdlib --verbose

# Show what would be deployed (display current state)
r10k deploy display

# Install modules from Puppetfile (in current directory)
r10k puppetfile install --verbose

# Check Puppetfile syntax
r10k puppetfile check

# Purge unmanaged modules
r10k puppetfile purge

Example Configuration

/etc/puppetlabs/r10k/r10k.yaml:

---
# Sources define Git repos that map branches to environments
sources:
  control:
    remote: 'git@github.com:myorg/control-repo.git'
    basedir: '/etc/puppetlabs/code/environments'
    prefix: false

# Where to cache Git repos
cachedir: '/opt/puppetlabs/puppet/cache/r10k'

← Back to CLI Reference

This document was created with the assistance of AI (Grok, xAI). All technical content has been reviewed and verified by human contributors.