damex.incus.incus_storage_volumes role – Ensure Incus storage volumes.

Note

This role is part of the damex.incus collection (version 1.11.7).

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_volumes.

Entry point main – Ensure Incus storage volumes.

Synopsis

  • Ensure Incus storage volumes.

Parameters

Parameter

Comments

incus_storage_volumes

list / elements=dictionary

Storage volumes to ensure.

config

dictionary

Storage volume configuration options.

block.filesystem

string

Filesystem type for block volumes.

block.mount_options

string

Mount options for block volumes.

size

string

Storage volume size.

snapshots.expiry

string

Automatic expiry time for snapshots.

snapshots.pattern

string

Pongo2 template for snapshot names.

snapshots.schedule

string

Cron expression for automatic snapshots.

zfs.block_mode

boolean

ZFS volume block device mode.

Choices:

  • false

  • true

zfs.blocksize

string

ZFS volume block size.

zfs.delegate

boolean

ZFS dataset delegation to instance.

Choices:

  • false

  • true

zfs.remove_snapshots

boolean

Snapshot removal on volume removal.

Choices:

  • false

  • true

content_type

string

Storage volume content type.

Choices:

  • "filesystem"

  • "block"

description

string

Storage volume description.

name

string / required

Storage volume name.

pool

string / required

Storage pool name.

project

string

Incus project scope.

state

string

Storage volume desired state.

Choices:

  • "present"

  • "absent"

targets

list / elements=dictionary

Cluster member targets for storage volume creation.

config

dictionary

Per-member storage volume configuration options.

size

string

Storage volume size.

name

string / required

Cluster member name.

incus_storage_volumes_client_cert

string

Client certificate content for API authentication.

incus_storage_volumes_client_cert_path

path

TLS client certificate path for API authentication.

incus_storage_volumes_client_key

string

Client key content for API authentication.

incus_storage_volumes_client_key_path

path

TLS client key path for API authentication.

incus_storage_volumes_project

string

Incus project scope.

incus_storage_volumes_server_cert

string

Server certificate content for API verification.

incus_storage_volumes_server_cert_path

path

TLS server certificate path for API verification.

incus_storage_volumes_socket_path

path

Incus Unix socket path.

incus_storage_volumes_state

string

Storage volumes desired state.

Choices:

  • "present"

  • "absent"

incus_storage_volumes_token

string

Incus API authentication token.

incus_storage_volumes_url

string

Incus server API URL.

incus_storage_volumes_validate_certs

boolean

TLS certificate validation.

Choices:

  • false

  • true

Examples

- name: Ensure incus storage volumes
  hosts: incus
  tasks:
    - name: Ensure incus storage volumes
      ansible.builtin.import_role:
        name: damex.incus.incus_storage_volumes
      vars:
        incus_storage_volumes:
          - name: data
            pool: default
          - name: media
            pool: zfs
            content_type: block
            config:
              size: "50GiB"
          - name: backups
            pool: default
            config:
              snapshots.schedule: "@daily"
              snapshots.expiry: "7d"
          - name: plexmediaserver
            pool: local
            targets:
              - name: node1.example.com
                config:
                  size: "100GiB"
              - name: node2.example.com