marciopaiva.libvirt

Ansible Role: libvirt

Build Status Ansible Galaxy License: GPL v3

This role install and configure a host as a Libvirt (KVM) Hypervisor.

Requirements

The host should have Virtualization Technology (VT) enabled.

This role requires root access, so either run it in a playbook with a global become: true, or invoke the role in your playbook like:

- hosts: servers
  roles:
    - role: marciopaiva.libvirt
      become: true

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

---
# Whether to require that Intel Virtualisation Technology (VT) is enabled in
# order to run this role. While this provides better VM performance, it may not
# be available in certain environments.
libvirt_require_vt: true

# Default connection URI
libvirt_uri: 'qemu:///system'

# Settings for libvirt.conf configurations
libvirt_settings: []

# List of network definitions in libvirt, specified as YAML dicts.
libvirt_networks:
  - '{{ network_default }}'

# Set network default to autostart and active
network_default:
  - name: 'default'
    type: 'dnsmasq'
    bridge: 'virbr0'
    addresses:
      - '192.168.122.1/24'
    dhcp_range:
      - '2'
      - '-2'
    state: 'active'
    autostart: true
    dhcp: true
    forward: true
    
# Set pool default to autostart and active
libvirt_pools:
  - '{{ pool_default }}'

pool_default:
  - name: 'default'
    type: 'dir'
    path: '/var/lib/libvirt/images'
    state: 'active'
    autostart: true

Dependencies

None.

Installation

$ ansible-galaxy install marciopaiva.libvirt

Example Playbook

- hosts: servers
  roles:
    - role: marciopaiva.libvirt
      become: true

Author Information

Marcio Paiva Barbosa.

About

This role install and configure a host as a Libvirt (KVM) Hypervisor.

Install
ansible-galaxy install marciopaiva.libvirt
GitHub repository
License
gpl-3.0
Downloads
72
Owner
Solution Architect | Cloud & DevOps Expert | Transforming Complex Challenges into Scalable Solutions