damex.incus.incus_image module – Ensure Incus image
Note
This module 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_image.
Synopsis
Copy, update, and delete Incus images via the Incus REST API.
Images are project-scoped resources identified by alias.
Copying from remote servers uses the
remote:aliasformat (e.g.images:debian/13).Supports OCI registries such as Docker Hub using the
docker:imageformat.
Parameters
Parameter |
Comments |
|---|---|
Alias for the image on the local server. Used to check existence and as the alias assigned on copy. |
|
Automatically update the image when a new build is available on the source server. Choices:
|
|
Client certificate content for remote authentication. Requires |
|
Client certificate path for remote authentication. Requires |
|
Client key content for remote authentication. Requires |
|
Client key path for remote authentication. Requires |
|
Copy all aliases from the source image. Choices:
|
|
Incus project to query. Default: |
|
Make the image available to unauthenticated users. Choices:
|
|
Server certificate content for remote verification. Requires |
|
Server certificate path for remote verification. Requires |
|
Incus Unix socket path for local connections. Default: |
|
Image reference to copy from, e.g.
|
|
URL of the image server to pull from, e.g. Takes precedence over auto-resolved remotes when |
|
Desired state of the image. Choices:
|
|
Token for remote authentication. Requires |
|
Image type to request from the remote server. Choices:
|
|
Remote Incus server URL (e.g. https://host:8443). If specified, connects via HTTPS instead of Unix socket. |
|
Server TLS certificate validation. Choices:
|
|
Async operation completion wait. Set to Choices:
|
Examples
- name: Ensure Debian 13 container image
damex.incus.incus_image:
alias: debian/13
source: images:debian/13
- name: Ensure Ubuntu 24.04 VM image
damex.incus.incus_image:
alias: ubuntu/24.04
source: images:ubuntu/24.04
type: virtual-machine
- name: Ensure image with auto-update
damex.incus.incus_image:
alias: debian/13
source: images:debian/13
auto_update: true
- name: Ensure image is public
damex.incus.incus_image:
alias: debian/13
source: images:debian/13
public: true
- name: Ensure nginx OCI image from Docker Hub
damex.incus.incus_image:
alias: nginx
source: docker:library/nginx
- name: Ensure image from custom OCI registry
damex.incus.incus_image:
alias: myapp
source: myapp/backend
source_server: https://ghcr.io
source_protocol: oci
- name: Ensure image is absent
damex.incus.incus_image:
alias: debian/13
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Resource state change indicator. Returned: always |
|
Configuration keys that changed. Returned: always |
|
Before and after state for diff mode. Returned: changed |
|
State after the change. Returned: success |
|
State before the change. Returned: success |