damex.incus.incus_instance_info module – Ensure Incus instance information is gathered

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

Synopsis

  • Gather information about Incus instances via the Incus REST API.

  • Returns information about all instances or a specific instance.

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.

name

string

Name of the instance to query.

If not specified, all instances in the project are returned.

project

string

Incus project to query.

Default: "default"

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"

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)

Examples

- name: Get all instances
  damex.incus.incus_instance_info:
    project: default
  register: result

- name: Get specific instance
  damex.incus.incus_instance_info:
    name: myinstance
    project: default
  register: result

- name: Get instances from remote server
  damex.incus.incus_instance_info:
    url: https://incus.example.com:8443
    client_cert: /etc/incus/client.crt
    client_key: /etc/incus/client.key
  register: result

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

instances

list / elements=dictionary

List of instance information.

Returned: always

config

dictionary

Instance configuration.

Returned: success

devices

dictionary

Instance devices.

Returned: success

name

string

Name of the instance.

Returned: success

profiles

list / elements=string

Profiles applied to the instance.

Returned: success

project

string

Project the instance belongs to.

Returned: success

status

string

Status of the instance.

Returned: success

type

string

Type of the instance (container or virtual-machine).

Returned: success

Authors

  • Roman Kuzmitskii (@damex)