From a37913ecac336d54c3e75ca5046677efb67d2013 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 5 Dec 2020 20:36:20 +0100 Subject: cleanup ch-testvm* and make common playbook work in any case --- chaos-at-home/common.yml | 1 + dan/common.yml | 1 + inventory/group_vars/chaos-at-home/network.yml | 1 + inventory/group_vars/vmhost-ch-atlas/vars.yml | 2 +- inventory/host_vars/ch-testvm-atlas.yml | 32 +++++++++++++++++++++++++ inventory/host_vars/ch-testvm-prometheus.yml | 33 ++++++++++++++++++++++++++ inventory/host_vars/ch-testvm.yml | 32 ------------------------- inventory/hosts.ini | 6 +++-- spreadspace/common.yml | 1 + 9 files changed, 74 insertions(+), 35 deletions(-) create mode 100644 inventory/host_vars/ch-testvm-atlas.yml create mode 100644 inventory/host_vars/ch-testvm-prometheus.yml delete mode 100644 inventory/host_vars/ch-testvm.yml diff --git a/chaos-at-home/common.yml b/chaos-at-home/common.yml index 7c1150b7..44cf2104 100644 --- a/chaos-at-home/common.yml +++ b/chaos-at-home/common.yml @@ -3,6 +3,7 @@ hosts: "{{ install_hostname }}" roles: - role: apt-repo/base + when: ansible_pkg_mgr == "apt" - role: core/base - role: core/sshd - role: core/zsh diff --git a/dan/common.yml b/dan/common.yml index 7c1150b7..44cf2104 100644 --- a/dan/common.yml +++ b/dan/common.yml @@ -3,6 +3,7 @@ hosts: "{{ install_hostname }}" roles: - role: apt-repo/base + when: ansible_pkg_mgr == "apt" - role: core/base - role: core/sshd - role: core/zsh diff --git a/inventory/group_vars/chaos-at-home/network.yml b/inventory/group_vars/chaos-at-home/network.yml index ea7b4958..ba06f20c 100644 --- a/inventory/group_vars/chaos-at-home/network.yml +++ b/inventory/group_vars/chaos-at-home/network.yml @@ -52,6 +52,7 @@ network_zones: ch-imap-proxy: 9 ch-jump: 22 ch-gw-lan: 28 + ch-testvm-prometheus: 42 ch-nic: 53 __svc_http__: 80 __svc_imap__: 143 diff --git a/inventory/group_vars/vmhost-ch-atlas/vars.yml b/inventory/group_vars/vmhost-ch-atlas/vars.yml index ce0421b5..dd69b6e6 100644 --- a/inventory/group_vars/vmhost-ch-atlas/vars.yml +++ b/inventory/group_vars/vmhost-ch-atlas/vars.yml @@ -15,7 +15,7 @@ vm_host: gateway6: 2a02:3e0:407::1 offsets: ch-keyserver: 3 - ch-testvm: 4 + ch-testvm-atlas: 4 ele-mur: 5 r3-vex2: 11 ch-atlas: 13 diff --git a/inventory/host_vars/ch-testvm-atlas.yml b/inventory/host_vars/ch-testvm-atlas.yml new file mode 100644 index 00000000..e86eb632 --- /dev/null +++ b/inventory/host_vars/ch-testvm-atlas.yml @@ -0,0 +1,32 @@ +--- +install: + vm: + memory: 1G + numcpus: 1 + autostart: False + disks: + primary: /dev/sda + scsi: + sda: + type: lvm + vg: "{{ hostvars[vm_host.name].host_name }}" + lv: "{{ inventory_hostname }}" + size: 5g + interfaces: + - bridge: br-public + name: primary0 + mac: 52:54:00:42:e6:df + +network: + nameservers: "{{ vm_host.network.dns }}" + domain: "{{ host_domain }}" + systemd_link: + interfaces: "{{ install.interfaces }}" + primary: &_network_primary_ + name: primary0 + address: "{{ vm_host.network.bridges.public.prefix | ipaddr(vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" + gateway: "{{ vm_host.network.bridges.public.gateway }}" + address6: "{{ vm_host.network.bridges.public.prefix6 | ipaddr(vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" + gateway6: "{{ vm_host.network.bridges.public.gateway6 }}" + interfaces: + - *_network_primary_ diff --git a/inventory/host_vars/ch-testvm-prometheus.yml b/inventory/host_vars/ch-testvm-prometheus.yml new file mode 100644 index 00000000..597cd134 --- /dev/null +++ b/inventory/host_vars/ch-testvm-prometheus.yml @@ -0,0 +1,33 @@ +--- +install_jumphost: ch-jump + +install: + vm: + memory: 1G + numcpus: 1 + autostart: False + disks: + primary: /dev/sda + scsi: + sda: + type: zfs + name: root + size: 5g + interfaces: + - bridge: br-svc + name: svc0 + +network: + nameservers: "{{ network_zones.svc.dns }}" + domain: "{{ host_domain }}" + systemd_link: + interfaces: "{{ install.interfaces }}" + primary: &_network_primary_ + name: svc0 + address: "{{ network_zones.svc.prefix | ipaddr(network_zones.svc.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" + gateway: "{{ network_zones.svc.gateway }}" + static_routes: + - destination: "{{ network_zones.lan.prefix }}" + gateway: "{{ network_zones.svc.prefix | ipaddr(network_zones.svc.offsets['ch-gw-lan']) | ipaddr('address') }}" + interfaces: + - *_network_primary_ diff --git a/inventory/host_vars/ch-testvm.yml b/inventory/host_vars/ch-testvm.yml deleted file mode 100644 index e86eb632..00000000 --- a/inventory/host_vars/ch-testvm.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -install: - vm: - memory: 1G - numcpus: 1 - autostart: False - disks: - primary: /dev/sda - scsi: - sda: - type: lvm - vg: "{{ hostvars[vm_host.name].host_name }}" - lv: "{{ inventory_hostname }}" - size: 5g - interfaces: - - bridge: br-public - name: primary0 - mac: 52:54:00:42:e6:df - -network: - nameservers: "{{ vm_host.network.dns }}" - domain: "{{ host_domain }}" - systemd_link: - interfaces: "{{ install.interfaces }}" - primary: &_network_primary_ - name: primary0 - address: "{{ vm_host.network.bridges.public.prefix | ipaddr(vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" - gateway: "{{ vm_host.network.bridges.public.gateway }}" - address6: "{{ vm_host.network.bridges.public.prefix6 | ipaddr(vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" - gateway6: "{{ vm_host.network.bridges.public.gateway6 }}" - interfaces: - - *_network_primary_ diff --git a/inventory/hosts.ini b/inventory/hosts.ini index 1cd73899..812e7bab 100644 --- a/inventory/hosts.ini +++ b/inventory/hosts.ini @@ -26,10 +26,11 @@ ch-http-proxy host_name=http-proxy ch-imap-proxy host_name=imap-proxy ch-auth-legacy host_name=auth ch-prometheus-legacy host_name=prometheus +ch-testvm-prometheus host_name=testvm-prometheus ch-atlas host_name=atlas ch-pan host_name=pan ch-keyserver host_name=keyserver -ch-testvm host_name=testvm +ch-testvm-atlas host_name=testvm-atlas ch-mimas host_name=mimas ch-mimas2 host_name=mimas @@ -269,13 +270,14 @@ ch-http-proxy ch-imap-proxy ch-auth-legacy ch-prometheus-legacy +ch-testvm-prometheus [vmhost-ch-prometheus] ch-prometheus [vmhost-ch-prometheus:children] vmhost-ch-prometheus-guests [vmhost-ch-atlas-guests] -ch-testvm +ch-testvm-atlas ele-mur r3-vex2 ch-keyserver diff --git a/spreadspace/common.yml b/spreadspace/common.yml index 7c1150b7..44cf2104 100644 --- a/spreadspace/common.yml +++ b/spreadspace/common.yml @@ -3,6 +3,7 @@ hosts: "{{ install_hostname }}" roles: - role: apt-repo/base + when: ansible_pkg_mgr == "apt" - role: core/base - role: core/sshd - role: core/zsh -- cgit v1.2.3