damex.incus.incus_instances role – Ensure Incus instances.
Note
This role is part of the damex.incus collection (version 1.6.1).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it use: ansible-galaxy collection install damex.incus.
To use it in a playbook, specify: damex.incus.incus_instances.
Entry point main – Ensure Incus instances.
Synopsis
Ensure Incus instances.
Parameters
Parameter |
Comments |
|---|---|
List of instances to ensure. |
|
Instance configuration keys. |
|
Use instance NIC names and MTU for default interfaces. Choices:
|
|
Whether to restart the instance after a crash. Choices:
|
|
Whether to start the instance on daemon startup. Choices:
|
|
Seconds to wait after the instance started. |
|
Instance startup priority (higher starts first). |
|
Action to take on host shutdown. |
|
Seconds to wait for instance to stop on host shutdown. |
|
Instance shutdown priority (higher stops first). |
|
Cloud-init network configuration. |
|
Bond interface configurations. |
|
Static addresses in CIDR notation. |
|
Whether to enable DHCPv4. Choices:
|
|
Member interfaces for the bond. |
|
Bond name. |
|
DNS server configuration. |
|
List of DNS server addresses. |
|
Bond parameters. |
|
MII monitoring interval in milliseconds. |
|
Bonding mode. |
|
Static routes for the bond. |
|
Route destination in CIDR notation. |
|
Gateway address for the route. |
|
Bridge interface configurations. |
|
Static addresses in CIDR notation. |
|
Whether to enable DHCPv4. Choices:
|
|
Member interfaces for the bridge. |
|
Bridge name. |
|
DNS server configuration. |
|
List of DNS server addresses. |
|
Bridge parameters. |
|
Forwarding delay in seconds. |
|
Whether to enable Spanning Tree Protocol. Choices:
|
|
Static routes for the bridge. |
|
Route destination in CIDR notation. |
|
Gateway address for the route. |
|
Ethernet interface configurations. |
|
Static addresses in CIDR notation. |
|
Whether to enable DHCPv4. Choices:
|
|
Match rules for the interface. |
|
Kernel driver name to match. |
|
Interface name. |
|
DNS server configuration. |
|
List of DNS server addresses. |
|
Static routes for the interface. |
|
Route destination in CIDR notation. |
|
Gateway address for the route. |
|
Network renderer to use. |
|
Network config format version. |
|
VLAN interface configurations. |
|
Static addresses in CIDR notation. |
|
Whether to enable DHCPv4. Choices:
|
|
VLAN ID. |
|
Parent interface for the VLAN. |
|
VLAN interface name. |
|
DNS server configuration. |
|
List of DNS server addresses. |
|
Static routes for the VLAN. |
|
Route destination in CIDR notation. |
|
Gateway address for the route. |
|
Cloud-init user data configuration. |
|
Commands to run early in the boot process. |
|
Password change settings. |
|
Whether the password expires on first login. Choices:
|
|
Whether to upgrade packages on first boot. Choices:
|
|
Packages to install on first boot. |
|
Password for the default user. |
|
Power state change after cloud-init completes. |
|
Power state action to take. Choices:
|
|
Commands to run after cloud-init completes. |
|
Whether to enable SSH password authentication. Choices:
|
|
Default user name. |
|
Files to create on first boot. |
|
Content to write to the file. |
|
Owner and group of the file. |
|
Absolute path of the file to create. |
|
File permissions in octal notation. |
|
Cloud-init vendor data configuration. |
|
Commands to run early in the boot process. |
|
Password change settings. |
|
Whether the password expires on first login. Choices:
|
|
Whether to upgrade packages on first boot. Choices:
|
|
Packages to install on first boot. |
|
Password for the default user. |
|
Power state change after cloud-init completes. |
|
Power state action to take. Choices:
|
|
Commands to run after cloud-init completes. |
|
Whether to enable SSH password authentication. Choices:
|
|
Default user name. |
|
Files to create on first boot. |
|
Content to write to the file. |
|
Owner and group of the file. |
|
Absolute path of the file to create. |
|
File permissions in octal notation. |
|
Evacuation behavior during cluster evacuation. Choices:
|
|
Number or range of CPUs to expose. |
|
CPU time allowance as a percentage or fixed duration. |
|
NUMA nodes to restrict the instance to. |
|
CPU scheduling priority compared to other instances. |
|
I/O request priority when under load (0-10). |
|
Limit for 1GB huge pages. |
|
Limit for 1MB huge pages. |
|
Limit for 2MB huge pages. |
|
Limit for 64KB huge pages. |
|
Percentage of host memory or fixed value in bytes. |
|
Memory limit enforcement mode. |
|
Whether to enable memory hotplug. |
|
Whether to back instance memory with huge pages. Choices:
|
|
OOM killer priority for the instance. |
|
Whether to encourage or discourage swapping. |
|
Swap priority compared to other instances. |
|
Network I/O priority compared to other instances. |
|
Maximum number of processes in the instance. |
|
Comma-separated kernel modules to load. |
|
Whether to use incremental memory transfer. Choices:
|
|
Target percentage of dirty memory for completion. |
|
Maximum number of memory transfer iterations. |
|
Allow stateful stop/start and snapshots. Choices:
|
|
NVIDIA driver capabilities to expose. |
|
Required CUDA version. |
|
Required NVIDIA driver version. |
|
Pass NVIDIA runtime libraries into the container. Choices:
|
|
Working directory for the OCI container. |
|
Entrypoint for the OCI container. |
|
GID to run the OCI container as. |
|
UID to run the OCI container as. |
|
Raw AppArmor profile entries. |
|
Raw ID map configuration. |
|
Raw LXC configuration to append. |
|
Raw QEMU command-line arguments. |
|
Raw QEMU configuration overrides. |
|
Raw QMP commands before instance start. |
|
Raw QMP commands after instance start. |
|
Raw QMP commands just before instance start. |
|
Raw QEMU scriptlet. |
|
Raw Seccomp configuration. |
|
Whether the incus-agent exposes metrics. Choices:
|
|
Delegated BPF attach types. |
|
Delegated BPF commands. |
|
Delegated BPF map types. |
|
Delegated BPF program types. |
|
Path to the BPFFS mount in the instance. |
|
Whether to enable Compatibility Support Module. Choices:
|
|
Whether to enable the guest API. Choices:
|
|
Whether to allow image access via the guest API. Choices:
|
|
Base host UID/GID for the ID map. |
|
Whether to use a unique ID map for the instance. Choices:
|
|
Size of the ID map range. |
|
Whether to enable IOMMU for the instance. Choices:
|
|
Allow running Incus inside the instance. Choices:
|
|
Whether to run the instance in privileged mode. Choices:
|
|
Whether to prevent deletion of the instance. Choices:
|
|
Whether to prevent UID/GID shifting. Choices:
|
|
Whether to enable UEFI Secure Boot. Choices:
|
|
Whether to enable AMD SEV encryption. Choices:
|
|
Whether to enable SEV-ES for the instance. Choices:
|
|
SEV session data blob. |
|
SEV Diffie-Hellman key. |
|
Allowed syscalls whitelist. |
|
Denied syscalls blacklist. |
|
Whether to block compat syscalls on amd64. Choices:
|
|
Whether to enable default syscall deny list. Choices:
|
|
Whether to intercept bpf syscalls. Choices:
|
|
Whether to allow device-type BPF programs. Choices:
|
|
Whether to intercept mknod syscalls. Choices:
|
|
Whether to intercept mount syscalls. Choices:
|
|
Filesystems allowed for intercepted mounts. |
|
FUSE mounts to redirect intercepted mounts to. |
|
Whether to use ID-mapped mounts for intercepted mounts. Choices:
|
|
Whether to intercept sched_setscheduler syscalls. Choices:
|
|
Whether to intercept setxattr syscalls. Choices:
|
|
Whether to intercept sysinfo syscalls. Choices:
|
|
Automatic expiry time for snapshots. |
|
Expiry time for manually created snapshots. |
|
Pongo2 template for snapshot names. |
|
Cron expression for automatic snapshots. |
|
Whether to snapshot stopped instances. Choices:
|
|
Devices to attach to the instance. |
|
MAC address for the NIC. |
|
IPv4 address for the NIC. |
|
IPv4 routes to add for the NIC. |
|
IPv6 address for the NIC. |
|
IPv6 routes to add for the NIC. |
|
MTU of the NIC. |
|
Name of the device. |
|
Managed network to attach the NIC to. |
|
NIC type. |
|
Parent network device on the host. |
|
Mount path inside the instance. |
|
Storage pool for the disk device. |
|
Whether the disk is read-only. Choices:
|
|
Size of the disk device. |
|
Source path or volume for the disk device. |
|
Device type. Choices:
|
|
Whether the instance is ephemeral. Choices:
|
|
Name of the instance. |
|
List of profiles to apply to the instance. |
|
Incus project to scope the instance to. |
|
Image source for the instance. |
|
Desired state of the instance. Choices:
|
|
Instance type. Choices:
|
|
Path to the TLS client certificate. |
|
Path to the TLS client key. |
|
Whether instances are ephemeral. Choices:
|
|
List of profiles to apply to instances. |
|
Incus project to scope instances to. |
|
Path to the TLS server certificate. |
|
Path to the Incus Unix socket. |
|
Desired state of the instances. Choices:
|
|
Authentication token for the Incus API. |
|
Instance type. Choices:
|
|
URL of the Incus server API. |
|
Whether to validate TLS certificates. Choices:
|
Examples
- name: Ensure incus instances
hosts: incus
tasks:
- name: Ensure incus instances
ansible.builtin.import_role:
name: damex.incus.incus_instances
vars:
incus_instances:
- name: web-01
source: images:debian/13
profiles:
- default
config:
limits.cpu: "2"
limits.memory: 2GB
- name: db-01
source: images:ubuntu/24.04
type: virtual-machine
config:
limits.cpu: "4"
limits.memory: 4GB
devices:
data:
type: disk
source: data
path: /var/lib/postgresql
- name: Ensure incus instances with cloud-init
hosts: incus
tasks:
- name: Ensure incus instances with cloud-init
ansible.builtin.import_role:
name: damex.incus.incus_instances
vars:
incus_instances:
- name: app-01
source: images:debian/13
config:
cloud-init.user-data:
users:
- name: deploy
groups: sudo
shell: /bin/bash
ssh_authorized_keys:
- ssh-ed25519 AAAA... [email protected]
packages:
- nginx
- postgresql-client