W3cubDocs

/Ansible

community.general.one_image_info – Gather information on OpenNebula images

Note

This plugin is part of the community.general collection (version 3.8.1).

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.

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

Synopsis

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

Requirements

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

  • pyone

Parameters

Parameter Choices/Defaults Comments
api_password
string
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
string
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
string
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
list / elements=string
A list of images ids whose facts you want to gather.

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

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 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 Returned Description
images
complex
success
A list of images info

group_id
integer
success
image's group id

Sample:
1
group_name
string
success
image's group name

Sample:
one-users
id
integer
success
image id

Sample:
153
name
string
success
image name

Sample:
app1
owner_id
integer
success
image's owner id

Sample:
143
owner_name
string
success
image's owner name

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

Sample:
7
state
string
success
state of image instance

Sample:
READY
used
boolean
success
is image in use

Sample:
True


Authors

  • Milan Ilic (@ilicmilan)
  • Jan Meerkamp (@meerkampdvv)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/general/one_image_info_module.html