A control repo is a repository of code that manages Puppet environments. It lists Puppet environments and their versioned modules. It can also define node classification and organizational data structures.
Version and installation information
Puppet version: 3.0 and above
Component and version: r10k or Puppet Enterprise Code Manager
Installation type: Standard
Version control the code you use to deploy and manage Puppet environments
A control repo contains files and scripts to version control the code you use to deploy and manage Puppet environments. To use a control repo you need to use r10k or Puppet Enterprise Code Manager to automate the management and deployment of your Puppet code.
r10k and Code Manager use the control repo’s branches to create Puppet environments. Each branch of a connected control repo is copied to an environment with the same name as the branch on the primary server (formerly called a master) at
/etc/puppetlabs/code/environments/<BRANCH NAME>. For example, for the
mycontrolrepo repository, with branches named
development, directories named
development are created in
/etc/puppetlabs/code/environments/<BRANCH NAME>, for theproduction
, anddevelopment` environments.
As you develop and test code, you can have different versions of code and data in different environments. For example, you could use
puppetlabs-motd module version 4.1.0 in the development environment and 3.1.0 in the production environment. As you update the code in your control repo, r10k and code manager track it so that each environment stays updated. Learn more about Puppet environments from our documentation.
production branch is the default environment for code in Puppet agent. Your control repo must by default have a
production branch. Base your other branches and their environments on the production branch.
Making changes to your code through a cycle of testing and merging changes into your control repo’s
production branch minimizes complexity and time spent maintaining environments. However, we recommend that you don’t tie branches and environments to organizational environments like
- Example code with descriptions of subdirectory structure, code, and tooling in
- Managing environments with a control repository
- A control repo template
- Anatomy of a Puppet control repo
- Deploying code: Set up r10k and deploy code from your control repo
- Deploying code: What is a Puppetfile?