/chef-metal-lxc

chef-metal-lxc

Primary LanguageRubyApache License 2.0Apache-2.0

chef-metal-lxc

This is the LXC provisioner for chef-metal.

Quick Start

To run the tests, which creates an Ubuntu machine and installs this into it:

gem install chef-metal
rake build
cd test/
chef-client -z vagrant.rb ubuntu12.rb test_machine.rb

Basic Usage

require 'chef_metal_lxc/lxc_provisioner'
with_provisioner ChefMetalLXC::LXCProvisioner.new

Provisioner Creation

The provisioner represents lxc containers in a directory.

ChefMetalLXC::LXCProvisioner.new(...)

Arguments

lxc_path - path where the lxc containers will be located. This ends up being a sort of namespace, since the machines' names must be unique under each path.

Provisioning Options

To specify provisioning options that will be used with all subsequent machine definitions:

with_provisioner_options :template => <template name>,
  :template_options => <arguments>
  :backing_store => <backing store>

These options correspond to the options in lxc create:

  • template: the LXC template name to use.
  • template_options: An array of string arguments to pass to the template.
  • backing_store: The backing store to use for the file system.