Deprecated

Removed in 3.0.0

i

Reason:This module is for deprecated version of ovirt. | Alternative:Use C(ovirt_vm) from the C(ovirt.ovirt) collection instead

community.general.ovirt (2.5.9) — module

oVirt/RHEV platform management

Authors: Vincent Van der Kussen (@vincentvdk)

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

This module only supports oVirt/RHEV version 3. A newer module M(ovirt.ovirt.ovirt_vm) supports oVirt/RHV version 4.

Allows you to create new instances, either from scratch or an image, in addition to deleting or stopping instances on the oVirt/RHEV platform.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Basic example to provision from image
  community.general.ovirt:
    user: admin@internal
    url: https://ovirt.example.com
    instance_name: ansiblevm04
    password: secret
    image: centos_64
    zone: cluster01
    resource_type: template
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Full example to create new instance from scratch
  community.general.ovirt:
    instance_name: testansible
    resource_type: new
    instance_type: server
    user: admin@internal
    password: secret
    url: https://ovirt.example.com
    instance_disksize: 10
    zone: cluster01
    region: datacenter1
    instance_cpus: 1
    instance_nic: nic1
    instance_network: rhevm
    instance_mem: 1000
    disk_alloc: thin
    sdomain: FIBER01
    instance_cores: 1
    instance_os: rhel_6x64
    disk_int: virtio
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Stopping an existing instance
  community.general.ovirt:
    instance_name: testansible
    state: stopped
    user: admin@internal
    password: secret
    url: https://ovirt.example.com
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Start an existing instance
  community.general.ovirt:
    instance_name: testansible
    state: started
    user: admin@internal
    password: secret
    url: https://ovirt.example.com
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Start an instance with cloud init information
  community.general.ovirt:
    instance_name: testansible
    state: started
    user: admin@internal
    password: secret
    url: https://ovirt.example.com
    hostname: testansible
    domain: ansible.local
    ip: 192.0.2.100
    netmask: 255.255.255.0
    gateway: 192.0.2.1
    rootpw: bigsecret

Inputs

    
url:
    description:
    - The url of the oVirt instance.
    required: true
    type: str

user:
    description:
    - The user to authenticate with.
    required: true
    type: str

zone:
    description:
    - Deploy the image to this oVirt cluster.
    type: str

image:
    description:
    - The template to use for the instance.
    type: str

state:
    choices:
    - absent
    - present
    - restart
    - shutdown
    - started
    default: present
    description:
    - Create, terminate or remove instances.
    type: str

region:
    description:
    - The oVirt/RHEV datacenter where you want to deploy to.
    type: str

sdomain:
    description:
    - The Storage Domain where you want to create the instance's disk on.
    type: str

disk_int:
    choices:
    - ide
    - virtio
    default: virtio
    description:
    - Interface type of the disk.
    type: str

password:
    description:
    - Password of the user to authenticate with.
    required: true
    type: str

disk_alloc:
    choices:
    - preallocated
    - thin
    default: thin
    description:
    - Define whether disk is thin or preallocated.
    type: str

instance_ip:
    aliases:
    - ip
    description:
    - Define the instance's IP.
    type: str

instance_os:
    aliases:
    - vmos
    description:
    - Type of Operating System.
    type: str

instance_dns:
    aliases:
    - dns
    description:
    - Define the instance's Primary DNS server.
    type: str

instance_key:
    aliases:
    - key
    description:
    - Define the instance's Authorized key.
    type: str

instance_mem:
    aliases:
    - vmmem
    description:
    - The instance's amount of memory in MB.
    type: str

instance_nic:
    aliases:
    - vmnic
    description:
    - The name of the network interface in oVirt/RHEV.
    type: str

instance_cpus:
    aliases:
    - vmcpus
    default: 1
    description:
    - The instance's number of CPUs.
    type: str

instance_name:
    aliases:
    - vmname
    description:
    - The name of the instance to use.
    required: true
    type: str

instance_type:
    aliases:
    - vmtype
    choices:
    - desktop
    - server
    - high_performance
    default: server
    description:
    - Define whether the instance is a server, desktop or high_performance.
    - I(high_performance) is supported since Ansible 2.5 and oVirt/RHV 4.2.
    type: str

resource_type:
    choices:
    - new
    - template
    description:
    - Whether you want to deploy an image or create an instance from scratch.
    type: str

instance_cores:
    aliases:
    - vmcores
    default: 1
    description:
    - Define the instance's number of cores.
    type: str

instance_domain:
    aliases:
    - domain
    description:
    - Define the instance's Domain.
    type: str

instance_rootpw:
    aliases:
    - rootpw
    description:
    - Define the instance's Root password.
    type: str

instance_gateway:
    aliases:
    - gateway
    description:
    - Define the instance's Gateway.
    type: str

instance_netmask:
    aliases:
    - netmask
    description:
    - Define the instance's Netmask.
    type: str

instance_network:
    aliases:
    - vmnetwork
    default: rhevm
    description:
    - The logical network the machine should belong to.
    type: str

instance_disksize:
    aliases:
    - vm_disksize
    description:
    - Size of the instance's disk in GB.
    type: str

instance_hostname:
    aliases:
    - hostname
    description:
    - Define the instance's Hostname.
    type: str