Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

zeroturnaround/kitchen-lxd

Repository files navigation

Kitchen::Lxd

Build Status

A Test Kitchen Driver for Lxd.

Requirements

Lxd

Lxd version of 2.3 (the one where "lxc network" commands were introduced) or higher is required for this driver which means that a native package must be installed on the system running Test Kitchen. You must also prepare a container to be used by Test Kitchen. For that make sure there is ssh daemon installed and starting on boot. ( On Ubuntu it can be done by simply installing 'openssh-server' package. ) You can also install Chef Client there, if you do not want Test Kitchen to install it every time the container is started.

Installation and Setup

Install using command line:

gem install kitchen-lxd

Configuration

Available options:

  • image
  • container
  • require_chef_omnibus

image

Define from which lxd image the container will be created.

---
driver:
  image: ubuntu/xenial/amd64

The default is value of platform name.

---
platforms:
  - name: kitchen-xenial64

In this case: 'kitchen-xenial64', expecting to have an lxd image with this name locally.

container

Created container name.

---
driver:
  container_name: my_name

The default is value of kitchen instance name.

---
platforms:
  - name: kitchen-xenial64

suites:
  - name: webserver

In this case: 'webserver-kitchen-xenial64'.

require_chef_omnibus

Determines whether or not a Chef Omnibus package will be installed. There are several different behaviors available:

  • true - the latest release will be installed. Subsequent converges will skip re-installing if chef is present.
  • latest - the latest release will be installed. Subsequent converges will always re-install even if chef is present.
  • <VERSION_STRING> (ex: 10.24.0) - the desired version string will be passed the the install.sh script. Subsequent converges will skip if the installed version and the desired version match.
  • false or nil - no chef is installed.

The default value is unset, or nil.

Development

Pull requests are very welcome! Make sure your patches are well tested. Ideally create a topic branch for every separate change you make. For example:

  1. Fork the repo
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Authors

Created and maintained by ZeroTurnaround.

License

Apache 2.0 (see LICENSE)