damex.incus.incus_image_imports role – Ensure Incus image imports.

Note

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

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

Entry point main – Ensure Incus image imports.

Synopsis

  • Ensure Incus image imports.

Parameters

Parameter

Comments

incus_image_imports

list / elements=dictionary

List of image imports to ensure.

alias

string / required

Primary alias for the image.

aliases

list / elements=string

Additional aliases to assign to the image.

architecture

string

Image architecture identifier.

checksum

string

Expected checksum of the source file for verification.

checksum_algorithm

string

Hash algorithm used for checksum verification.

Choices:

  • "sha256"

  • "sha512"

  • "sha384"

  • "md5"

force

boolean

Whether to delete and re-import the image even when the alias already exists.

Choices:

  • false

  • true

project

string

Incus project to scope the image to.

properties

dictionary

Image properties included in the metadata.

description

string

Human-readable image description.

name

string

Image name.

os

string

Operating system name.

release

string

Operating system release or version.

serial

string

Image serial or build identifier.

variant

string

Image variant.

public

boolean

Whether to make the image available to unauthenticated users.

Choices:

  • false

  • true

source

string

Path to a local image file or URL to download from.

state

string

Desired state of the image.

Choices:

  • "present"

  • "absent"

timeout

integer

Timeout in seconds for downloading the source file from a URL.

incus_image_imports_architecture

string

Image architecture identifier.

incus_image_imports_checksum_algorithm

string

Hash algorithm used for checksum verification.

Choices:

  • "sha256"

  • "sha512"

  • "sha384"

  • "md5"

incus_image_imports_client_cert

string

Client certificate content for API authentication.

incus_image_imports_client_cert_path

path

Path to the TLS client certificate for API authentication.

incus_image_imports_client_key

string

Client key content for API authentication.

incus_image_imports_client_key_path

path

Path to the TLS client key for API authentication.

incus_image_imports_force

boolean

Whether to delete and re-import images even when the alias already exists.

Choices:

  • false

  • true

incus_image_imports_project

string

Incus project to scope images to.

incus_image_imports_public

boolean

Whether to make images available to unauthenticated users.

Choices:

  • false

  • true

incus_image_imports_server_cert

string

Server certificate content for API verification.

incus_image_imports_server_cert_path

path

Path to the TLS server certificate for API verification.

incus_image_imports_socket_path

path

Path to the Incus Unix socket.

incus_image_imports_state

string

Desired state of the images.

Choices:

  • "present"

  • "absent"

incus_image_imports_timeout

integer

Timeout in seconds for downloading the source file from a URL.

incus_image_imports_token

string

Authentication token for the Incus API.

incus_image_imports_url

string

URL of the Incus server API.

incus_image_imports_validate_certs

boolean

Whether to validate TLS certificates.

Choices:

  • false

  • true

Examples

- name: Ensure incus image imports
  hosts: incus
  tasks:
    - name: Ensure incus image imports
      ansible.builtin.import_role:
        name: damex.incus.incus_image_imports
      vars:
        incus_image_imports:
          - alias: chr/7.22
            source: https://download.mikrotik.com/routeros/7.22/chr-7.22.img.zip
            properties:
              os: RouterOS
              release: "7.22"
              description: MikroTik CHR 7.22
          - alias: custom/1.0
            source: /tmp/custom-image.qcow2
            properties:
              os: CustomOS
              release: "1.0"
              description: Custom OS Image