one_image_info – Gather information on OpenNebula images

New in version 2.6.

Synopsis

  • Gather information on OpenNebula images.
  • This module was called one_image_facts before Ansible 2.9. The usage did not change.

Aliases: one_image_facts

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_info:
  register: result

# Print all images facts
- debug:
    msg: result

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

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

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

# Gather facts about all IMAGEs whose name matches regex 'foo-image-.*' ignoring cases
- 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 Returned Description
images
complex
success
A list of images info

 
group_id
integer
image's group id

Sample:
1
 
group_name
string
image's group name

Sample:
one-users
 
id
integer
image id

Sample:
153
 
name
string
image name

Sample:
app1
 
owner_id
integer
image's owner id

Sample:
143
 
owner_name
string
image's owner name

Sample:
ansible-test
 
running_vms
integer
count of running vms that use this image

Sample:
7
 
state
string
state of image instance

Sample:
READY
 
used
boolean
is image in use

Sample:
True


Status

Authors

  • Milan Ilic (@ilicmilan)

Hint

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