summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-06-11 17:53:55 +0200
committerChristian Pointner <equinox@spreadspace.org>2020-06-12 00:29:17 +0200
commit607bc14c38dcd0b416f4caefdcb41b0a74012a55 (patch)
treec7c7a8a3a3f6add10f44b46ab8c01d5093a5cc6f
parentsk-cloudia: update nextcloud and jitsi-meet (diff)
harmonize vm install config
-rw-r--r--chaos-at-home/vm-install.yml2
-rw-r--r--common/vm-install.yml8
-rw-r--r--dan/vm-install.yml2
-rw-r--r--inventory/host_vars/ch-gw-lan.yml13
-rw-r--r--inventory/host_vars/ch-hroottest-obsd.yml19
-rw-r--r--inventory/host_vars/ch-hroottest-vm1.yml19
-rw-r--r--inventory/host_vars/ch-jump.yml13
-rw-r--r--inventory/host_vars/ch-keyserver.yml25
-rw-r--r--inventory/host_vars/ch-mimas.yml21
-rw-r--r--inventory/host_vars/ch-router-obsd.yml13
-rw-r--r--inventory/host_vars/ch-testvm.yml25
-rw-r--r--inventory/host_vars/ele-gwhetzner.yml21
-rw-r--r--inventory/host_vars/ele-mur.yml25
-rw-r--r--inventory/host_vars/emc-master.yml21
-rw-r--r--inventory/host_vars/lw-master.yml21
-rw-r--r--inventory/host_vars/r3-cccamp19-av.yml13
-rw-r--r--inventory/host_vars/r3-cccamp19-feedcode.yml13
-rw-r--r--inventory/host_vars/r3-cccamp19-flora.yml13
-rw-r--r--inventory/host_vars/r3-cccamp19-verr.yml13
-rw-r--r--inventory/host_vars/r3-vex2.yml25
-rw-r--r--inventory/host_vars/sk-testvm.yml21
-rw-r--r--inventory/host_vars/sk-tomnext-hp.yml23
-rw-r--r--inventory/host_vars/sk-tomnext-nc.yml21
-rw-r--r--inventory/host_vars/sk-torrent.yml21
-rw-r--r--roles/vm/define/defaults/main.yml2
-rw-r--r--roles/vm/define/templates/libvirt-domain.xml.j26
-rw-r--r--roles/vm/guest/defaults/main.yml5
-rw-r--r--roles/vm/guest/tasks/main.yml36
-rw-r--r--spreadspace/vm-install.yml2
29 files changed, 246 insertions, 216 deletions
diff --git a/chaos-at-home/vm-install.yml b/chaos-at-home/vm-install.yml
index dddfe279..cf19d046 100644
--- a/chaos-at-home/vm-install.yml
+++ b/chaos-at-home/vm-install.yml
@@ -8,7 +8,7 @@
network_cooked: "{{ network }}"
- name: cook variables for host
- hosts: "{{ hostvars[install_hostname].vm_host }}"
+ hosts: "{{ hostvars[install_hostname].install.vm.host }}"
gather_facts: no
tasks:
- set_fact:
diff --git a/common/vm-install.yml b/common/vm-install.yml
index f90d0cd0..4c33bcc4 100644
--- a/common/vm-install.yml
+++ b/common/vm-install.yml
@@ -9,17 +9,17 @@
when:
- "'kvmguests' not in group_names"
- - name: check if the vm_host belongs to the kvmhosts group
+ - name: check if the host system belongs to the kvmhosts group
fail:
- msg: "the host '{{ vm_host }}' does not belong to the group 'kvmhosts'"
+ msg: "the host '{{ install_cooked.vm.host }}' does not belong to the group 'kvmhosts'"
when:
- - "'kvmhosts' not in hostvars[vm_host].group_names"
+ - "'kvmhosts' not in hostvars[install_cooked.vm.host].group_names"
# TODO: add some more sanity checks
- name: create temporary host group for vm host
add_host:
- name: "{{ vm_host }}"
+ name: "{{ install_cooked.vm.host }}"
inventory_dir: "{{ inventory_dir }}"
group: _vmhost_
diff --git a/dan/vm-install.yml b/dan/vm-install.yml
index dddfe279..cf19d046 100644
--- a/dan/vm-install.yml
+++ b/dan/vm-install.yml
@@ -8,7 +8,7 @@
network_cooked: "{{ network }}"
- name: cook variables for host
- hosts: "{{ hostvars[install_hostname].vm_host }}"
+ hosts: "{{ hostvars[install_hostname].install.vm.host }}"
gather_facts: no
tasks:
- set_fact:
diff --git a/inventory/host_vars/ch-gw-lan.yml b/inventory/host_vars/ch-gw-lan.yml
index 3caee723..49cee597 100644
--- a/inventory/host_vars/ch-gw-lan.yml
+++ b/inventory/host_vars/ch-gw-lan.yml
@@ -1,16 +1,18 @@
---
-vm_host: ch-gnocchi
+_vm_host_: ch-gnocchi
install:
- host: "{{ vm_host }}"
- mem: 1024
- numcpu: 2
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 1024
+ numcpu: 2
+ autostart: True
disks:
primary: /dev/sda
scsi:
sda:
type: lvm
- vg: "{{ hostvars[vm_host].host_name }}"
+ vg: "{{ hostvars[_vm_host_].host_name }}"
lv: "{{ inventory_hostname }}"
size: 10g
interfaces:
@@ -18,7 +20,6 @@ install:
name: svc0
- bridge: br-lan
name: lan0
- autostart: True
network:
nameservers: "{{ network_zones.svc.dns }}"
diff --git a/inventory/host_vars/ch-hroottest-obsd.yml b/inventory/host_vars/ch-hroottest-obsd.yml
index 292e8101..61476370 100644
--- a/inventory/host_vars/ch-hroottest-obsd.yml
+++ b/inventory/host_vars/ch-hroottest-obsd.yml
@@ -1,10 +1,12 @@
---
-vm_host: ch-hroottest
+_vm_host_: ch-hroottest
install:
- host: "{{ vm_host }}"
- mem: 1024
- numcpu: 1
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 1024
+ numcpu: 1
+ autostart: True
disks:
primary: /dev/vda
virtio:
@@ -15,13 +17,12 @@ install:
interfaces:
- bridge: br-public
name: vio0
- autostart: True
network:
- nameservers: "{{ hostvars[vm_host].vm_host.network.dns }}"
+ nameservers: "{{ hostvars[_vm_host_].vm_host.network.dns }}"
domain: "{{ host_domain }}"
primary:
interface: vio0
- ip: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
- mask: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
- gateway: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
+ ip: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
+ mask: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
+ gateway: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
diff --git a/inventory/host_vars/ch-hroottest-vm1.yml b/inventory/host_vars/ch-hroottest-vm1.yml
index ccb3ca92..d3276efb 100644
--- a/inventory/host_vars/ch-hroottest-vm1.yml
+++ b/inventory/host_vars/ch-hroottest-vm1.yml
@@ -1,10 +1,12 @@
---
-vm_host: ch-hroottest
+_vm_host_: ch-hroottest
install:
- host: "{{ vm_host }}"
- mem: 4096
- numcpu: 4
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 4096
+ numcpu: 4
+ autostart: True
disks:
primary: /dev/sda
scsi:
@@ -15,15 +17,14 @@ install:
interfaces:
- bridge: br-public
name: primary0
- autostart: True
network:
- nameservers: "{{ hostvars[vm_host].vm_host.network.dns }}"
+ nameservers: "{{ hostvars[_vm_host_].vm_host.network.dns }}"
domain: "{{ host_domain }}"
systemd_link:
interfaces: "{{ install.interfaces }}"
primary:
interface: primary0
- ip: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
- mask: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
- gateway: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
+ ip: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
+ mask: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
+ gateway: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
diff --git a/inventory/host_vars/ch-jump.yml b/inventory/host_vars/ch-jump.yml
index eacd13b0..8a7d1376 100644
--- a/inventory/host_vars/ch-jump.yml
+++ b/inventory/host_vars/ch-jump.yml
@@ -1,16 +1,18 @@
---
-vm_host: ch-gnocchi
+_vm_host_: ch-gnocchi
install:
- host: "{{ vm_host }}"
- mem: 1024
- numcpu: 2
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 1024
+ numcpu: 2
+ autostart: True
disks:
primary: /dev/sda
scsi:
sda:
type: lvm
- vg: "{{ hostvars[vm_host].host_name }}"
+ vg: "{{ hostvars[_vm_host_].host_name }}"
lv: "{{ inventory_hostname }}"
size: 10g
interfaces:
@@ -18,7 +20,6 @@ install:
name: svc0
- bridge: br-mgmt
name: mgmt0
- autostart: True
network:
nameservers: "{{ network_zones.svc.dns }}"
diff --git a/inventory/host_vars/ch-keyserver.yml b/inventory/host_vars/ch-keyserver.yml
index f122b0ed..851116a5 100644
--- a/inventory/host_vars/ch-keyserver.yml
+++ b/inventory/host_vars/ch-keyserver.yml
@@ -1,34 +1,35 @@
---
apt_repo_provider: ffgraz
-vm_host: ch-atlas
+_vm_host_: ch-atlas
install:
- host: "{{ vm_host }}"
- mem: 2048
- numcpu: 2
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 2048
+ numcpu: 2
+ autostart: True
disks:
primary: /dev/sda
scsi:
sda:
type: lvm
- vg: "{{ hostvars[vm_host].host_name }}"
+ vg: "{{ hostvars[_vm_host_].host_name }}"
lv: "{{ inventory_hostname }}"
size: 10g
interfaces:
- bridge: br-public
name: primary0
- autostart: True
network:
- nameservers: "{{ hostvars[vm_host].vm_host.network.dns }}"
+ nameservers: "{{ hostvars[_vm_host_].vm_host.network.dns }}"
domain: "{{ host_domain }}"
systemd_link:
interfaces: "{{ install.interfaces }}"
primary:
interface: primary0
- ip: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
- mask: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
- gateway: "{{ hostvars[vm_host].vm_host.network.bridges.public.gateway }}"
- prefix6: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix6 | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address/prefix') }}"
- gateway6: "{{ hostvars[vm_host].vm_host.network.bridges.public.gateway6 }}"
+ ip: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
+ mask: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
+ gateway: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.gateway }}"
+ prefix6: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix6 | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address/prefix') }}"
+ gateway6: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.gateway6 }}"
diff --git a/inventory/host_vars/ch-mimas.yml b/inventory/host_vars/ch-mimas.yml
index 194ecbb7..c0991944 100644
--- a/inventory/host_vars/ch-mimas.yml
+++ b/inventory/host_vars/ch-mimas.yml
@@ -1,10 +1,12 @@
---
-vm_host: sk-2019vm
+_vm_host_: sk-2019vm
install:
- host: "{{ vm_host }}"
- mem: 2048
- numcpu: 4
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 2048
+ numcpu: 4
+ autostart: True
disks:
primary: /dev/vda
virtio:
@@ -15,18 +17,17 @@ install:
interfaces:
- bridge: br-public
name: eth0
- autostart: True
network:
- nameservers: "{{ hostvars[vm_host].vm_host.network.dns }}"
+ nameservers: "{{ hostvars[_vm_host_].vm_host.network.dns }}"
domain: "{{ host_domain }}"
systemd_link:
interfaces: "{{ install.interfaces }}"
primary:
interface: eth0
- ip: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
- mask: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
- gateway: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
- overlay: "{{ (hostvars[vm_host].vm_host.network.bridges.public.overlay.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}"
+ ip: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
+ mask: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
+ gateway: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
+ overlay: "{{ (hostvars[_vm_host_].vm_host.network.bridges.public.overlay.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}"
external_ip: "{{ network.primary.overlay }}"
diff --git a/inventory/host_vars/ch-router-obsd.yml b/inventory/host_vars/ch-router-obsd.yml
index a88110f3..412482de 100644
--- a/inventory/host_vars/ch-router-obsd.yml
+++ b/inventory/host_vars/ch-router-obsd.yml
@@ -1,22 +1,23 @@
---
-vm_host: ch-gnocchi
+_vm_host_: ch-gnocchi
install:
- host: "{{ vm_host }}"
- mem: 512
- numcpu: 1
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 512
+ numcpu: 1
+ autostart: True
disks:
primary: /dev/sda
virtio:
vda:
type: lvm
- vg: "{{ hostvars[vm_host].host_name }}"
+ vg: "{{ hostvars[_vm_host_].host_name }}"
lv: "{{ inventory_hostname }}"
size: 10g
interfaces:
- bridge: br-svc
name: vio0
- autostart: True
network:
nameservers: "{{ network_zones.svc.dns }}"
diff --git a/inventory/host_vars/ch-testvm.yml b/inventory/host_vars/ch-testvm.yml
index 73702a95..24455db5 100644
--- a/inventory/host_vars/ch-testvm.yml
+++ b/inventory/host_vars/ch-testvm.yml
@@ -1,35 +1,36 @@
---
apt_repo_provider: ffgraz
-vm_host: ch-atlas
+_vm_host_: ch-atlas
install:
- host: "{{ vm_host }}"
- mem: 1024
- numcpu: 1
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 1024
+ numcpu: 1
+ autostart: False
disks:
primary: /dev/sda
scsi:
sda:
type: lvm
- vg: "{{ hostvars[vm_host].host_name }}"
+ vg: "{{ hostvars[_vm_host_].host_name }}"
lv: "{{ inventory_hostname }}"
size: 5g
interfaces:
- bridge: br-public
name: primary0
mac: 52:54:00:42:e6:df
- autostart: False
network:
- nameservers: "{{ hostvars[vm_host].vm_host.network.dns }}"
+ nameservers: "{{ hostvars[_vm_host_].vm_host.network.dns }}"
domain: "{{ host_domain }}"
systemd_link:
interfaces: "{{ install.interfaces }}"
primary:
interface: primary0
- ip: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
- mask: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
- gateway: "{{ hostvars[vm_host].vm_host.network.bridges.public.gateway }}"
- prefix6: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix6 | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address/prefix') }}"
- gateway6: "{{ hostvars[vm_host].vm_host.network.bridges.public.gateway6 }}"
+ ip: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
+ mask: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
+ gateway: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.gateway }}"
+ prefix6: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix6 | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address/prefix') }}"
+ gateway6: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.gateway6 }}"
diff --git a/inventory/host_vars/ele-gwhetzner.yml b/inventory/host_vars/ele-gwhetzner.yml
index 98f5fb6e..2519ab94 100644
--- a/inventory/host_vars/ele-gwhetzner.yml
+++ b/inventory/host_vars/ele-gwhetzner.yml
@@ -1,10 +1,12 @@
---
-vm_host: sk-2019vm
+_vm_host_: sk-2019vm
install:
- host: "{{ vm_host }}"
- mem: 1024
- numcpu: 1
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 1024
+ numcpu: 1
+ autostart: False
disks:
primary: /dev/sda
scsi:
@@ -15,19 +17,18 @@ install:
interfaces:
- bridge: br-public
name: primary0
- autostart: False
network:
- nameservers: "{{ hostvars[vm_host].vm_host.network.dns }}"
+ nameservers: "{{ hostvars[_vm_host_].vm_host.network.dns }}"
domain: "{{ host_domain }}"
systemd_link:
interfaces: "{{ install.interfaces }}"
primary:
interface: primary0
- ip: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
- mask: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
- gateway: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
- overlay: "{{ (hostvars[vm_host].vm_host.network.bridges.public.overlay.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}"
+ ip: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
+ mask: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
+ gateway: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
+ overlay: "{{ (hostvars[_vm_host_].vm_host.network.bridges.public.overlay.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}"
external_ip: "{{ network.primary.overlay }}"
diff --git a/inventory/host_vars/ele-mur.yml b/inventory/host_vars/ele-mur.yml
index 15eff702..88e3b0ed 100644
--- a/inventory/host_vars/ele-mur.yml
+++ b/inventory/host_vars/ele-mur.yml
@@ -5,18 +5,20 @@ ssh_users_root:
apt_repo_provider: ffgraz
-vm_host: ch-atlas
+_vm_host_: ch-atlas
install:
- host: "{{ vm_host }}"
- mem: 1024
- numcpu: 1
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 1024
+ numcpu: 1
+ autostart: False
disks:
primary: /dev/sda
scsi:
sda:
type: lvm
- vg: "{{ hostvars[vm_host].host_name }}"
+ vg: "{{ hostvars[_vm_host_].host_name }}"
lv: "{{ inventory_hostname }}"
size: 5g
interfaces:
@@ -26,17 +28,16 @@ install:
- bridge: br-funkfeuer
name: funkfeuer0
mac: 52:54:00:37:fd:8b
- autostart: False
network:
- nameservers: "{{ hostvars[vm_host].vm_host.network.dns }}"
+ nameservers: "{{ hostvars[_vm_host_].vm_host.network.dns }}"
domain: "{{ host_domain }}"
systemd_link:
interfaces: "{{ install.interfaces }}"
primary:
interface: primary0
- ip: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
- mask: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
- gateway: "{{ hostvars[vm_host].vm_host.network.bridges.public.gateway }}"
- prefix6: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix6 | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address/prefix') }}"
- gateway6: "{{ hostvars[vm_host].vm_host.network.bridges.public.gateway6 }}"
+ ip: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
+ mask: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
+ gateway: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.gateway }}"
+ prefix6: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix6 | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address/prefix') }}"
+ gateway6: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.gateway6 }}"
diff --git a/inventory/host_vars/emc-master.yml b/inventory/host_vars/emc-master.yml
index 71fe8c75..b2050fde 100644
--- a/inventory/host_vars/emc-master.yml
+++ b/inventory/host_vars/emc-master.yml
@@ -1,10 +1,12 @@
---
-vm_host: sk-2019vm
+_vm_host_: sk-2019vm
install:
- host: "{{ vm_host }}"
- mem: 10240
- numcpu: 6
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 10240
+ numcpu: 6
+ autostart: True
disks:
primary: /dev/sda
scsi:
@@ -18,19 +20,18 @@ install:
interfaces:
- bridge: br-public
name: primary0
- autostart: True
network:
- nameservers: "{{ hostvars[vm_host].vm_host.network.dns }}"
+ nameservers: "{{ hostvars[_vm_host_].vm_host.network.dns }}"
domain: "{{ host_domain }}"
systemd_link:
interfaces: "{{ install.interfaces }}"
primary:
interface: primary0
- ip: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
- mask: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
- gateway: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
- overlay: "{{ (hostvars[vm_host].vm_host.network.bridges.public.overlay.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}"
+ ip: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
+ mask: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
+ gateway: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
+ overlay: "{{ (hostvars[_vm_host_].vm_host.network.bridges.public.overlay.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}"
external_ip: "{{ network.primary.overlay }}"
diff --git a/inventory/host_vars/lw-master.yml b/inventory/host_vars/lw-master.yml
index 71fe8c75..b2050fde 100644
--- a/inventory/host_vars/lw-master.yml
+++ b/inventory/host_vars/lw-master.yml
@@ -1,10 +1,12 @@
---
-vm_host: sk-2019vm
+_vm_host_: sk-2019vm
install:
- host: "{{ vm_host }}"
- mem: 10240
- numcpu: 6
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 10240
+ numcpu: 6
+ autostart: True
disks:
primary: /dev/sda
scsi:
@@ -18,19 +20,18 @@ install:
interfaces:
- bridge: br-public
name: primary0
- autostart: True
network:
- nameservers: "{{ hostvars[vm_host].vm_host.network.dns }}"
+ nameservers: "{{ hostvars[_vm_host_].vm_host.network.dns }}"
domain: "{{ host_domain }}"
systemd_link:
interfaces: "{{ install.interfaces }}"
primary:
interface: primary0
- ip: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
- mask: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
- gateway: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
- overlay: "{{ (hostvars[vm_host].vm_host.network.bridges.public.overlay.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}"
+ ip: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
+ mask: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
+ gateway: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
+ overlay: "{{ (hostvars[_vm_host_].vm_host.network.bridges.public.overlay.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}"
external_ip: "{{ network.primary.overlay }}"
diff --git a/inventory/host_vars/r3-cccamp19-av.yml b/inventory/host_vars/r3-cccamp19-av.yml
index 54f6c5da..40524574 100644
--- a/inventory/host_vars/r3-cccamp19-av.yml
+++ b/inventory/host_vars/r3-cccamp19-av.yml
@@ -1,16 +1,18 @@
---
-vm_host: helene
+_vm_host_: helene
install:
- host: "{{ vm_host }}"
- mem: 4096
- numcpu: 4
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 4096
+ numcpu: 4
+ autostart: True
disks:
primary: /dev/sda
scsi:
sda:
type: lvm
- vg: "{{ hostvars[vm_host].host_name }}"
+ vg: "{{ hostvars[_vm_host_].host_name }}"
lv: "{{ inventory_hostname }}"
size: 10g
interfaces:
@@ -18,7 +20,6 @@ install:
name: lan0
- bridge: camp19-br
name: camp0
- autostart: True
network:
nameservers: "{{ network_zones.lan.dns }}"
diff --git a/inventory/host_vars/r3-cccamp19-feedcode.yml b/inventory/host_vars/r3-cccamp19-feedcode.yml
index 87d6afc4..10f78ebc 100644
--- a/inventory/host_vars/r3-cccamp19-feedcode.yml
+++ b/inventory/host_vars/r3-cccamp19-feedcode.yml
@@ -1,16 +1,18 @@
---
-vm_host: helene
+_vm_host_: helene
install:
- host: "{{ vm_host }}"
- mem: 6144
- numcpu: 4
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 6144
+ numcpu: 4
+ autostart: True
disks:
primary: /dev/sda
scsi:
sda:
type: lvm
- vg: "{{ hostvars[vm_host].host_name }}"
+ vg: "{{ hostvars[_vm_host_].host_name }}"
lv: "{{ inventory_hostname }}"
size: 42g
interfaces:
@@ -18,7 +20,6 @@ install:
name: lan0
- bridge: camp19-br
name: camp0
- autostart: True
network:
nameservers: "{{ network_zones.lan.dns }}"
diff --git a/inventory/host_vars/r3-cccamp19-flora.yml b/inventory/host_vars/r3-cccamp19-flora.yml
index 54f6c5da..40524574 100644
--- a/inventory/host_vars/r3-cccamp19-flora.yml
+++ b/inventory/host_vars/r3-cccamp19-flora.yml
@@ -1,16 +1,18 @@
---
-vm_host: helene
+_vm_host_: helene
install:
- host: "{{ vm_host }}"
- mem: 4096
- numcpu: 4
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 4096
+ numcpu: 4
+ autostart: True
disks:
primary: /dev/sda
scsi:
sda:
type: lvm
- vg: "{{ hostvars[vm_host].host_name }}"
+ vg: "{{ hostvars[_vm_host_].host_name }}"
lv: "{{ inventory_hostname }}"
size: 10g
interfaces:
@@ -18,7 +20,6 @@ install:
name: lan0
- bridge: camp19-br
name: camp0
- autostart: True
network:
nameservers: "{{ network_zones.lan.dns }}"
diff --git a/inventory/host_vars/r3-cccamp19-verr.yml b/inventory/host_vars/r3-cccamp19-verr.yml
index 81cbe05b..f4e70d57 100644
--- a/inventory/host_vars/r3-cccamp19-verr.yml
+++ b/inventory/host_vars/r3-cccamp19-verr.yml
@@ -1,16 +1,18 @@
---
-vm_host: helene
+_vm_host_: helene
install:
- host: "{{ vm_host }}"
- mem: 4096
- numcpu: 4
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 4096
+ numcpu: 4
+ autostart: True
disks:
primary: /dev/sda
scsi:
sda:
type: lvm
- vg: "{{ hostvars[vm_host].host_name }}"
+ vg: "{{ hostvars[_vm_host_].host_name }}"
lv: "{{ inventory_hostname }}"
size: 20g
interfaces:
@@ -18,7 +20,6 @@ install:
name: lan0
- bridge: camp19-br
name: camp0
- autostart: True
network:
nameservers: "{{ network_zones.lan.dns }}"
diff --git a/inventory/host_vars/r3-vex2.yml b/inventory/host_vars/r3-vex2.yml
index f700f26f..d43862e9 100644
--- a/inventory/host_vars/r3-vex2.yml
+++ b/inventory/host_vars/r3-vex2.yml
@@ -1,34 +1,35 @@
---
apt_repo_provider: ffgraz
-vm_host: ch-atlas
+_vm_host_: ch-atlas
install:
- host: "{{ vm_host }}"
- mem: 2048
- numcpu: 2
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 2048
+ numcpu: 2
+ autostart: True
disks:
primary: /dev/sda
scsi:
sda:
type: lvm
- vg: "{{ hostvars[vm_host].host_name }}"
+ vg: "{{ hostvars[_vm_host_].host_name }}"
lv: "{{ inventory_hostname }}"
size: 15g
interfaces:
- bridge: br-public
name: primary0
- autostart: True
network:
- nameservers: "{{ hostvars[vm_host].vm_host.network.dns }}"
+ nameservers: "{{ hostvars[_vm_host_].vm_host.network.dns }}"
domain: "{{ host_domain }}"
systemd_link:
interfaces: "{{ install.interfaces }}"
primary:
interface: primary0
- ip: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
- mask: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
- gateway: "{{ hostvars[vm_host].vm_host.network.bridges.public.gateway }}"
- prefix6: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix6 | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address/prefix') }}"
- gateway6: "{{ hostvars[vm_host].vm_host.network.bridges.public.gateway6 }}"
+ ip: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
+ mask: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
+ gateway: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.gateway }}"
+ prefix6: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix6 | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address/prefix') }}"
+ gateway6: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.gateway6 }}"
diff --git a/inventory/host_vars/sk-testvm.yml b/inventory/host_vars/sk-testvm.yml
index 5d9561f0..4074b049 100644
--- a/inventory/host_vars/sk-testvm.yml
+++ b/inventory/host_vars/sk-testvm.yml
@@ -1,10 +1,12 @@
---
-vm_host: sk-2019vm
+_vm_host_: sk-2019vm
install:
- host: "{{ vm_host }}"
- mem: 1024
- numcpu: 1
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 1024
+ numcpu: 1
+ autostart: False
disks:
primary: /dev/sda
scsi:
@@ -15,19 +17,18 @@ install:
interfaces:
- bridge: br-public
name: primary0
- autostart: False
network:
- nameservers: "{{ hostvars[vm_host].vm_host.network.dns }}"
+ nameservers: "{{ hostvars[_vm_host_].vm_host.network.dns }}"
domain: "{{ host_domain }}"
systemd_link:
interfaces: "{{ install.interfaces }}"
primary:
interface: primary0
- ip: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
- mask: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
- gateway: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
- overlay: "{{ (hostvars[vm_host].vm_host.network.bridges.public.overlay.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}"
+ ip: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
+ mask: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
+ gateway: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
+ overlay: "{{ (hostvars[_vm_host_].vm_host.network.bridges.public.overlay.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}"
external_ip: "{{ network.primary.overlay }}"
diff --git a/inventory/host_vars/sk-tomnext-hp.yml b/inventory/host_vars/sk-tomnext-hp.yml
index cfa26218..667cb76d 100644
--- a/inventory/host_vars/sk-tomnext-hp.yml
+++ b/inventory/host_vars/sk-tomnext-hp.yml
@@ -1,10 +1,12 @@
---
-vm_host: sk-tomnext
+_vm_host_: sk-tomnext
install:
- host: "{{ vm_host }}"
- mem: 8192
- numcpu: 4
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 8192
+ numcpu: 4
+ autostart: True
disks:
primary: /dev/sda
scsi:
@@ -15,18 +17,19 @@ install:
interfaces:
- bridge: br-public
name: primary0
- autostart: True
+
+vm_guest_autologin_on_serial: no
network:
- nameservers: "{{ hostvars[vm_host].vm_host.network.dns }}"
+ nameservers: "{{ hostvars[_vm_host_].vm_host.network.dns }}"
domain: "{{ host_domain }}"
systemd_link:
interfaces: "{{ install.interfaces }}"
primary:
interface: primary0
- ip: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
- mask: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
- gateway: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
- overlay: "{{ (hostvars[vm_host].vm_host.network.bridges.public.overlay.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}"
+ ip: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
+ mask: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
+ gateway: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
+ overlay: "{{ (hostvars[_vm_host_].vm_host.network.bridges.public.overlay.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}"
external_ip: "{{ network.primary.overlay }}"
diff --git a/inventory/host_vars/sk-tomnext-nc.yml b/inventory/host_vars/sk-tomnext-nc.yml
index 89138b1b..cef64bb0 100644
--- a/inventory/host_vars/sk-tomnext-nc.yml
+++ b/inventory/host_vars/sk-tomnext-nc.yml
@@ -1,10 +1,12 @@
---
-vm_host: sk-tomnext
+_vm_host_: sk-tomnext
install:
- host: "{{ vm_host }}"
- mem: 16384
- numcpu: 8
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 16384
+ numcpu: 8
+ autostart: True
disks:
primary: /dev/sda
scsi:
@@ -19,19 +21,18 @@ install:
interfaces:
- bridge: br-public
name: primary0
- autostart: True
network:
- nameservers: "{{ hostvars[vm_host].vm_host.network.dns }}"
+ nameservers: "{{ hostvars[_vm_host_].vm_host.network.dns }}"
domain: "{{ host_domain }}"
systemd_link:
interfaces: "{{ install.interfaces }}"
primary:
interface: primary0
- ip: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
- mask: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
- gateway: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
- overlay: "{{ (hostvars[vm_host].vm_host.network.bridges.public.overlay.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}"
+ ip: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
+ mask: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
+ gateway: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
+ overlay: "{{ (hostvars[_vm_host_].vm_host.network.bridges.public.overlay.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}"
external_ip: "{{ network.primary.overlay }}"
diff --git a/inventory/host_vars/sk-torrent.yml b/inventory/host_vars/sk-torrent.yml
index 8135dde0..b5bbb8a2 100644
--- a/inventory/host_vars/sk-torrent.yml
+++ b/inventory/host_vars/sk-torrent.yml
@@ -1,10 +1,12 @@
---
-vm_host: sk-2019vm
+_vm_host_: sk-2019vm
install:
- host: "{{ vm_host }}"
- mem: 4096
- numcpu: 4
+ vm:
+ host: "{{ _vm_host_ }}"
+ mem: 4096
+ numcpu: 4
+ autostart: True
disks:
primary: /dev/sda
scsi:
@@ -19,18 +21,17 @@ install:
interfaces:
- bridge: br-public
name: primary0
- autostart: True
network:
- nameservers: "{{ hostvars[vm_host].vm_host.network.dns }}"
+ nameservers: "{{ hostvars[_vm_host_].vm_host.network.dns }}"
domain: "{{ host_domain }}"
systemd_link:
interfaces: "{{ install.interfaces }}"
primary:
interface: primary0
- ip: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
- mask: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
- gateway: "{{ hostvars[vm_host].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
- overlay: "{{ (hostvars[vm_host].vm_host.network.bridges.public.overlay.prefix | ipaddr(hostvars[vm_host].vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}"
+ ip: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address') }}"
+ mask: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('netmask') }}"
+ gateway: "{{ hostvars[_vm_host_].vm_host.network.bridges.public.prefix | ipaddr('address') }}"
+ overlay: "{{ (hostvars[_vm_host_].vm_host.network.bridges.public.overlay.prefix | ipaddr(hostvars[_vm_host_].vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}"
transmission_rpc_password: "{{ vault_transmission_rpc_password }}"
diff --git a/roles/vm/define/defaults/main.yml b/roles/vm/define/defaults/main.yml
index 29884a9b..f0bcc4fd 100644
--- a/roles/vm/define/defaults/main.yml
+++ b/roles/vm/define/defaults/main.yml
@@ -1,5 +1,5 @@
---
-vm_define_autostart: "{{ not vm_define_installer and hostvars[install_hostname].install_cooked.autostart | default(False) }}"
+vm_define_autostart: "{{ not vm_define_installer and hostvars[install_hostname].install_cooked.vm.autostart | default(False) }}"
vm_define_start: yes
vm_define_installer: no
diff --git a/roles/vm/define/templates/libvirt-domain.xml.j2 b/roles/vm/define/templates/libvirt-domain.xml.j2
index 5e7f8f1f..af9fbf52 100644
--- a/roles/vm/define/templates/libvirt-domain.xml.j2
+++ b/roles/vm/define/templates/libvirt-domain.xml.j2
@@ -1,8 +1,8 @@
<domain type='kvm'>
<name>{{ install_hostname }}</name>
- <memory>{{ hostvars[install_hostname].install_cooked.mem * 1024 }}</memory>
- <currentMemory>{{ hostvars[install_hostname].install_cooked.mem * 1024 }}</currentMemory>
- <vcpu>{{ hostvars[install_hostname].install_cooked.numcpu }}</vcpu>
+ <memory>{{ hostvars[install_hostname].install_cooked.vm.mem * 1024 }}</memory>
+ <currentMemory>{{ hostvars[install_hostname].install_cooked.vm.mem * 1024 }}</currentMemory>
+ <vcpu>{{ hostvars[install_hostname].install_cooked.vm.numcpu }}</vcpu>
<os>
<type arch='x86_64' machine='pc-0.12'>hvm</type>
{% if vm_define_installer %}
diff --git a/roles/vm/guest/defaults/main.yml b/roles/vm/guest/defaults/main.yml
index b4deefa0..ce072e95 100644
--- a/roles/vm/guest/defaults/main.yml
+++ b/roles/vm/guest/defaults/main.yml
@@ -1,3 +1,6 @@
-rngd_config:
+---
+vm_guest_rngd_config:
HRNGDEVICE: /dev/hwrng
RNGDOPTIONS: '"-s 256 -W 80%"'
+
+vm_guest_autologin_on_serial: yes
diff --git a/roles/vm/guest/tasks/main.yml b/roles/vm/guest/tasks/main.yml
index c3a346d7..72ea3272 100644
--- a/roles/vm/guest/tasks/main.yml
+++ b/roles/vm/guest/tasks/main.yml
@@ -1,11 +1,11 @@
-- name: Install rngd
+- name: install rngd
apt:
name: rng-tools
state: present
force_apt_get: yes
-- name: Configure rngd [1/2]
- loop: '{{ rngd_config | dict2items }}'
+- name: configure rngd [1/2]
+ loop: '{{ vm_guest_rngd_config | dict2items }}'
loop_control:
label: "{{ item.key }}"
lineinfile:
@@ -14,8 +14,8 @@
regexp: '^#?{{ item.key }}='
notify: restart rngd
-- name: Configure rngd [2/2]
- loop: '{{ rngd_config | dict2items }}'
+- name: configure rngd [2/2]
+ loop: '{{ vm_guest_rngd_config | dict2items }}'
loop_control:
label: "{{ item.key }}"
lineinfile:
@@ -24,15 +24,19 @@
state: absent
notify: restart rngd
-- name: Provide a root shell on the VM console [1/2]
- file:
- path: /etc/systemd/system/serial-getty@ttyS0.service.d/
- state: directory
-- name: Provide a root shell on the VM console [2/2]
- copy:
- dest: /etc/systemd/system/serial-getty@ttyS0.service.d/autologon.conf
- content: |
- [Service]
- ExecStart=
- ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 --noclear --autologin root --login-pause --host {{ vm_host }} %I $TERM
+- name: provide a root shell on the VM serial console
+ when: vm_guest_autologin_on_serial
+ block:
+ - name: create systemd override directory for gettyS0
+ file:
+ path: /etc/systemd/system/serial-getty@ttyS0.service.d/
+ state: directory
+
+ - name: create autologin config for gettyS0
+ copy:
+ dest: /etc/systemd/system/serial-getty@ttyS0.service.d/autologon.conf
+ content: |
+ [Service]
+ ExecStart=
+ ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 --noclear --autologin root --login-pause --host {{ install_cooked.vm.host }} %I $TERM
diff --git a/spreadspace/vm-install.yml b/spreadspace/vm-install.yml
index dddfe279..cf19d046 100644
--- a/spreadspace/vm-install.yml
+++ b/spreadspace/vm-install.yml
@@ -8,7 +8,7 @@
network_cooked: "{{ network }}"
- name: cook variables for host
- hosts: "{{ hostvars[install_hostname].vm_host }}"
+ hosts: "{{ hostvars[install_hostname].install.vm.host }}"
gather_facts: no
tasks:
- set_fact: