salt.states.lxd module

Manage LXD profiles.

New in version 2019.2.0.

maintainer

René Jochum <rene@jochums.at>

maturity

new

depends

python-pylxd

platform

Linux

salt.states.lxd.authenticate(name, remote_addr, password, cert, key, verify_cert=True)

Authenticate with a remote peer.

remote_addr :

An URL to a remote Server, you also have to give cert and key if you provide remote_addr!

Examples:

https://myserver.lan:8443 /var/lib/mysocket.sock

password :

The PaSsW0rD

cert :

PEM Formatted SSL Zertifikate.

Examples:

/root/.config/lxc/client.crt

key :

PEM Formatted SSL Key.

Examples:

/root/.config/lxc/client.key

verify_certTrue

Wherever to verify the cert, this is by default True but in the most cases you want to set it off as LXD normaly uses self-signed certificates.

name:

Ignore this. This is just here for salt.

salt.states.lxd.config_managed(name, value, force_password=False)

Manage a LXD Server config setting.

name :

The name of the config key.

value :

Its value.

force_passwordFalse

Set this to True if you want to set the password on every run.

As we can't retrieve the password from LXD we can't check if the current one is the same as the given one.

salt.states.lxd.init(name, storage_backend='dir', trust_password=None, network_address=None, network_port=None, storage_create_device=None, storage_create_loop=None, storage_pool=None, done_file='%SALT_CONFIG_DIR%/lxd_initialized')

Initalizes the LXD Daemon, as LXD doesn't tell if its initialized we touch the the done_file and check if it exist.

This can only be called once per host unless you remove the done_file.

name :

Ignore this. This is just here for salt.

storage_backend :

Storage backend to use (zfs or dir, default: dir)

trust_password :

Password required to add new clients

network_addressNone

Address to bind LXD to (default: none)

network_portNone

Port to bind LXD to (Default: 8443)

storage_create_deviceNone

Setup device based storage using this DEVICE

storage_create_loopNone

Setup loop based storage with this SIZE in GB

storage_poolNone

Storage pool to use or create

done_file :

Path where we check that this method has been called, as it can run only once and theres currently no way to ask LXD if init has been called.