lxd
LXD Server Ansible Role
This Ansible role installs LXD from the OS package manager and configures it using a preseed object.
Requirements
None.
Role Variables
Name | Required | Type / Choices | Description |
---|---|---|---|
lxd_config |
yes | object |
LXD preseed configuration object. See the LXD documentation for details. If
you want idempotency checks to work correctly, you have to make sure not to
ommit any values which are output by Example:
|
lxd_extra_users |
no | list(string) |
This role will always add the ansible user to the lxd group, so that it can communicate with the lxd unix socket to perform some of the tasks in this role. You can optionally use this variable to specify additional user names to add to the group. Default: |
lxd_subid_offset |
no | integer |
Offset configured for the subordinate user IDs and subordinate group IDs in
Default: |
lxd_subid_range |
no | integer |
Range configured for the subordinate user IDs and subordinate group IDs in
Default: |
Dependencies
None.
Example Playbook
- hosts: container_host
tasks:
- ansible.builtin.import_role:
name: gliech.lxd
vars:
lxd_config:
config: {}
networks: []
storage_pools:
- config:
source: /var/lib/lxd/storage-pools/default
description: ""
name: default
driver: dir
profiles:
- config:
security.privileged: "true"
description: Default LXD profile
devices:
root:
path: /
pool: default
type: disk
name: default
projects:
- config:
features.images: "true"
features.networks: "true"
features.networks.zones: "true"
features.profiles: "true"
features.storage.buckets: "true"
features.storage.volumes: "true"
description: Default LXD project
name: default
License
This project is licensed under the terms of the GNU General Public License v3.0
ansible-galaxy install gliech/lxd-ansible-role