community.general.imgadm (8.5.0) — module

Manage SmartOS images

Authors: Jasper Lievisse Adriaanse (@jasperla)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Manage SmartOS virtual machine images through imgadm(1M)

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Import an image
  community.general.imgadm:
    uuid: '70e3ae72-96b6-11e6-9056-9737fd4d0764'
    state: imported
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete an image
  community.general.imgadm:
    uuid: '70e3ae72-96b6-11e6-9056-9737fd4d0764'
    state: deleted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Update all images
  community.general.imgadm:
    uuid: '*'
    state: updated
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Update a single image
  community.general.imgadm:
    uuid: '70e3ae72-96b6-11e6-9056-9737fd4d0764'
    state: updated
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add a source
  community.general.imgadm:
    source: 'https://datasets.project-fifo.net'
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add a Docker source
  community.general.imgadm:
    source: 'https://docker.io'
    type: docker
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove a source
  community.general.imgadm:
    source: 'https://docker.io'
    state: absent

Inputs

    
pool:
    default: zones
    description:
    - zpool to import to or delete images from.
    required: false
    type: str

type:
    choices:
    - imgapi
    - docker
    - dsapi
    default: imgapi
    description:
    - Type for image sources.
    required: false
    type: str

uuid:
    description:
    - Image UUID. Can either be a full UUID or V(*) for all images.
    required: false
    type: str

force:
    description:
    - Force a given operation (where supported by imgadm(1M)).
    required: false
    type: bool

state:
    choices:
    - present
    - absent
    - deleted
    - imported
    - updated
    - vacuumed
    description:
    - State the object operated on should be in. V(imported) is an alias for for V(present)
      and V(deleted) for V(absent). When set to V(vacuumed) and O(uuid=*), it will remove
      all unused images.
    required: true
    type: str

source:
    description:
    - URI for the image source.
    required: false
    type: str

Outputs

source:
  description: Source that is managed.
  returned: When not managing an image.
  sample: https://datasets.project-fifo.net
  type: str
state:
  description: State of the target, after execution.
  returned: success
  sample: present
  type: str
uuid:
  description: UUID for an image operated on.
  returned: When not managing an image source.
  sample: 70e3ae72-96b6-11e6-9056-9737fd4d0764
  type: str