debops.libvirt default variables

libvirt system configuration

libvirt__base_packages

List of base packages to install with Libvirt.

libvirt__base_packages:
  - [ 'gawk', 'netcat-openbsd', 'virtinst' ]
  - '{{ [] if (ansible_distribution_release in ["bullseye"])
           else "virt-top" }}'
  - '{{ "virt-goodies"
        if (ansible_local | d() and ansible_local.python | d() and
            (ansible_local.python.installed2 | d()) | bool)
        else [] }}'
libvirt__packages

List of libvirt packages which will be installed on all distribution releases, unless overridden.

libvirt__packages: [ 'libvirt-clients' ]
libvirt__packages_map

Override list of base packages for specific distribution releases.

libvirt__packages_map:
  'trusty':  [ 'libvirt-bin' ]
  'xenial':  [ 'libvirt-bin' ]
libvirt__group_map

Mapping of default UNIX access group on different distributions.

libvirt__group_map:
  'Debian': 'libvirt'
  'Ubuntu': 'libvirtd'

libvirt connection URI

libvirt__default_uri

Default connection URI (connect to libvirtd instance on localhost).

libvirt__default_uri: 'qemu:///system'
libvirt__connections

Dict with connections configured in ~/.config/libvirt/libvirt.conf. See libvirt__connections for more details.

libvirt__connections:
  'localhost': '{{ libvirt__default_uri }}'
libvirt__uri

Name of the connection from libvirt__connections dict used by default by libvirt clients on the admin account.

libvirt__uri: 'localhost'

libvirt network configuration

libvirt__networks

List of network definitions in libvirt, specified as YAML dicts. See libvirt__networks for more details.

libvirt__networks:
  - '{{ libvirt__networks_default }}'
  - '{{ libvirt__networks_virt_nat }}'
libvirt__networks_default

Default DebOps network configuration for libvirt. NAT that comes with libvirt by default is inactive, bridges configured by debops.ifupdown are automatically added to libvirt if they are present.

libvirt__networks_default:

  # Internal network configured by ``libvirt`` by default.
  - name: 'default'
    type: 'dnsmasq'
    bridge: 'virbr0'
    addresses: [ '192.168.122.1/24' ]
    dhcp_range: [ '2', '-2' ]
    state: 'absent'

  - name: 'external'
    type: 'bridge'
    bridge: 'br0'
    interface_present: 'br0'

  - name: 'internal'
    type: 'bridge'
    bridge: 'br1'
    interface_present: 'br1'

  - name: 'nat'
    type: 'bridge'
    bridge: 'br2'
    interface_present: 'br2'
libvirt__networks_virt_nat

An internal network behind NAT. This is a replacement configuration for default libvirt network, since you cannot redefine existing configuration, only undefine the old one and define a new one. Using different item.name avoids the issue of redefining the network all the time.

libvirt__networks_virt_nat:

  - name: 'virt-nat'
    type: 'dnsmasq'
    bridge: 'virbr0'
    addresses: [ '192.168.122.1/24' ]
    domain: 'nat.{{ ansible_domain }}'
    state: 'active'
    forward: True
    dhcp: True

libvirt storage pool configuration

libvirt__pools

List of storage pool definitions in libvirt, specified as YAML dicts. See libvirt__pools for more details.

libvirt__pools:
  - '{{ libvirt__pools_default }}'
libvirt__pools_default

List of default storage pools configured by debops.libvirt.

libvirt__pools_default:

  - name: 'default'
    type: 'dir'
    path: '/var/lib/libvirt/images'

Configuration for other Ansible roles

libvirt__python__dependent_packages3

Configuration for the debops.python Ansible role.

libvirt__python__dependent_packages3:

  - 'python3-libvirt'
  - 'python3-lxml'
libvirt__python__dependent_packages2

Configuration for the debops.python Ansible role.

libvirt__python__dependent_packages2:

  - 'python-libvirt'
  - 'python-lxml'