A Test Kitchen Driver (with Transport) for 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 do not have to prepare any container image specifically, like downloading it or installing ssh
server. The driver will download container image automatically from the provided remote server,
if it's not available locally. Also you can use lxd
transport instead of default ssh
. Which
means files will be uploaded to container using lxc file push
command.
Install using command line:
gem install kitchen-lxd
Example config file may look like this:
---
driver:
name: lxd
binary: lxc # this is default
remote: images # default
network: lxdbr0 # default
fix_chef_install: false # default
fix_hostnamectl_bug: true # default
config: {} # default
transport:
name: lxd
Default values can be omitted, so the minimal config file looks like this:
---
driver:
name: lxd
transport:
name: lxd
You can specify different keys/values under config
. Look for list of the available items in
Lxd Documentation. For example, if you need to start container in privileged mode, add:
---
driver:
name:lxd
config:
security.privileged: true
Available options:
Name | Description | Type | Default |
---|---|---|---|
binary | Path to lxc executable. | String | lxc |
remote | Remote LXD server to download image from, if it does not exist locally. | String | images |
network | Network bridge to attach to container. | String | lxdbr0 |
wait_until_ready | Wait for the network to come up. | Boolean | true |
config | Config key/value to apply to the new container. This hash is passed to lxc init command as --config parameters. |
Hash | {} |
fix_chef_install | Apply fix, to make available installation of Chef Omnibus package. | Boolean | false |
fix_hostnamectl_bug | Apply workaround to Ubuntu hostnamectl bug in LXD. | Boolean | true |
- Source hosted at GitHub
- Report issues/questions/feature requests on GitHub Issues
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:
- Fork the repo
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Created and maintained by Juri Timošin.
Apache 2.0 (see LICENSE)