1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/libvirt/tasks/main.yml

44 lines
1.1 KiB
YAML

---
- name: Remove iptables to solve iptables<->iptables-nft conflict
pacman: name=iptables force=yes state=absent
- name: Install libvirt and needed optional dependencies
pacman:
state: present
name:
- dnsmasq
- iptables-nft
- libvirt
- qemu-base
- qemu-hw-display-virtio-gpu
- qemu-hw-display-virtio-vga
- libvirt-python
- python-lxml
register: result
- name: Reload firewalld
service: name=firewalld state=reloaded
when: result.changed
- name: Autostart default network on boot
file: src=/etc/libvirt/qemu/networks/default.xml dest=/etc/libvirt/qemu/networks/autostart/default.xml state=link owner=root group=root
- name: Start and enable libvirtd
systemd_service: name=libvirtd enabled=yes state=started daemon_reload=yes
- name: Define the images storage pool
community.libvirt.virt_pool:
command: define
name: images
xml: "{{ lookup('file', 'images.xml') }}"
- name: Start the image storage pool
community.libvirt.virt_pool:
state: active
name: images
- name: Start the image storage pool at boot
community.libvirt.virt_pool:
autostart: true
name: images