smartos_image_info – Get SmartOS image details — Ansible Documentation

- AnsibleFest
- Products
- Community
- Webinars & Training
- Blog

Documentation

# smartos_image_info – Get SmartOS image details

- Synopsis
- Parameters
- Examples
- Status

## Synopsis

- Retrieve information about all installed images on SmartOS.
- This module was called `smartos_image_facts` before Ansible 2.9, returning `ansible_facts`. Note that the smartos_image_info module no longer returns `ansible_facts`!

Aliases: smartos_image_facts

## Parameters

Parameter | Choices/Defaults | Comments
--- | --- | ---
filters - |  | Criteria for selecting image. Can be any value from image manifest and 'published_date', 'published', 'source', 'clones', and 'size'. More information can be found at https://smartos.org/man/1m/imgadm under 'imgadm list'.

## Examples

    # Return information about all installed images.
    - smartos_image_info:
      register: result

    # Return all private active Linux images.
    - smartos_image_info: filters="os=linux state=active public=false"
      register: result

    # Show, how many clones does every image have.
    - smartos_image_info:
      register: result

    - debug: msg="{{ result.smartos_images[item]['name'] }}-{{ result.smartos_images[item]['version'] }}
                has {{ result.smartos_images[item]['clones'] }} VM(s)"
      with_items: "{{ result.smartos_images.keys() | list }}"

    # When the module is called as smartos_image_facts, return values are published
    # in ansible_facts['smartos_images'] and can be used as follows.
    # Note that this is deprecated and will stop working in Ansible 2.13.
    - debug: msg="{{ smartos_images[item]['name'] }}-{{ smartos_images[item]['version'] }}
                has {{ smartos_images[item]['clones'] }} VM(s)"
      with_items: "{{ smartos_images.keys() | list }}"

## Status

- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]

### Authors

- Adam Števko (@xen0l)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.