VLT-Website-Heading

How to use Puppet's Control Repository with Puppet Enterprise

Aug 3, 2021 11:47:00 PM / by Vu Long Tran

How to use Puppet's Control Repository with Puppet Enterprise

This is a template control repository that has the minimum amount of scaffolding to make it easy to get started with r10k or Puppet Enterprise's Code Manager.

Why you might want to install this?

Code Manager automates the management and deployment of your Puppet code. Push code updates to your source control repo, and then Puppet syncs the code to your masters, so that all your servers start running the new code at the same time, without interrupting agent runs. More details - Managing code with Code Manager.

Prepare your local git client to authenticate with GitHub.com or a local GitHub Enterprise instance. You can do something similar if you are using GitLab as well. 

Generating SSH keys on Github
Add SSH key to your Github account

Create a repository called control-repo in your user account or organization. Ensure that "Initialize this repository with a README" is not selected.

Create a new repository for Github

Make a note of your repository URL (HTTPS or SSH, depending on your security configuration).

Clone this control repository to your laptop/workstation:

git clone <repository url>

(example) git clone https://github.com/puppetlabs/control-repo

cd control-repo


Remove this repository as the origin remote:

git remote remove origin

Add your internal repository as the origin remote:

git remote add origin <url of your github repository>

(Example) git remote add origin https://github.com/vulongtran/control-repo

Push the production branch of the repository from your machine up to your git server

git push origin production

control-repo-connectivity2-1

Or if you prefer, you can also push the master branch of the repository from your machine up to your git server.

git push origin master

control-repo-connectivity-1

You should be all set now, have fun! 

Topics: developer, coding, git

Vu Long Tran

Written by Vu Long Tran

Solutions Engineer APAC. ex-@Forrester consultant. Writing on #cloud #howto guides and #tech tinkering!