community.libvirt.libvirt_qemu – Run tasks on libvirt/qemu virtual machines

Note

This plugin is part of the community.libvirt collection (version 1.0.2).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.libvirt.

To use it in a playbook, specify: community.libvirt.libvirt_qemu.

New in version 2.10: of community.libvirt

Synopsis

  • Run commands or put/fetch files to libvirt/qemu virtual machines using the qemu agent API.

Requirements

The below requirements are needed on the local controller node that executes this connection.

  • libvirt-python

Parameters

Parameter

Comments

executable

string

Shell to use for execution inside container

Default: “/bin/sh”

Configuration:

  • Variable: ansible_executable

remote_addr

string

Virtual machine name

Default: “inventory_hostname”

Configuration:

  • Variable: ansible_host

virt_uri

string

libvirt URI to connect to to access the virtual machine

Default: “qemu:///system”

Configuration:

  • Variable: ansible_libvirt_uri

Notes

Note

  • Currently DOES NOT work with selinux set to enforcing in the VM.

  • Requires the qemu-agent installed in the VM.

  • Requires access to the qemu-ga commands guest-exec, guest-exec-status, guest-file-close, guest-file-open, guest-file-read, guest-file-write.

Authors