ansible.builtin.virt (v2.3.2.0-1) — module

Manages virtual machines supported by libvirt

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

Authors: Ansible Core Team, Michael DeHaan, Seth Vidal

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.3.2.0.post1

Description

Manages virtual machines supported by I(libvirt).


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# a playbook task line:
- virt:
    name: alpha
    state: running

Inputs

    
uri:
    default: qemu:///system
    description:
    - libvirt connection uri
    required: false

xml:
    default: null
    description:
    - XML document used with the define command
    required: false

name:
    aliases: []
    default: null
    description:
    - name of the guest VM being managed. Note that VM must be previously defined with
      xml.
    required: true

state:
    choices:
    - running
    - shutdown
    - destroyed
    - paused
    default: 'no'
    description:
    - Note that there may be some lag for state requests like C(shutdown) since these
      refer only to VM states. After starting a guest, it may not be immediately accessible.
    required: false

command:
    choices:
    - create
    - status
    - start
    - stop
    - pause
    - unpause
    - shutdown
    - undefine
    - destroy
    - get_xml
    - freemem
    - list_vms
    - info
    - nodeinfo
    - virttype
    - define
    description:
    - in addition to state management, various non-idempotent commands are available.
      See examples
    required: false

autostart:
    choices:
    - true
    - false
    default: null
    description:
    - start VM at host startup
    version_added: '2.3'
    version_added_collection: ansible.builtin

Outputs

list_vms:
  description: The list of vms defined on the remote system
  returned: success
  sample:
  - build.example.org
  - dev.example.org
  type: dictionary
status:
  description: The status of the VM, among running, crashed, paused and shutdown
  returned: success
  sample: success
  type: string