community.general.one_image_info module – Gather information on OpenNebula images

Note

This module is part of the community.general collection (version 10.1.0).

You might already have this collection installed if you are using the ansible package. 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. You need further requirements to be able to use this module, see Requirements for details.

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

Synopsis

  • Gather information on OpenNebula images.

Requirements

The below requirements are needed on the host that executes this module.

  • pyone

Parameters

Parameter

Comments

api_password

aliases: api_token

string

The password or token for XMLRPC authentication.

If not specified then the value of the ONE_PASSWORD environment variable, if any, is used.

api_url

aliases: api_endpoint

string

The ENDPOINT URL of the XMLRPC server.

If not specified then the value of the ONE_URL environment variable, if any, is used.

api_username

string

The name of the user for XMLRPC authentication.

If not specified then the value of the ONE_USERNAME environment variable, if any, is used.

ids

aliases: id

list / elements=string

A list of images ids whose facts you want to gather.

Module can use integers too.

name

string

A name of the image whose facts will be gathered.

If the name begins with ~ the name will be used as regex pattern

which restricts the list of images (whose facts will be returned) whose names match specified regex.

Also, if the name begins with ~* case-insensitive matching will be performed.

See examples for more details.

validate_certs

boolean

Whether to validate the TLS/SSL certificates or not.

This parameter is ignored if PYTHONHTTPSVERIFY environment variable is used.

Choices:

  • false

  • true ← (default)

wait_timeout

integer

Time to wait for the desired state to be reached before timeout, in seconds.

Default: 300

Attributes

Attribute

Support

Description

check_mode

Support: full

This action does not modify state.

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

diff_mode

Support: N/A

This action does not modify state.

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

Examples

- name: Gather facts about all images
  community.general.one_image_info:
  register: result

- name: Print all images facts
  ansible.builtin.debug:
    msg: result

- name: Gather facts about an image using ID
  community.general.one_image_info:
    ids: 123

- name: Gather facts about an image using list of ID
  community.general.one_image_info:
    ids:
      - 123
      - 456
      - 789
      - 0

- name: Gather facts about an image using the name
  community.general.one_image_info:
    name: 'foo-image'
  register: foo_image

- name: Gather facts about all IMAGEs whose name matches regex 'app-image-.*'
  community.general.one_image_info:
    name: '~app-image-.*'
  register: app_images

- name: Gather facts about all IMAGEs whose name matches regex 'foo-image-.*' ignoring cases
  community.general.one_image_info:
    name: '~*foo-image-.*'
  register: foo_images

Return Values

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

Key

Description

images

complex

A list of images info

Returned: success

app_clones

list / elements=integer

added in community.general 9.5.0

The image’s list of app_clones ID’s.

Returned: success

Sample: [1, 2, 3]

clones

list / elements=integer

added in community.general 9.5.0

The image’s list of clones ID’s.

Returned: success

Sample: [1, 2, 3]

cloning_id

integer

added in community.general 9.5.0

The image’s cloning ID.

Returned: success

Sample: -1

cloning_ops

integer

added in community.general 9.5.0

The image’s cloning operations per second.

Returned: success

Sample: 0

datastore

integer

added in community.general 9.5.0

The image’s datastore name.

Returned: success

Sample: "image_datastore"

datastore_id

integer

added in community.general 9.5.0

The image’s datastore ID.

Returned: success

Sample: 100

disk_type

integer

added in community.general 9.5.0

The image’s format type.

Returned: success

Sample: 0

fstype

string

added in community.general 9.5.0

The image’s filesystem type.

Returned: success

Sample: "ext4"

group_id

integer

The image’s group id

Returned: success

Sample: 1

group_name

string

The image’s group name.

Returned: success

Sample: "one-users"

id

integer

The image’s id.

Returned: success

Sample: 153

name

string

The image’s name.

Returned: success

Sample: "app1"

owner_id

integer

The image’s owner id.

Returned: success

Sample: 143

owner_name

string

The image’s owner name.

Returned: success

Sample: "ansible-test"

path

string

added in community.general 9.5.0

The image’s filesystem path.

Returned: success

Sample: "/var/tmp/hello.qcow2"

permissions

dictionary

added in community.general 9.5.0

The image’s permissions.

Returned: success

Sample: {"group_a": 0, "group_m": 0, "group_u": 0, "other_a": 0, "other_m": 0, "other_u": 0, "owner_a": 0, "owner_m": 0, "owner_u": 1}

group_a

string

The image’s group ADMIN permissions.

Returned: success

Sample: "0"

group_m

string

The image’s group MANAGE permissions.

Returned: success

Sample: "0"

group_u

string

The image’s group USAGE permissions.

Returned: success

Sample: "0"

other_a

string

The image’s other users ADMIN permissions

Returned: success

Sample: "0"

other_m

string

The image’s other users MANAGE permissions.

Returned: success

Sample: "0"

other_u

string

The image’s other users USAGE permissions.

Returned: success

Sample: "0"

owner_a

string

The image’s owner ADMIN permissions.

Returned: success

Sample: "0"

owner_m

string

The image’s owner MANAGE permissions.

Returned: success

Sample: "0"

owner_u

string

The image’s owner USAGE permissions.

Returned: success

Sample: "1"

persistent

integer

added in community.general 9.5.0

The image’s persistence status (1 means true, 0 means false).

Returned: success

Sample: 1

running_vms

integer

The image’s count of running vms that use this image.

Returned: success

Sample: 7

size

integer

added in community.general 9.5.0

The image’s size in MegaBytes.

Returned: success

Sample: 10000

snapshots

list / elements=string

added in community.general 9.5.0

The image’s list of snapshots.

Returned: success

Sample: [{"active": 1, "allow_orphans": 1, "children": 0, "date": 123123, "name": "SampleName", "parent": 1, "size": 10228}]

source

string

added in community.general 9.5.0

The image’s source.

Returned: success

Sample: "/var/lib/one//datastores/100/somerandomstringxd"

state

string

The image’s state.

Returned: success

Sample: "READY"

target_snapshot

integer

added in community.general 9.5.0

The image’s target snapshot.

Returned: success

Sample: 1

type

integer

added in community.general 9.5.0

The image’s type.

Returned: success

Sample: 0

used

boolean

The image’s usage status.

Returned: success

Sample: true

vms

list / elements=integer

added in community.general 9.5.0

The image’s list of vm ID’s.

Returned: success

Sample: [1, 2, 3]

Authors

  • Milan Ilic (@ilicmilan)

  • Jan Meerkamp (@meerkampdvv)