community.general.one_image module – Manages OpenNebula images
Note
This module is part of the community.general collection (version 10.7.5).
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.
Synopsis
- Manages OpenNebula images. 
Requirements
The below requirements are needed on the host that executes this module.
- pyone 
Parameters
| Parameter | Comments | 
|---|---|
| The password or token for XMLRPC authentication. If not specified then the value of the  | |
| The ENDPOINT URL of the XMLRPC server. If not specified then the value of the  | |
| The name of the user for XMLRPC authentication. If not specified then the value of the  | |
| Whether the image should be created if not present. This is ignored if  Choices: 
 | |
| Use with  | |
| Whether the image should be enabled or disabled. Choices: 
 | |
| A  | |
| A  Required if  | |
| A name that will be assigned to the existing or new image. In the case of cloning, by default  | |
| Whether the image should be persistent or non-persistent. Choices: 
 | |
| 
 
 
 
 Choices: 
 | |
| Use with  | |
| Whether to validate the TLS/SSL certificates or not. This parameter is ignored if  Choices: 
 | |
| Seconds to wait until image is ready, deleted or cloned. Default:  | 
Attributes
| Attribute | Support | Description | 
|---|---|---|
| Support: full | Can run in  | |
| Support: none | Will return details on what has changed (or possibly needs changing in  | 
Examples
- name: Fetch the IMAGE by id
  community.general.one_image:
    id: 45
  register: result
- name: Print the IMAGE properties
  ansible.builtin.debug:
    var: result
- name: Rename existing IMAGE
  community.general.one_image:
    id: 34
    state: renamed
    new_name: bar-image
- name: Disable the IMAGE by id
  community.general.one_image:
    id: 37
    enabled: false
- name: Make the IMAGE persistent
  community.general.one_image:
    id: 37
    persistent: true
- name: Enable the IMAGE by name
  community.general.one_image:
    name: bar-image
    enabled: true
- name: Clone the IMAGE by name
  community.general.one_image:
    name: bar-image
    state: cloned
    new_name: bar-image-clone
  register: result
- name: Delete the IMAGE by id
  community.general.one_image:
    id: '{{ result.id }}'
    state: absent
- name: Make sure IMAGE is present
  community.general.one_image:
    name: myyy-image
    state: present
    create: true
    datastore_id: 100
    template: |
      PATH = "/var/tmp/image"
      TYPE = "OS"
      SIZE = 20512
      FORMAT = "qcow2"
      PERSISTENT = "Yes"
      DEV_PREFIX = "vd"
- name: Make sure IMAGE is present with a longer timeout
  community.general.one_image:
    name: big-image
    state: present
    create: true
    datastore_id: 100
    wait_timeout: 900
    template: |-
      PATH = "https://192.0.2.200/repo/tipa_image.raw"
      TYPE = "OS"
      SIZE = 82048
      FORMAT = "raw"
      PERSISTENT = "Yes"
      DEV_PREFIX = "vd"
Return Values
Common return values are documented here, the following are the fields unique to this module:
| Key | Description | 
|---|---|
| The image’s list of app_clones ID’s. Returned: when  Sample:  | |
| The image’s list of clones ID’s. Returned: when  Sample:  | |
| The image’s cloning operations per second. Returned: when  Sample:  | |
| The image’s datastore name. Returned: when  Sample:  | |
| The image’s filesystem type. Returned: when  Sample:  | |
| Image’s group name. Returned: when  Sample:  | |
| Image’s owner name. Returned: when  Sample:  | |
| The image’s filesystem path. Returned: when  Sample:  | |
| The image’s permissions. Returned: when  Sample:  | |
| The image’s group ADMIN permissions. Returned: success Sample:  | |
| The image’s group MANAGE permissions. Returned: success Sample:  | |
| The image’s group USAGE permissions. Returned: success Sample:  | |
| The image’s other users ADMIN permissions. Returned: success Sample:  | |
| The image’s other users MANAGE permissions. Returned: success Sample:  | |
| The image’s other users USAGE permissions. Returned: success Sample:  | |
| The image’s owner ADMIN permissions. Returned: success Sample:  | |
| The image’s owner MANAGE permissions. Returned: success Sample:  | |
| The image’s owner USAGE permissions. Returned: success Sample:  | |
| The image’s persistence status (1 means true, 0 means false). Returned: when  Sample:  | |
| Count of running vms that use this image. Returned: when  Sample:  | |
| The image’s size in MegaBytes. Returned: when  Sample:  | |
| The image’s list of snapshots. Returned: when  Sample:  | |
| The image’s source. Returned: when  Sample:  | |
| State of image instance. Returned: when  Sample:  | |
| The image’s list of vm ID’s. Returned: when  Sample:  | 
