
Enable the usage of btrfs backend. Nothing is done except not using lxd init as it only supports zfs and dir. Change-Id: Ic6390e457b80a5d38957c182f270fc9f9d52a60f
28 lines
747 B
Django/Jinja
28 lines
747 B
Django/Jinja
#!/bin/bash
|
|
# {{ ansible_managed }}
|
|
|
|
{% if (lxd_storage_backend == "zfs" or lxd_storage_backend == "dir") %}
|
|
|
|
# This is a script to configure lxd system settings.
|
|
# "/usr/bin/lxd init"
|
|
|
|
/usr/bin/lxd init \
|
|
--auto \
|
|
--network-address={{ lxd_bind_address }} \
|
|
--network-port={{ lxd_bind_port }} \
|
|
--storage-backend={{ lxd_storage_backend }} \
|
|
{% if lxd_storage_pool is defined %}
|
|
--storage-pool={{ lxd_storage_pool }} \
|
|
{% endif %}
|
|
--trust-password={{ lxd_trust_password }}
|
|
|
|
{% elif (lxd_storage_backend == "btrfs") %}
|
|
|
|
# Check if filesystem if mounted as btrfs.
|
|
# If not nothing happens and storage will still be set to dir by default
|
|
|
|
if [ $(findmnt /var/lib/lxd -o FSTYPE -n) == "btrfs" ]; then
|
|
systemctl restart lxd
|
|
fi
|
|
|
|
{% endif %} |