New in version 2.6.
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. |
enabled
|
|
Whether the image should be enabled or disabled.
|
id
|
|
A
id of the image you would like to manage. |
name
|
|
A
name of the image you would like to manage. |
new_name
|
|
A name that will be assigned to the existing or new image.
In the case of cloning, by default
new_name will take the name of the origin image with the prefix 'Copy of'. |
state
|
|
present - state that is used to manage the imageabsent - delete the imagecloned - clone the imagerenamed - rename the image to the new_name |
# Fetch the IMAGE by id
- one_image:
id: 45
register: result
# Print the IMAGE properties
- debug:
msg: result
# Rename existing IMAGE
- one_image:
id: 34
state: renamed
new_name: bar-image
# Disable the IMAGE by id
- one_image:
id: 37
enabled: no
# Enable the IMAGE by name
- one_image:
name: bar-image
enabled: yes
# Clone the IMAGE by name
- one_image:
name: bar-image
state: cloned
new_name: bar-image-clone
register: result
# Delete the IMAGE by id
- one_image:
id: '{{ result.id }}'
state: absent
Common return values are documented here, the following are the fields unique to this module:
Key |
Returned |
Description |
---|---|---|
group_id
int
|
success |
image's group id
Sample:
1
|
group_name
string
|
success |
image's group name
Sample:
one-users
|
id
int
|
success |
image id
Sample:
153
|
name
string
|
success |
image name
Sample:
app1
|
owner_id
int
|
success |
image's owner id
Sample:
143
|
owner_name
string
|
success |
image's owner name
Sample:
ansible-test
|
running_vms
int
|
success |
count of running vms that use this image
Sample:
7
|
state
string
|
success |
state of image instance
Sample:
READY
|
used
bool
|
success |
is image in use
Sample:
True
|
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
Hint
If you notice any issues in this documentation you can edit this document to improve it.