Default variables

libvirt system configuration

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:
  'wheezy':  [ 'libvirt-bin' ]
  'precise': [ 'libvirt-bin' ]
  'trusty':  [ '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'