diff options
author | Christian Pointner <equinox@spreadspace.org> | 2020-07-15 15:27:19 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2020-07-15 15:27:19 +0200 |
commit | c56b50b6f40565a3cb0b0d6dad3802ca4b8a5e9a (patch) | |
tree | c2c06970823a656af9b1bf3aab41972cb3d52827 | |
parent | cosmetic change (diff) |
fix vm/guest roles ordering
-rw-r--r-- | chaos-at-home/ch-oulu.yml | 3 | ||||
-rw-r--r-- | common/vm-install.yml | 4 | ||||
-rw-r--r-- | inventory/group_vars/chaos-at-home/network.yml | 1 | ||||
-rw-r--r-- | inventory/group_vars/vmhost-ch-oulu/main.yml | 6 | ||||
-rw-r--r-- | inventory/host_vars/ch-oulu-vm1.yml | 32 | ||||
-rw-r--r-- | inventory/host_vars/ch-oulu.yml | 16 | ||||
-rw-r--r-- | inventory/hosts.ini | 1 |
7 files changed, 61 insertions, 2 deletions
diff --git a/chaos-at-home/ch-oulu.yml b/chaos-at-home/ch-oulu.yml index a0fd3eaa..352e1f19 100644 --- a/chaos-at-home/ch-oulu.yml +++ b/chaos-at-home/ch-oulu.yml @@ -7,6 +7,9 @@ - role: core/sshd - role: core/zsh - role: core/cpu-microcode + - role: zfs/base + - role: apt-repo/spreadspace + - role: zfs/sanoid - role: vm/host/base - role: vm/host/network - role: installer/debian/base diff --git a/common/vm-install.yml b/common/vm-install.yml index 64894d1a..64f4d696 100644 --- a/common/vm-install.yml +++ b/common/vm-install.yml @@ -58,10 +58,10 @@ - name: make sure to update cached facts setup: roles: - - role: vm/guest/base - when: install_distro in ['debian', 'ubuntu'] - role: vm/guest/network when: install_distro in ['debian', 'ubuntu'] + - role: vm/guest/base + when: install_distro in ['debian', 'ubuntu'] - name: reboot and wait for VM to come back hosts: "{{ install_hostname }}" diff --git a/inventory/group_vars/chaos-at-home/network.yml b/inventory/group_vars/chaos-at-home/network.yml index 5b078528..ba22bcc3 100644 --- a/inventory/group_vars/chaos-at-home/network.yml +++ b/inventory/group_vars/chaos-at-home/network.yml @@ -13,6 +13,7 @@ network_zones: offsets: ch-equinox-ws: 1 ch-oulu: 2 + ch-oulu-vm1: 3 ch-auth: 88 ch-prometheus: 99 ch-prometheus-old: 250 diff --git a/inventory/group_vars/vmhost-ch-oulu/main.yml b/inventory/group_vars/vmhost-ch-oulu/main.yml index db5daa9c..ec87da54 100644 --- a/inventory/group_vars/vmhost-ch-oulu/main.yml +++ b/inventory/group_vars/vmhost-ch-oulu/main.yml @@ -19,3 +19,9 @@ vm_host: name: ch-oulu network: bridges: "{{ __vmhost_bridge_interface_zones_yaml__ | from_yaml }}" + zfs: + default: + pool: storage + name: vm + properties: + compression: lz4 diff --git a/inventory/host_vars/ch-oulu-vm1.yml b/inventory/host_vars/ch-oulu-vm1.yml new file mode 100644 index 00000000..b760cde5 --- /dev/null +++ b/inventory/host_vars/ch-oulu-vm1.yml @@ -0,0 +1,32 @@ +--- +install: + vm: + memory: 16G + numcpus: 12 + autostart: False + disks: + primary: /dev/sda + scsi: + sda: + type: zfs + name: root + size: 10g + interfaces: + - bridge: br-lan + name: lan0 + - bridge: br-svc + name: svc0 + +network: + nameservers: "{{ network_zones.lan.dns }}" + domain: "{{ host_domain }}" + systemd_link: + interfaces: "{{ install.interfaces }}" + primary: &_network_primary_ + name: lan0 + address: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" + gateway: "{{ network_zones.lan.gateway }}" + interfaces: + - *_network_primary_ + - name: svc0 + address: 1.2.3.4/24 diff --git a/inventory/host_vars/ch-oulu.yml b/inventory/host_vars/ch-oulu.yml index f6ef0e4c..813bc184 100644 --- a/inventory/host_vars/ch-oulu.yml +++ b/inventory/host_vars/ch-oulu.yml @@ -38,3 +38,19 @@ apt_repo_components: - main - contrib - non-free ## for microcode updates + + +zfs_arc_size: + min: "{{ 2 * 1024 * 1024 * 1024 }}" + max: "{{ 8 * 1024 * 1024 * 1024 }}" + +zfs_zpools: + storage: + mountpoint: /srv/storage + create_vdevs: mirror /dev/nvme0n1p4 /dev/nvme1n1p4 + +zfs_sanoid_modules: + storage/vm: + use_template: production + recursive: yes + process_children_only: yes diff --git a/inventory/hosts.ini b/inventory/hosts.ini index 549e494b..9cf3b168 100644 --- a/inventory/hosts.ini +++ b/inventory/hosts.ini @@ -26,6 +26,7 @@ ch-gw-lan host_name=gw-lan ch-jump host_name=jump ansible_port=2342 ansible_host=ch-jump ch-nic host_name=nic ch-oulu host_name=oulu host_domain=helsinki.at +ch-oulu-vm1 host_name=testvm host_domain=helsinki.at [chaos-at-home:children] mz-chaos-at-home |