Deprecated

Removed in 3.0.0

i

Reason:When migrating to collection we decided to use only _info modules. | Alternative:Use M(ovirt.ovirt.ovirt_vm_info) instead.

community.general.ovirt_vm_facts (2.5.9) — module

Retrieve information about one or more oVirt/RHV virtual machines

Authors: Ondra Machacek (@machacekondra)

Install collection

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


Add to requirements.yml

  collections:
    - name: community.general
      version: 2.5.9

Description

Retrieve information about one or more oVirt/RHV virtual machines.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Examples don't contain auth parameter for simplicity,
# look at ovirt_auth module to see how to reuse authentication:

- name: Gather information about all VMs which names start with centos and belong to cluster west
  ovirt_vm_info:
    pattern: name=centos* and cluster=west
  register: result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Print gathered information
  ansible.builtin.debug:
    msg: "{{ result.ovirt_vms }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Gather info about next run configuration of virtual machine named myvm
  ovirt_vm_info:
    pattern: name=myvm
    next_run: true
  register: result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Print gathered information
  ansible.builtin.debug:
    msg: "{{ result.ovirt_vms[0] }}"

Inputs

    
max:
    description:
    - The maximum number of results to return.

auth:
    description:
    - 'Dictionary with values needed to create HTTP/HTTPS connection to oVirt:'
    - C(username)[I(required)] - The name of the user, something like I(admin@internal).
      Default value is set by I(OVIRT_USERNAME) environment variable.
    - C(password)[I(required)] - The password of the user. Default value is set by I(OVIRT_PASSWORD)
      environment variable.
    - C(url)- A string containing the API URL of the server, usually something like `I(https://server.example.com/ovirt-engine/api)`.
      Default value is set by I(OVIRT_URL) environment variable. Either C(url) or C(hostname)
      is required.
    - C(hostname) - A string containing the hostname of the server, usually something
      like `I(server.example.com)`. Default value is set by I(OVIRT_HOSTNAME) environment
      variable. Either C(url) or C(hostname) is required.
    - C(token) - Token to be used instead of login with username/password. Default value
      is set by I(OVIRT_TOKEN) environment variable.
    - C(insecure) - A boolean flag that indicates if the server TLS certificate and host
      name should be checked.
    - C(ca_file) - A PEM file containing the trusted CA certificates. The certificate
      presented by the server will be verified using these CA certificates. If `C(ca_file)`
      parameter is not set, system wide CA certificate store is used. Default value is
      set by I(OVIRT_CAFILE) environment variable.
    - C(kerberos) - A boolean flag indicating if Kerberos authentication should be used
      instead of the default basic authentication.
    - C(headers) - Dictionary of HTTP headers to be added to each API call.
    required: true
    type: dict

pattern:
    description:
    - Search term which is accepted by oVirt/RHV search backend.
    - 'For example to search VM X from cluster Y use following pattern: name=X and cluster=Y'

next_run:
    description:
    - Indicates if the returned result describes the virtual machine as it is currently
      running or if describes the virtual machine with the modifications that have already
      been performed but that will only come into effect when the virtual machine is restarted.
      By default the value is set by engine.
    type: bool

all_content:
    default: false
    description:
    - If I(true) all the attributes of the virtual machines should be included in the
      response.
    type: bool

fetch_nested:
    default: false
    description:
    - If I(yes) the module will fetch additional data from the API.
    - It will fetch only IDs of nested entity. It doesn't fetch multiple levels of nested
      attributes. Only the attributes of the current entity. User can configure to fetch
      other attributes of the nested entities by specifying C(nested_attributes).
    type: bool

case_sensitive:
    default: true
    description:
    - If I(true) performed search will take case into account.
    type: bool

nested_attributes:
    description:
    - Specifies list of the attributes which should be fetched from the API.
    - This parameter apply only when C(fetch_nested) is I(true).
    type: list

Outputs

ovirt_vms:
  description: 'List of dictionaries describing the VMs. VM attributes are mapped
    to dictionary keys, all VMs attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/vm.'
  returned: On success.
  type: list