uoi-io.libvirt

Ansible libvirt (Ready for OpenStack)

Build Status Ansible Galaxy

This tool helps you install and set up the libvirt service on various operating systems.

Supported Operating Systems

  • CentOS
  • RedHat
  • Debian
  • Ubuntu
  • Suse
  • OpenSuse

Features Supported

  • Firewalld (You need to have iptables and firewalld installed on the server)
  • SELinux

Requirements

You need at least Ansible version 2.x.

Role Variables

# file: roles/libvirt/defaults/main.yml
libvirt_firewalld: true
libvirt_selinux: true
libvirt_port: 16509
libvirt_bind_address: 0.0.0.0
libvirt_config: []
libvirt_qemu_config: []

Variables

Since the module works with both RedHat and Debian systems, we need to set some values based on the type of operating system.

### FOR REDHAT
# file: roles/libvirt/vars/RedHat.yml
libvirt_packages:
  - libvirt-daemon-kvm
libvirt_daemon_config_file: /etc/sysconfig/libvirtd
libvirt_config_file: /etc/libvirt/libvirtd.conf
libvirt_qemu_config_file: /etc/libvirt/qemu.conf
libvirt_daemon_config:
  - { option: 'LIBVIRTD_ARGS', value: 'LIBVIRTD_ARGS="--listen"' }
### FOR DEBIAN
# file: roles/libvirt/vars/Debian.yml
libvirt_packages:
  - libvirt-bin
libvirt_daemon_config_file: /etc/default/libvirtd 
libvirt_config_file: /etc/libvirt/libvirtd.conf
libvirt_qemu_config_file: /etc/libvirt/qemu.conf
libvirt_daemon_config:
  - { option: 'libvirtd_opts', value: 'libvirtd_opts="-l"' }

Dependencies

None.

Example Playbook

---
libvirt_bind_address: 10.10.150.23
libvirt_config:
  - { option: 'listen_tls', value: 'listen_tls = 0' }
  - { option: 'listen_tcp', value: 'listen_tcp = 1' }
  - { option: 'listen_addr', value: 'listen_addr = "{{ libvirt_bind_address }}"' }
  - { option: 'tcp_port', value: 'tcp_port = "{{ libvirt_port }}"' }
  - { option: 'auth_tcp', value: 'auth_tcp = "none"' }

libvirt_qemu_config:
  - { option: 'user', value: 'user = "nova"' }
  - { option: 'group', value: 'group = "nova"' }
  - { option: 'dynamic_ownership', value: 'dynamic_ownership = 0' }

License

Apache License

Author Information

This role was created in 2016 by Gaëtan Trellu (goldyfruit).

Informazioni sul progetto

Deploy and configure libvirt

Installa
ansible-galaxy install uoi-io.libvirt
Licenza
apache-2.0
Download
2k