Ask Your Question

What is the best way to manage code in open source puppet?

asked 2018-10-15 08:35:56 -0600

sanketshirude07 gravatar image

I'm looking for an alternative to code manager in open source puppet. I want to deploy all the changes which are pushed to git by the developers on master in one shot.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-10-15 15:51:04 -0600

luksi1 gravatar image

R10K with Git webhooks works well for us. This will give you the ability to create branches, based on your environments, and automatically pull them to your puppet server when push or merging to Git.

The way this works is you have a yaml file for R10k, which points to a control repo with all the URLs to your modules. Here is an example:

:cachedir: /opt/puppetlabs/puppet/cache/r10k
    basedir: /etc/puppetlabs/code/environments
    prefix: false

Take also a look at PuppetLabs open source docker image for r10k for some tips to get up running, or simply use their solution out-of-the-box at

One tip I can give you as that you can use some "librarian" magic to connect your control repo to your environments. Do do this we use this line of code in our profiles. This will connect your control repo branch to your profile branch. This allows you to merge your various branches in your control repo, without having to manually update each and every branch by itself.

mod 'my/profile',
  :git => '',
  :branch => @librarian.basedir.split('/').last

When it comes to webhooks, we simply use the r10k webhook defined type. It's on the forge.

Good luck!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-10-15 08:35:56 -0600

Seen: 47 times

Last updated: Oct 15