2020-07-06 13:34:33 +00:00
|
|
|
---
|
2024-01-10 14:11:23 +00:00
|
|
|
- name: install libvirt packages [Ubuntu]
|
|
|
|
when: ansible_distribution == "Ubuntu"
|
2020-07-06 13:34:33 +00:00
|
|
|
become: yes
|
|
|
|
apt:
|
|
|
|
update_cache: yes
|
|
|
|
pkg:
|
|
|
|
- virt-viewer
|
|
|
|
- virt-manager
|
|
|
|
- qemu-kvm
|
|
|
|
- libvirt-daemon-system
|
|
|
|
- libvirt-clients
|
|
|
|
- bridge-utils
|
|
|
|
|
2024-01-10 14:11:23 +00:00
|
|
|
- name: install libvirt packages [Arch]
|
|
|
|
become: yes
|
|
|
|
community.general.pacman:
|
|
|
|
name:
|
|
|
|
- kvm
|
|
|
|
- qemu-full
|
|
|
|
- libvirt
|
|
|
|
- virt-manager
|
|
|
|
- virt-viewer
|
|
|
|
|
2020-07-06 13:34:33 +00:00
|
|
|
- name: ensure that your user is added to the group libvirtd
|
|
|
|
become: yes
|
|
|
|
user:
|
|
|
|
name: "{{ ansible_user_id }}"
|
|
|
|
append: yes
|
|
|
|
groups: libvirt, kvm
|
2024-01-10 14:11:23 +00:00
|
|
|
|
|
|
|
- name: enable default network
|
|
|
|
become: yes
|
|
|
|
shell:
|
|
|
|
cmd:
|
|
|
|
virsh net-autostart default
|
|
|
|
virsh net-start default
|