summaryrefslogtreecommitdiff
path: root/ansible/roles/vmhost-minimal
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-03-16 09:40:48 +0200
committerLars Wirzenius <liw@liw.fi>2020-03-16 09:40:48 +0200
commite6bd82dc876887d654cf913d29f7be975670321e (patch)
tree6105fb5fad3d30d0fdb7a5b4cabe69ca280c4bc8 /ansible/roles/vmhost-minimal
parentcef3c31f3a8ea4354e208029431da3646786e898 (diff)
downloadansibleness-e6bd82dc876887d654cf913d29f7be975670321e.tar.gz
Add: vmhost-minimal role
Diffstat (limited to 'ansible/roles/vmhost-minimal')
-rw-r--r--ansible/roles/vmhost-minimal/files/kvm-nested.conf4
-rw-r--r--ansible/roles/vmhost-minimal/tasks/main.yml12
-rw-r--r--ansible/roles/vmhost-minimal/templates/interfaces25
3 files changed, 41 insertions, 0 deletions
diff --git a/ansible/roles/vmhost-minimal/files/kvm-nested.conf b/ansible/roles/vmhost-minimal/files/kvm-nested.conf
new file mode 100644
index 0000000..42261eb
--- /dev/null
+++ b/ansible/roles/vmhost-minimal/files/kvm-nested.conf
@@ -0,0 +1,4 @@
+options kvm-intel nested=1
+options kvm-intel enable_shadow_vmcs=1
+options kvm-intel enable_apicv=1
+options kvm-intel ept=1
diff --git a/ansible/roles/vmhost-minimal/tasks/main.yml b/ansible/roles/vmhost-minimal/tasks/main.yml
new file mode 100644
index 0000000..f0c479f
--- /dev/null
+++ b/ansible/roles/vmhost-minimal/tasks/main.yml
@@ -0,0 +1,12 @@
+- name: "install virtualisation tooling"
+ apt:
+ name:
+ - qemu-system-x86
+ - virtinst
+ - libvirt-daemon-system
+ - libvirt-clients
+
+- name: "enable nested KVM if possible"
+ copy:
+ src: kvm-nested.conf
+ dest: /etc/modprobe.d/kvm-nested.conf
diff --git a/ansible/roles/vmhost-minimal/templates/interfaces b/ansible/roles/vmhost-minimal/templates/interfaces
new file mode 100644
index 0000000..2dd3374
--- /dev/null
+++ b/ansible/roles/vmhost-minimal/templates/interfaces
@@ -0,0 +1,25 @@
+source /etc/network/interfaces.d/*
+
+auto lo
+iface lo inet loopback
+iface lo inet6 loopback
+
+auto enp3s0
+iface enp3s0 inet manual
+
+auto br0
+iface br0 inet dhcp
+ bridge_ports enp3s0
+ bridge_stp off
+ bridge_fd 0
+ bridge_maxwait 0
+ address 78.46.87.180
+ netmask 255.255.255.224
+ gateway 78.46.87.161
+ # route 78.46.87.160/27 via 78.46.87.161
+ up route add -net 78.46.87.160 netmask 255.255.255.224 gw 78.46.87.161 dev enp3s0
+
+iface enp3s0 inet6 static
+ address 2a01:4f8:120:208b::2
+ netmask 64
+ gateway fe80::1