A control repository 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. You can use it to version control the code you use to deploy and manage Puppet environments.
Version and installation information
Puppet Enterprise version: all supported
Solution
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 Code Manager or r10k to automate the management and deployment of your Puppet code.
r10k and Code Manager use control repo 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 at /etc/puppetlabs/code/environments/<BRANCH NAME>
. For example, for the mycontrolrepo
repository, with branches named production
, test
, and development
, directories named production
, test
, and development
are created in /etc/puppetlabs/code/environments/<BRANCH NAME>
, for the production
, test
, and development
environments. The default environment for code in Puppet is the production
branch, so your control repo must have a production
branch. Base your other branches and their environments on the production branch.
As you develop and test code, you can put different versions of code and data in different environments. For example, you could use puppetlabs-motd
module version 6.2.0 in the development environment and version 6.0.0 in the production environment.
Using testing and merging cycles to make changes to your control repo production
branch minimizes complexity and time spent maintaining environments.
If you are using Code Manager, you can deploy code from your repo to Puppet Enterprise (PE) using a webhook , manually via a command, or by using a custom script.
If you are using r10k, you must deploy code manually.
How can we improve this article?
0 comments
Please sign in to leave a comment.
Related articles