ansible.builtin.one_image (v2.9.27) — module

Manages OpenNebula images

| "added in version" 2.6 of ansible.builtin"

Authors: Milan Ilic (@ilicmilan)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

Manages OpenNebula images


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Fetch the IMAGE by id
- one_image:
    id: 45
  register: result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Print the IMAGE properties
- debug:
    msg: result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Rename existing IMAGE
- one_image:
    id: 34
    state: renamed
    new_name: bar-image
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Disable the IMAGE by id
- one_image:
    id: 37
    enabled: no
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Enable the IMAGE by name
- one_image:
    name: bar-image
    enabled: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Clone the IMAGE by name
- one_image:
    name: bar-image
    state: cloned
    new_name: bar-image-clone
  register: result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Delete the IMAGE by id
- one_image:
    id: '{{ result.id }}'
    state: absent

Inputs

    
id:
    description:
    - A C(id) of the image you would like to manage.

name:
    description:
    - A C(name) of the image you would like to manage.

state:
    choices:
    - present
    - absent
    - cloned
    - renamed
    default: present
    description:
    - C(present) - state that is used to manage the image
    - C(absent) - delete the image
    - C(cloned) - clone the image
    - C(renamed) - rename the image to the C(new_name)

api_url:
    description:
    - 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 C(ONE_URL) environment variable is used.

enabled:
    description:
    - Whether the image should be enabled or disabled.
    type: bool

new_name:
    description:
    - A name that will be assigned to the existing or new image.
    - In the case of cloning, by default C(new_name) will take the name of the origin
      image with the prefix 'Copy of'.

api_password:
    description:
    - Password of the user to login into OpenNebula RPC server. If not set
    - then the value of the C(ONE_PASSWORD) environment variable is used.

api_username:
    description:
    - Name of the user to login into the OpenNebula RPC server. If not set
    - then the value of the C(ONE_USERNAME) environment variable is used.

Outputs

group_id:
  description: image's group id
  returned: success
  sample: 1
  type: int
group_name:
  description: image's group name
  returned: success
  sample: one-users
  type: str
id:
  description: image id
  returned: success
  sample: 153
  type: int
name:
  description: image name
  returned: success
  sample: app1
  type: str
owner_id:
  description: image's owner id
  returned: success
  sample: 143
  type: int
owner_name:
  description: image's owner name
  returned: success
  sample: ansible-test
  type: str
running_vms:
  description: count of running vms that use this image
  returned: success
  sample: 7
  type: int
state:
  description: state of image instance
  returned: success
  sample: READY
  type: str
used:
  description: is image in use
  returned: success
  sample: true
  type: bool