summaryrefslogtreecommitdiff
path: root/ansible/roles/vmhost/tasks/main.yml
blob: b5bd138dbff5a6ebe4673d1e9f28f526ae149cac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
- name: "install virtualisation tooling"
  apt:
    name:
    - qemu-system-x86
    - virtinst
    - virt-manager
    - libvirt-daemon-system
    - libvirt-clients
    - libnss-libvirt
    - kpartx
    - moreutils
    - vmadm
    - python3-lxml

- name: "enable nested KVM if possible"
  copy:
    src: kvm-nested.conf
    dest: /etc/modprobe.d/kvm-nested.conf

- name: "add libvirt_guest to /etc/nsswitch.conf"
  shell: |
    if awk '$1 == "hosts:" && !/libvirt_guest/' /etc/nsswitch.conf | grep .
    then
        sed -i '/hosts:/s/files /files libvirt libvirt_guest /' /etc/nsswitch.conf
    fi

- name: "enable libvirt default network"
  virt_net:
    name: default
    autostart: yes