Create LXC system containers easily with Puppet


I'm refactoring Puppet manifests and refactoring requires automated testing.

rspec-puppet and cucumber-puppet test Puppet catalog, but I need to test actual server status that Puppet manifests applied to.

For actual testing, several virtual machines are needed. Vagrant is the one for creating virtual machines for testing easily.

But I'm using KVM mainly and would like to create virtual machines for testing on a KVM based virtual machine.

LXC suits that purpose.

For testing purpose, how to create LXC system containers easily is important. So I've created a Puppet module to create LXC system containers easily.


How To Use

First, git clone puppet-lxc-test-box module and puppet-sysctl module.

$ git clone git:// lxc-test-box
$ git clone git:// sysctl

Next, write a manifest to create system containers.

include lxc-test-box

Exec { path => '/sbin:/usr/sbin:/bin:/usr/bin' }

lxc-test-box::lxc::setup { 'proxy': ipaddress => '' }
lxc-tets-box::lxc::setup { 'www':   ipaddress => '' }
lxc-test-box::lxc::setup { 'db':    ipaddress => '' }

Apply this manifest.

$ sudo puppet apply --modulepath=. lxc-test-box.pp

3 containers will be created.