Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

lxc (11) Versions 1.1.6

Chef driven Linux Containers

Policyfile
Berkshelf
Knife
cookbook 'lxc', '= 1.1.6', :supermarket
cookbook 'lxc', '= 1.1.6'
knife supermarket install lxc
knife supermarket download lxc
README
Dependencies
Quality -%

LXC

Manage linux containers with Chef.

Recipes

default

Installs the packages and configuration files needed for lxc on the server. If
the node uses apt-cacher-ng as a client, the server will be reused when building
containers.

install_dependencies

Installs the packages needed to support lxc's containers.

containers

This recipe creates all of the containers defined in the ['lxc']['containers']
hash. Here is an example of an example container:

node['lxc']['containers']['example'] = { 
  'template' => 'ubuntu',
  'initialize_commands' => ['apt-get update']
}

knife

Install and manage containers via the knife-remotelxc plugin.

LWRPs

lxc

Allows for creation, deletion, and cloning of containers

lxc_config

Allows configuration of the LXC configuration file

lxc_fstab

Allows defining mounts to be used within the container

lxc_interface

Allows configurations of network interfaces within a container

lxc_ephemeral

Run a command within an ephemeral container

lxc_container

Creates a container using the lxc LWRP and configures the container
as requested. This resource also allows nesting lxc_fstab and
lxc_interface within the container resource.

Example

include_recipe 'lxc'

lxc_container 'my_container' do
  action :create
  validation_client 'my-validator'
  server_uri 'https://api.opscode.com/organizations/myorg'
  validator_pem content_from_encrypted_dbag
  run_list ['role[base]']
  chef_enabled true
  fstab_mount "Persist" do
    file_system '/opt/file_store'
    mount_point '/opt/file_store'
    type 'none'
    options 'bind,rw'
  end
end

lxc_container 'my_container_clone' do
  action :create
  clone 'my_container'
  chef_enabled true
end

lxc_service 'my_container_clone' do
  action :start
end

Containers do not have to be Chef enabled but it does make them
extremely easy to configure. If you want the Omnibus installer
cached, you can set the attribute

node['omnibus_updater']['cache_omnibus_installer'] = true

in a role or environment (default is false). The lxc_container
resource also provides initialize_commands which an array of
commands can be provided that will be run after the container is
created.

Repository:

Contributors

No quality metric results found