Puppet Enterprise (PE) includes built-in tools for managing and deploying your Puppet code. Code Manager and r10k can automatically install modules, create and maintain environments, and deploy new code to your masters, all based on code you keep in Git.
Code Manager automates the management and deployment of your new Puppet code. You push your code updates to your version control repository, and then r10k creates environments, installs modules, and deploys and syncs the new code to your masters, so that all your servers start running the new code at the same time, without interrupting agent runs.
If you are already using r10k to manage your Puppet code, we suggest that you upgrade to Code Manager. Code Manager works in concert with r10k, so when you switch to Code Manager, you no longer interact directly with r10k.
If you're using r10k and aren't ready to switch to Code Manager yet, you can continue using r10k alone. You push your code changes to your version control repo, deploy environments from the command line, and r10k creates environments and installs the modules for each one.
Create a control repository for maintaining your environments and code.
Code management uses Git repository (repo) branches to create environments. Environments allow you to designate a node or node group to use a specific environment. For example, you could designate one node group to use the development environment and another to use the production environment. As you update the code in your control repo, code management tracks the state of that repo to keep each environment updated.
Set up a Puppetfile to manage content in your environment.
This file specifies which modules and data to install in your environment, including what version of that content should be installed, and where to download the content from.
Configure Code Manager (recommended) or r10k.
Configure code management in the console's master profile. If you need to customize your configuration further, you can do so by adding keys to Hiera.
Deploy environments. With Code Manager, you can set up a webhook to deploy environments automatically. You can also trigger deployments manually from the command line. If you are using r10k alone, you'll run it manually from the command line whenever you want to deploy.
Run Puppet to enforce code changes on your nodes. Whether you're changing just a few nodes for testing or on a larger set, use the orchestrator command line tool.
The following sections go into detail about setting up and using Code Manager and r10k.