one_image_facts - Gather facts about OpenNebula images

New in version 2.6.

Synopsis

Requirements

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

  • python-oca

Parameters

Parameter Choices/Defaults Comments
api_password
Password of the user to login into OpenNebula RPC server. If not set
then the value of the ONE_PASSWORD environment variable is used.
api_url
URL of the OpenNebula RPC server.
It is recommended to use HTTPS so that the username/password are not
transferred over the network unencrypted.
If not set then the value of the ONE_URL environment variable is used.
api_username
Name of the user to login into the OpenNebula RPC server. If not set
then the value of the ONE_USERNAME environment variable is used.
ids
A list of images ids whose facts you want to gather.

aliases: id
name
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.

Examples

# Gather facts about all images
- one_image_facts:
  register: result

# Print all images facts
- debug:
    msg: result

# Gather facts about an image using ID
- one_image_facts:
    ids:
      - 123

# Gather facts about an image using the name
- one_image_facts:
    name: 'foo-image'
  register: foo_image

# Gather facts about all IMAGEs whose name matches regex 'app-image-.*'
- one_image_facts:
    name: '~app-image-.*'
  register: app_images

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

Return Values

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

Key Returned Description
images
complex
success
A list of images info

  owner_name
string
image's owner name

Sample:
ansible-test
  name
string
image name

Sample:
app1
  group_name
string
image's group name

Sample:
one-users
  state
string
state of image instance

Sample:
READY
  used
bool
is image in use

Sample:
True
  running_vms
int
count of running vms that use this image

Sample:
7
  group_id
int
image's group id

Sample:
1
  id
int
image id

Sample:
153
  owner_id
int
image's owner id

Sample:
143


Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Maintenance

This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.

For a list of other modules that are also maintained by the Ansible Community, see here.

Author

  • Milan Ilic (@ilicmilan)

Hint

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