damex.incus.incus_storage module – Ensure Incus storage

Note

This module 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_storage.

Synopsis

  • Create, update, and delete Incus storage pools via the Incus REST API.

  • Storage pools are global resources, not project-scoped.

  • The storage driver is set on creation and cannot be changed afterwards.

Parameters

Parameter

Comments

client_cert

path

Path to the client certificate for remote authentication.

Requires url and client_key. Mutually exclusive with token.

client_key

path

Path to the client key for remote authentication.

Requires url and client_cert.

config

dictionary

Storage pool configuration key-value pairs.

Boolean values are converted to lowercase strings.

Default: {}

btrfs.mount_options

string

Mount options for the Btrfs filesystem.

ceph.cluster_name

string

Name of the Ceph cluster.

ceph.osd.data_pool_name

string

Name of the Ceph OSD data pool.

ceph.osd.pg_name

string

Name of the Ceph OSD placement group.

ceph.osd.pool_name

string

Name of the Ceph OSD pool.

ceph.rbd.clone_copy

boolean

Whether to use RBD lightweight clones.

Choices:

  • false

  • true

ceph.rbd.du

boolean

Whether to use RBD disk usage tracking.

Choices:

  • false

  • true

ceph.rbd.features

string

RBD image features to enable.

ceph.user.name

string

Ceph user name.

cephfs.cluster_name

string

Name of the CephFS cluster.

cephfs.create_missing

boolean

Create missing CephFS pools.

Choices:

  • false

  • true

cephfs.data_pool

string

Name of the CephFS data pool.

cephfs.fscache

boolean

Whether to enable fscache for CephFS.

Choices:

  • false

  • true

cephfs.meta_pool

string

Name of the CephFS metadata pool.

cephfs.osd_pg_num

string

Number of placement groups for CephFS OSD pools.

cephfs.path

string

CephFS path to mount.

cephfs.user.name

string

CephFS user name.

cephobject.bucket_name_prefix

string

Prefix for Ceph object store bucket names.

cephobject.cluster_name

string

Name of the Ceph object store cluster.

cephobject.radosgw.endpoint

string

URL of the RADOS Gateway endpoint.

cephobject.radosgw.endpoint_cert_file

string

Path to the RADOS Gateway endpoint certificate.

cephobject.user.name

string

Ceph object store user name.

drbd.auto_add_quorum_tiebreaker

boolean

Whether to automatically add a DRBD quorum tiebreaker.

Choices:

  • false

  • true

drbd.auto_diskful

string

Automatic diskful mode for DRBD.

drbd.on_no_quorum

string

Action to take when DRBD has no quorum.

linstor.resource_group.name

string

Name of the LINSTOR resource group.

linstor.resource_group.place_count

integer

Number of replicas in the LINSTOR resource group.

linstor.resource_group.storage_pool

string

LINSTOR storage pool for the resource group.

linstor.volume.prefix

string

Prefix for LINSTOR volume names.

lvm.metadata_size

string

Size of the LVM metadata volume.

lvm.thinpool_metadata_size

string

Size of the LVM thin pool metadata volume.

lvm.thinpool_name

string

Name of the LVM thin pool.

lvm.use_thinpool

boolean

Whether to use an LVM thin pool.

Choices:

  • false

  • true

lvm.vg.force_reuse

boolean

Force reuse of an existing LVM volume group.

Choices:

  • false

  • true

lvm.vg_name

string

Name of the LVM volume group.

rsync.bwlimit

string

Upper limit on the bandwidth for rsync.

rsync.compression

boolean

Whether to use compression for rsync.

Choices:

  • false

  • true

size

string

Size of the storage pool.

source

string

Path or device to use as storage source.

source.wipe

boolean

Wipe the source device before use.

Choices:

  • false

  • true

truenas.allow_insecure

boolean

Allow insecure connections to TrueNAS.

Choices:

  • false

  • true

truenas.api_key

string

API key for TrueNAS authentication.

truenas.clone_copy

boolean

Whether to use TrueNAS lightweight clones.

Choices:

  • false

  • true

truenas.config

string

Path to the TrueNAS configuration file.

truenas.dataset

string

Name of the TrueNAS dataset.

truenas.force_reuse

boolean

Force reuse of an existing TrueNAS dataset.

Choices:

  • false

  • true

truenas.host

string

Hostname or IP of the TrueNAS server.

truenas.initiator

string

iSCSI initiator name for TrueNAS.

truenas.portal

string

iSCSI portal ID for TrueNAS.

zfs.blocksize

string

Block size for the ZFS pool.

zfs.clone_copy

boolean

Whether to use ZFS lightweight clones.

Choices:

  • false

  • true

zfs.export

boolean

Whether to export the ZFS pool on removal.

Choices:

  • false

  • true

zfs.pool_name

string

Name of the ZFS pool.

description

string

Storage pool description.

Default: ""

driver

string

Storage driver.

Required when creating a new storage pool.

Ignored on update — driver cannot be changed after creation.

Choices:

  • "dir"

  • "btrfs"

  • "lvm"

  • "zfs"

  • "ceph"

  • "cephfs"

  • "cephobject"

  • "linstor"

  • "truenas"

name

string / required

Name of the storage pool.

server_cert

path

Path to the server certificate for remote verification.

Requires url.

socket_path

string

Path to the Incus Unix socket for local connections.

Default: "/var/lib/incus/unix.socket"

state

string

Desired state of the storage pool.

Choices:

  • "present" ← (default)

  • "absent"

token

string

Token for remote authentication.

Requires url. Mutually exclusive with client_cert.

url

string

URL of the remote Incus server (e.g. https://host:8443).

If specified, connects via HTTPS instead of Unix socket.

validate_certs

boolean

Whether to validate the server TLS certificate.

Choices:

  • false

  • true ← (default)

wait

boolean

Whether to wait for async operations to complete before returning.

Set to false for fire-and-forget behaviour.

Choices:

  • false

  • true ← (default)

Examples

- name: Create dir storage pool
  damex.incus.incus_storage:
    name: default
    driver: dir

- name: Create ZFS storage pool
  damex.incus.incus_storage:
    name: tank
    driver: zfs
    config:
      zfs.pool_name: tank

- name: Remove storage pool
  damex.incus.incus_storage:
    name: default
    state: absent

Authors

  • Roman Kuzmitskii (@damex)