summaryrefslogtreecommitdiff
path: root/ansible/roles/vmhost/tasks/main.yml
blob: 584047b969849044704bc4e1870d57a9df9738b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
- name: "install virtualisation tooling"
  apt:
    name:
    - qemu-kvm
    - virtinst
    - virt-manager
    - libvirt-daemon-system
    - libvirt-clients
    - libnss-libvirt
    - kpartx
    - moreutils

- 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_guest /' /etc/nsswitch.conf
    fi