community.general.one_image module – Manages OpenNebula images
Note
This module is part of the community.general collection (version 4.8.3).
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
.
Parameters
Parameter |
Comments |
---|---|
Password of the user to login into OpenNebula RPC server. If not set then the value of the |
|
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 |
|
Name of the user to login into the OpenNebula RPC server. If not set then the value of the |
|
Whether the image should be enabled or disabled. Choices:
|
|
A |
|
A |
|
A name that will be assigned to the existing or new image. In the case of cloning, by default |
|
Choices:
|
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: no
- name: Enable the IMAGE by name
community.general.one_image:
name: bar-image
enabled: yes
- 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
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
image’s group id Returned: success Sample: 1 |
|
image’s group name Returned: success Sample: “one-users” |
|
image id Returned: success Sample: 153 |
|
image name Returned: success Sample: “app1” |
|
image’s owner id Returned: success Sample: 143 |
|
image’s owner name Returned: success Sample: “ansible-test” |
|
count of running vms that use this image Returned: success Sample: 7 |
|
state of image instance Returned: success Sample: “READY” |
|
is image in use Returned: success Sample: true |
Authors
Milan Ilic (@ilicmilan)
Collection links
Issue Tracker Repository (Sources) Submit a bug report Request a feature Communication