MPI – Create a new module

Written by Ger Apeldoorn on. Posted in Manageable Puppet Infrastructure, Sysadmin


In the MPI, we have a separate repository in Gerrit for each custom-made module.

To create a new module, first set up a new Git repo in Gerrit.

Create Gerrit repo

  • Naming convention: puppet-[modulename]
  • Make sure that you inherit rights from PuppetModuleParent and create an initial commit.
  • Selection_025

  • Then, allow only fast-forward(1) and Save(2).

Add the module to Puppetfile

mod "utility",
  :git => "ssh://[user]@[gerrit-server]/puppet-[something]"
#  :ref => '0.1.0'

Don’t forget to commit this change!

Clone the empty repo to your own environment

r10k puppetfile install

Setup Git-Flow

cd modules/[something]
git branch develop
git flow init -f # Just accept all the defaults
git checkout develop

You can now add & commit files using the git-flow workflow.