damex.incus.incus_storage_volume module – Ensure Incus storage volume
Note
This module is part of the damex.incus collection (version 1.8.9).
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_storage_volume.
Synopsis
Create, update, and delete Incus custom storage volumes via the Incus REST API.
Storage volumes are project-scoped resources within a storage pool.
The content type is set on creation and cannot be changed afterwards.
Parameters
Parameter |
Comments |
|---|---|
Path to the client certificate for remote authentication. Requires |
|
Path to the client key for remote authentication. Requires |
|
Storage volume configuration key-value pairs. Boolean values are converted to lowercase strings. Default: |
|
Filesystem type for block volumes. |
|
Mount options for block volumes. |
|
Size of the storage volume. |
|
Automatic expiry time for snapshots. |
|
Pongo2 template for snapshot names. |
|
Cron expression for automatic snapshots. |
|
Whether to use a ZFS volume as a block device. Choices:
|
|
Block size for the ZFS volume. |
|
Whether to delegate ZFS dataset to the instance. Choices:
|
|
Whether to remove snapshots on volume removal. Choices:
|
|
Content type of the storage volume. Only used when creating a new volume. Ignored on update — content type cannot be changed after creation. Choices:
|
|
Storage volume description. Default: |
|
Name of the storage volume. |
|
Name of the storage pool containing the volume. |
|
Incus project to query. Default: |
|
Path to the server certificate for remote verification. Requires |
|
Path to the Incus Unix socket for local connections. Default: |
|
Desired state of the storage volume. Choices:
|
|
Cluster member to create the storage volume on. |
|
Token for remote authentication. Requires |
|
URL of the remote Incus server (e.g. https://host:8443). If specified, connects via HTTPS instead of Unix socket. |
|
Whether to validate the server TLS certificate. Choices:
|
|
Whether to wait for async operations to complete before returning. Set to Choices:
|
Examples
- name: Ensure filesystem storage volume
damex.incus.incus_storage_volume:
pool: default
name: data
- name: Ensure block storage volume with size
damex.incus.incus_storage_volume:
pool: zfs
name: disk1
content_type: block
config:
size: 50GiB
- name: Ensure storage volume with snapshots
damex.incus.incus_storage_volume:
pool: default
name: backups
config:
snapshots.schedule: "@daily"
snapshots.expiry: 7d
- name: Ensure storage volume in project
damex.incus.incus_storage_volume:
pool: default
name: data
project: myproject
- name: Ensure storage volume on cluster member
damex.incus.incus_storage_volume:
pool: local
name: data
target: node1
- name: Ensure storage volume is absent
damex.incus.incus_storage_volume:
pool: default
name: data
state: absent