community.general.one_host (8.5.0) — module

Manages OpenNebula Hosts

Authors: Rafael del Valle (@rvalle)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Manages OpenNebula Hosts


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a new host in OpenNebula
  community.general.one_host:
    name: host1
    cluster_id: 1
    api_url: http://127.0.0.1:2633/RPC2
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a host and adjust its template
  community.general.one_host:
    name: host2
    cluster_name: default
    template:
        LABELS:
            - gold
            - ssd
        RESERVED_CPU: -100

Inputs

    
name:
    description:
    - Hostname of the machine to manage.
    required: true
    type: str

state:
    choices:
    - absent
    - present
    - enabled
    - disabled
    - offline
    default: present
    description:
    - Takes the host to the desired lifecycle state.
    - If V(absent) the host will be deleted from the cluster.
    - If V(present) the host will be created in the cluster (includes V(enabled), V(disabled)
      and V(offline) states).
    - If V(enabled) the host is fully operational.
    - V(disabled), e.g. to perform maintenance operations.
    - V(offline), host is totally offline.
    type: str

labels:
    description:
    - The labels for this host.
    elements: str
    type: list

api_url:
    aliases:
    - api_endpoint
    description:
    - The ENDPOINT URL of the XMLRPC server.
    - If not specified then the value of the E(ONE_URL) environment variable, if any,
      is used.
    type: str

template:
    aliases:
    - attributes
    description:
    - The template or attribute changes to merge into the host template.
    type: dict

cluster_id:
    default: 0
    description:
    - The cluster ID.
    type: int

im_mad_name:
    default: kvm
    description:
    - The name of the information manager, this values are taken from the oned.conf with
      the tag name IM_MAD (name)
    type: str

api_password:
    aliases:
    - api_token
    description:
    - The password or token for XMLRPC authentication.
    - If not specified then the value of the E(ONE_PASSWORD) environment variable, if
      any, is used.
    type: str

api_username:
    description:
    - The name of the user for XMLRPC authentication.
    - If not specified then the value of the E(ONE_USERNAME) environment variable, if
      any, is used.
    type: str

cluster_name:
    description:
    - The cluster specified by name.
    type: str

vmm_mad_name:
    default: kvm
    description:
    - The name of the virtual machine manager mad name, this values are taken from the
      oned.conf with the tag name VM_MAD (name)
    type: str

wait_timeout:
    default: 300
    description:
    - Time to wait for the desired state to be reached before timeout, in seconds.
    type: int

validate_certs:
    default: true
    description:
    - Whether to validate the TLS/SSL certificates or not.
    - This parameter is ignored if E(PYTHONHTTPSVERIFY) environment variable is used.
    type: bool