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

Note

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

Entry point main – Ensure Incus storage volumes.

Synopsis

  • Ensure Incus storage volumes.

Parameters

Parameter

Comments

incus_storage_volumes

list / elements=dictionary

List of 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

Size of the storage volume.

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

Whether to use a ZFS volume as a block device.

Choices:

  • false

  • true

zfs.blocksize

string

Block size for the ZFS volume.

zfs.delegate

boolean

Whether to delegate ZFS dataset to the instance.

Choices:

  • false

  • true

zfs.remove_snapshots

boolean

Whether to remove snapshots on volume removal.

Choices:

  • false

  • true

content_type

string

Content type of the storage volume.

Choices:

  • "filesystem"

  • "block"

description

string

Storage volume description.

name

string / required

Name of the storage volume.

pool

string / required

Name of the storage pool containing the volume.

project

string

Project to scope the storage volume to.

state

string

Desired state of the storage volume.

Choices:

  • "present"

  • "absent"

targets

list / elements=dictionary

List of cluster members to create the storage volume on.

config

dictionary

Per-member storage volume configuration options.

size

string

Size of the storage volume.

name

string / required

Name of the cluster member.

incus_storage_volumes_client_cert

path

Path to the TLS client certificate.

incus_storage_volumes_client_key

path

Path to the TLS client key.

incus_storage_volumes_project

string

Incus project to scope storage volumes to.

incus_storage_volumes_server_cert

path

Path to the TLS server certificate.

incus_storage_volumes_socket_path

path

Path to the Incus Unix socket.

incus_storage_volumes_state

string

Desired state of the storage volumes.

Choices:

  • "present"

  • "absent"

incus_storage_volumes_token

string

Authentication token for the Incus API.

incus_storage_volumes_url

string

URL of the Incus server API.

incus_storage_volumes_validate_certs

boolean

Whether to validate TLS certificates.

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