community.general.imgadm module – Manage SmartOS images

Note

This module is part of the community.general collection (version 9.4.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 community.general.

To use it in a playbook, specify: community.general.imgadm.

Synopsis

  • Manage SmartOS virtual machine images through imgadm(1M)

Parameters

Parameter

Comments

force

boolean

Force a given operation (where supported by imgadm(1M)).

Choices:

  • false

  • true

pool

string

zpool to import to or delete images from.

Default: "zones"

source

string

URI for the image source.

state

string / required

State the object operated on should be in. imported is an alias for for present and deleted for absent. When set to vacuumed and uuid=*, it will remove all unused images.

Choices:

  • "present"

  • "absent"

  • "deleted"

  • "imported"

  • "updated"

  • "vacuumed"

type

string

Type for image sources.

Choices:

  • "imgapi" ← (default)

  • "docker"

  • "dsapi"

uuid

string

Image UUID. Can either be a full UUID or * for all images.

Attributes

Attribute

Support

Description

check_mode

Support: none

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Examples

- name: Import an image
  community.general.imgadm:
    uuid: '70e3ae72-96b6-11e6-9056-9737fd4d0764'
    state: imported

- name: Delete an image
  community.general.imgadm:
    uuid: '70e3ae72-96b6-11e6-9056-9737fd4d0764'
    state: deleted

- name: Update all images
  community.general.imgadm:
    uuid: '*'
    state: updated

- name: Update a single image
  community.general.imgadm:
    uuid: '70e3ae72-96b6-11e6-9056-9737fd4d0764'
    state: updated

- name: Add a source
  community.general.imgadm:
    source: 'https://datasets.project-fifo.net'
    state: present

- name: Add a Docker source
  community.general.imgadm:
    source: 'https://docker.io'
    type: docker
    state: present

- name: Remove a source
  community.general.imgadm:
    source: 'https://docker.io'
    state: absent

Return Values

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

Key

Description

source

string

Source that is managed.

Returned: When not managing an image.

Sample: "https://datasets.project-fifo.net"

state

string

State of the target, after execution.

Returned: success

Sample: "present"

uuid

string

UUID for an image operated on.

Returned: When not managing an image source.

Sample: "70e3ae72-96b6-11e6-9056-9737fd4d0764"

Authors

  • Jasper Lievisse Adriaanse (@jasperla)