Update to 2021-12-01 19:13

This commit is contained in:
Daniel Berteaud
2021-12-01 19:13:34 +01:00
commit 4c4556c660
2153 changed files with 60999 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
---
libvirt_group: 'libvirt'
libvirt_listen_tcp: False
libvirt_listen_tls: False
libvirt_qemu_save_format: 'lzop'
libvirt_parallel_suspend: '2'
...

View File

@@ -0,0 +1,2 @@
[Service]
TimeoutStopSec=0

View File

@@ -0,0 +1,6 @@
---
- include: ../common/handlers/main.yml
- name: restart libvirtd
service: name=libvirtd state=restarted enabled=yes
...

View File

@@ -0,0 +1,5 @@
---
dependencies:
- { role: common }
- { role: backup }
...

View File

@@ -0,0 +1,60 @@
---
- name: Install repositories
yum: name=centos-release-qemu-ev state=latest
- name: Install libvirt tools
yum:
name:
- libvirt
- libvirt-python
- python-lxml
- qemu-kvm-ev
- bridge-utils
- lzop
- virt-backup
- name: Create libvirt group
group: name=libvirt state=present
- name: Add admin users in libvirt group
user:
name: "{{ item }}"
groups: libvirt
append: yes
with_items: system_admin_users
- name: Deploy libvirtd configuration
template: src={{ item }}.j2 dest=/etc/libvirt/{{ item }} backup=yes mode=644
with_items:
- libvirtd.conf
- qemu.conf
notify: restart libvirtd
- name: Start and enable libvirtd
service: name=libvirtd state=started enabled=yes
- name: Remove the default libvirt network
virt_net: name=default state=absent
- name: Set guest concurrency suspend
lineinfile:
dest: /etc/sysconfig/libvirt-guests
regexp: "#?PARALLEL_SHUTDOWN=.*"
line: "PARALLEL_SHUTDOWN={{ libvirt_parallel_suspend }}"
backup: yes
- name: Create system override directory
file: path=/etc/systemd/system/libvirt-guests.service.d/ state=directory
- name: Add a systemd snippet to override the service stop timeout
copy: src=libvirt-guests-timeout.conf dest=/etc/systemd/system/libvirt-guests.service.d/timeout.conf
notify:
- reload systemd
- name: Enable libvirt guest suspending support
service: name=libvirt-guests enabled=yes
- name: Deploy sudo configuration
template: src=sudo_libvirt.j2 dest=/etc/sudoers.d/backup_libvirt mode=400
...

View File

@@ -0,0 +1,7 @@
listen_tls = {{ libvirt_listen_tls | ternary('1', '0') }}
listen_tcp = {{ libvirt_listen_tcp | ternary('1', '0') }}
mdns_adv = 0
unix_sock_group = "{{ libvirt_group }}"
unix_sock_rw_perms = "0770"
auth_unix_ro = "none"
auth_unix_rw = "none"

View File

@@ -0,0 +1 @@
save_image_format = "{{ libvirt_qemu_save_format }}"

View File

@@ -0,0 +1 @@
lbkp ALL=(root) NOPASSWD: {{ libvirt_sudo_backup_commands | default (['/usr/bin/virt-backup']) | join(',') }}