Skip to content
Browse files
Document my (incomplete/evolving) understanding
  • Loading branch information
rubys committed Dec 31, 2015
1 parent c7dffde commit 0fd99794ee57c3e808148326592d099315f1764b
Showing 1 changed file with 59 additions and 15 deletions.
@@ -3,6 +3,24 @@ puppet-kitchen

Test Kitchen + Puppet


Provisioning an Apache Software Foundation VM requires a lot of moving parts
-- things with names like `apt`, `gem`, `hiera`, `kitchen`, `puppet`, and
`r10k`. To make things easier, the Apache infrastructure team provides a base
definition on top of which you install and configure 'modules'. Modules can
be pretty much anything, examples being `ldap` and `tomcat`.

There are two sets of modules that you can draw from: [3rd party modules]( and [ASF]) modules.

As an alternative to a full configuration (which would involve DNS setup,
etc), the recommended process is to copy the relevant configuration file from
the [infrastructure-puppet](
repository to the `default-ubuntu1464`, make changes to that subset of the
configuration, and only copying, committing, and pushing the results when


@@ -45,39 +63,65 @@ for i in $(ls $ipr/3rdParty); do ln -s $ipr/3rdParty/$i ./; done
for i in $(ls $ipr/modules); do ln -s $ipr/modules/$i ./; done

### Boostrapping

kitchen create default
kitchen exec default -c 'sudo gem install deep_merge'
kitchen converge default


Make sure to have some puppet modules in the ``puppet/modules/`` directory.
The current hiera setup assumes you have the following modules:
### Basic

+ [apache](
+ ASF's customfact
+ [concat](
+ [stdlib](
+ [apt](
Start by copying a machine configuration from the
repository to ``puppet/data/node/default-ubuntu1464.yaml``, editing it as
needed, and then running:

If using [GitHub]( to obtain modules, make sure when you clone the module, it only has the module name on the resulting folder.
kitchen converge default

This will bring up a vm, run puppet apply. From there, you can continue modifying the definition and/or writing new puppet module(s) (in ```puppet/modules/$module```) and testing by rerunning the above command.

You can directly `ssh` into your virtual machine using the following command:

git clone apt
kitchen login default

Then edit ``puppet/data/node/default-ubuntu1464.yaml`` to start adding classes and setting class parameters.
If you have started a service like Apache httpd on this machine, you can
access it at the following IP address: ``.

### Modules

Modules are organized into two types: "third party" and "ASF custom".

When you're ready to test, just run:
Third party modules are listed in
and updated using the `bin/pull` command described above. Information on
locating a module can be found at
[puppet labs documentation](

Custom modules are stored in
[infrastructure-puppet/modules/]( Again, documentation on how to write a module can be found in the [puppet labs documentation](

### Cleanup

When done, you can take down and remove the VM with the following command:

kitchen converge default
kitchen destroy default

This will bring up a vm, run puppet apply. From there, you can continue writing your puppet module (in ```puppet/modules/$module```) and testing by running the above command.
### Further reading

Most the the [test-kitchen](
option work with puppet, however make sure to see
the [kitchen-puppet](
documentation (even though the explanations aren't nearly as detailed as it needs to be).

Most information has been taken from [here](

0 comments on commit 0fd9979

Please sign in to comment.