From d9bc85387db33647e911e3e5ee5fed95cd208310 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 4 Jul 2020 02:14:16 +0200 Subject: remove: ch k8s cluster vms, and hroot-test, add hcloud-test --- inventory/host_vars/ch-hroottest-obsd.yml | 26 -------------- inventory/host_vars/ch-hroottest-vm1.yml | 37 ------------------- inventory/host_vars/ch-hroottest.yml | 60 ------------------------------- inventory/host_vars/ch-k8s-m0.yml | 45 ----------------------- inventory/host_vars/ch-k8s-m1.yml | 45 ----------------------- inventory/host_vars/ch-k8s-m2.yml | 43 ---------------------- inventory/host_vars/ch-k8s-w0.yml | 43 ---------------------- inventory/host_vars/ch-k8s-w1.yml | 43 ---------------------- 8 files changed, 342 deletions(-) delete mode 100644 inventory/host_vars/ch-hroottest-obsd.yml delete mode 100644 inventory/host_vars/ch-hroottest-vm1.yml delete mode 100644 inventory/host_vars/ch-hroottest.yml delete mode 100644 inventory/host_vars/ch-k8s-m0.yml delete mode 100644 inventory/host_vars/ch-k8s-m1.yml delete mode 100644 inventory/host_vars/ch-k8s-m2.yml delete mode 100644 inventory/host_vars/ch-k8s-w0.yml delete mode 100644 inventory/host_vars/ch-k8s-w1.yml (limited to 'inventory/host_vars') diff --git a/inventory/host_vars/ch-hroottest-obsd.yml b/inventory/host_vars/ch-hroottest-obsd.yml deleted file mode 100644 index 96ec2fe2..00000000 --- a/inventory/host_vars/ch-hroottest-obsd.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -install: - vm: - memory: 1G - numcpus: 1 - autostart: True - disks: - primary: /dev/vda - virtio: - vda: - type: zfs - name: root - size: 10g - interfaces: - - bridge: br-public - name: vio0 - -network: - nameservers: "{{ vm_host.network.dns }}" - domain: "{{ host_domain }}" - primary: &_network_primary_ - name: vio0 - 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.prefix | ipaddr(vm_host.network.bridges.public.offsets[vm_host.name]) | ipaddr('address') }}" - interfaces: - - *_network_primary_ diff --git a/inventory/host_vars/ch-hroottest-vm1.yml b/inventory/host_vars/ch-hroottest-vm1.yml deleted file mode 100644 index a7f45252..00000000 --- a/inventory/host_vars/ch-hroottest-vm1.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -install: - vm: - memory: 4G - numcpus: 4 - autostart: True - disks: - primary: /dev/sda - scsi: - sda: - type: zfs - name: root - size: 20g - properties: - refreservation: none - sdb: - type: zfs - name: data - size: 100g - properties: - refreservation: none - compression: off - interfaces: - - bridge: br-public - name: primary0 - -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.prefix | ipaddr(vm_host.network.bridges.public.offsets[vm_host.name]) | ipaddr('address') }}" - interfaces: - - *_network_primary_ diff --git a/inventory/host_vars/ch-hroottest.yml b/inventory/host_vars/ch-hroottest.yml deleted file mode 100644 index 4ed4449f..00000000 --- a/inventory/host_vars/ch-hroottest.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -install: - cloud: - credentials: "{{ vault_hroot_robot_account }}" - server_name: "{{ host_name }}" - disks: - primary: software-raid - raid: - level: 1 - members: - - /dev/sda - - /dev/sdb - root_lvm_size: 10G - -network: - nameservers: "{{ vm_host.network.dns }}" - domain: "{{ host_domain }}" - interfaces: - - name: br-public - address: "{{ vm_host.network.bridges.public.prefix | ipaddr(vm_host.network.bridges.public.offsets[inventory_hostname]) | ipaddr('address/prefix') }}" - - -apt_repo_components: - - main - - contrib ## for zfs - - non-free ## for microcode updates - - -zfs_arc_size: - min: "{{ 1 * 1024 * 1024 * 1024 }}" - max: "{{ 4 * 1024 * 1024 * 1024 }}" - -zfs_zpools: - storage: - mountpoint: /srv/storage - create_vdevs: mirror /dev/disk/by-id/ata-SAMSUNG_HD753LJ_S13UJ1LS801071-part3 /dev/disk/by-id/ata-SAMSUNG_HD753LJ_S13UJ1BQ802393-part3 - -# zfs_sanoid_modules: -# storage/vm: -# use_template: production -# recursive: yes -# process_children_only: yes - -docker_zfs: - pool: storage - name: docker - properties: - quota: 15G - -kubelet_zfs: - pool: storage - name: kubelet - properties: - quota: 15G - -kubernetes_version: 1.18.5 -kubernetes_container_runtime: docker -kubernetes_standalone_max_pods: 15 -kubernetes_standalone_pod_cidr: 192.168.255.0/24 -kubernetes_standalone_cni_variant: with-portmap diff --git a/inventory/host_vars/ch-k8s-m0.yml b/inventory/host_vars/ch-k8s-m0.yml deleted file mode 100644 index 7d81b792..00000000 --- a/inventory/host_vars/ch-k8s-m0.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -install: - vm: - memory: 4G - numcpus: 2 - autostart: True - disks: - primary: /dev/sda - scsi: - sda: - type: zfs - name: root - size: 20g - properties: - refreservation: none - interfaces: - - bridge: br-public - name: primary0 - -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.prefix | ipaddr(vm_host.network.bridges.public.offsets[vm_host.name]) | ipaddr('address') }}" - overlay: "{{ (vm_host.network.bridges.public.overlay.prefix | ipaddr(vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}" - interfaces: - - *_network_primary_ - -external_ip: "{{ network.primary.overlay }}" - -docker_lvm: - vg: "{{ host_name }}" - lv: docker - size: 7G - fs: ext4 - -kubelet_lvm: - vg: "{{ host_name }}" - lv: kubelet - size: 5G - fs: ext4 diff --git a/inventory/host_vars/ch-k8s-m1.yml b/inventory/host_vars/ch-k8s-m1.yml deleted file mode 100644 index 7d81b792..00000000 --- a/inventory/host_vars/ch-k8s-m1.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -install: - vm: - memory: 4G - numcpus: 2 - autostart: True - disks: - primary: /dev/sda - scsi: - sda: - type: zfs - name: root - size: 20g - properties: - refreservation: none - interfaces: - - bridge: br-public - name: primary0 - -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.prefix | ipaddr(vm_host.network.bridges.public.offsets[vm_host.name]) | ipaddr('address') }}" - overlay: "{{ (vm_host.network.bridges.public.overlay.prefix | ipaddr(vm_host.network.bridges.public.overlay.offsets[inventory_hostname])).split('/')[0] }}" - interfaces: - - *_network_primary_ - -external_ip: "{{ network.primary.overlay }}" - -docker_lvm: - vg: "{{ host_name }}" - lv: docker - size: 7G - fs: ext4 - -kubelet_lvm: - vg: "{{ host_name }}" - lv: kubelet - size: 5G - fs: ext4 diff --git a/inventory/host_vars/ch-k8s-m2.yml b/inventory/host_vars/ch-k8s-m2.yml deleted file mode 100644 index 6de6fbfb..00000000 --- a/inventory/host_vars/ch-k8s-m2.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -install: - vm: - memory: 4G - numcpus: 2 - autostart: True - disks: - primary: /dev/sda - scsi: - sda: - type: zfs - name: root - size: 20g - properties: - refreservation: none - interfaces: - - bridge: br-public - name: primary0 - -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.prefix | ipaddr(vm_host.network.bridges.public.offsets[vm_host.name]) | ipaddr('address') }}" - interfaces: - - *_network_primary_ - - -docker_lvm: - vg: "{{ host_name }}" - lv: docker - size: 7G - fs: ext4 - -kubelet_lvm: - vg: "{{ host_name }}" - lv: kubelet - size: 5G - fs: ext4 diff --git a/inventory/host_vars/ch-k8s-w0.yml b/inventory/host_vars/ch-k8s-w0.yml deleted file mode 100644 index 51095a86..00000000 --- a/inventory/host_vars/ch-k8s-w0.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -install: - vm: - memory: 4G - numcpus: 4 - autostart: True - disks: - primary: /dev/sda - scsi: - sda: - type: zfs - name: root - size: 100g - properties: - refreservation: none - interfaces: - - bridge: br-public - name: primary0 - -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.prefix | ipaddr(vm_host.network.bridges.public.offsets[vm_host.name]) | ipaddr('address') }}" - interfaces: - - *_network_primary_ - - -docker_lvm: - vg: "{{ host_name }}" - lv: docker - size: 15G - fs: ext4 - -kubelet_lvm: - vg: "{{ host_name }}" - lv: kubelet - size: 15G - fs: ext4 diff --git a/inventory/host_vars/ch-k8s-w1.yml b/inventory/host_vars/ch-k8s-w1.yml deleted file mode 100644 index 51095a86..00000000 --- a/inventory/host_vars/ch-k8s-w1.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -install: - vm: - memory: 4G - numcpus: 4 - autostart: True - disks: - primary: /dev/sda - scsi: - sda: - type: zfs - name: root - size: 100g - properties: - refreservation: none - interfaces: - - bridge: br-public - name: primary0 - -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.prefix | ipaddr(vm_host.network.bridges.public.offsets[vm_host.name]) | ipaddr('address') }}" - interfaces: - - *_network_primary_ - - -docker_lvm: - vg: "{{ host_name }}" - lv: docker - size: 15G - fs: ext4 - -kubelet_lvm: - vg: "{{ host_name }}" - lv: kubelet - size: 15G - fs: ext4 -- cgit v1.2.3 From a1f5550dd6de108f68ea3d6b2a42fe47b49561a4 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 4 Jul 2020 17:39:00 +0200 Subject: cloud install: support custom partition layout --- inventory/group_vars/emc/main.yml | 2 -- inventory/group_vars/lendwirbel-live/main.yml | 2 -- inventory/host_vars/ch-hcloudtest.yml | 21 +++++++++++++++++++++ inventory/host_vars/ch-mimas2.yml | 2 -- inventory/host_vars/ch-oulu.yml | 3 ++- inventory/host_vars/ele-lt.yml | 2 -- inventory/host_vars/sk-2019.yml | 3 ++- inventory/host_vars/sk-2019vm.yml | 3 ++- inventory/host_vars/sk-cloudia/vars.yml | 3 ++- inventory/host_vars/sk-tomnext.yml | 3 ++- inventory/hosts.ini | 4 +--- roles/cloud/install/defaults/main.yml | 21 +++++++++++++++++++++ .../install/templates/hetzner_installimage.conf.j2 | 14 ++++++++------ .../cloud/install/templates/hetzner_postinst.sh.j2 | 10 ++++++++-- 14 files changed, 69 insertions(+), 24 deletions(-) create mode 100644 inventory/host_vars/ch-hcloudtest.yml create mode 100644 roles/cloud/install/defaults/main.yml (limited to 'inventory/host_vars') diff --git a/inventory/group_vars/emc/main.yml b/inventory/group_vars/emc/main.yml index 02a2e25c..42515184 100644 --- a/inventory/group_vars/emc/main.yml +++ b/inventory/group_vars/emc/main.yml @@ -5,8 +5,6 @@ install: cloud: credentials: token: "{{ vault_hcloud_api_token }}" - disks: - root_lvm_size: all network: {} diff --git a/inventory/group_vars/lendwirbel-live/main.yml b/inventory/group_vars/lendwirbel-live/main.yml index 43823233..37d3ec1a 100644 --- a/inventory/group_vars/lendwirbel-live/main.yml +++ b/inventory/group_vars/lendwirbel-live/main.yml @@ -12,8 +12,6 @@ install: cloud: credentials: token: "{{ vault_hcloud_api_token }}" - disks: - root_lvm_size: all network: {} diff --git a/inventory/host_vars/ch-hcloudtest.yml b/inventory/host_vars/ch-hcloudtest.yml new file mode 100644 index 00000000..0a2ca334 --- /dev/null +++ b/inventory/host_vars/ch-hcloudtest.yml @@ -0,0 +1,21 @@ +--- +install: + cloud: + credentials: + token: "{{ vault_hcloud_api_token }}" + server_name: "{{ host_name }}" + system_lvm: + size: 13G + volumes: + - name: root + size: 7G + filesystem: ext4 + mountpoint: / + - name: srv + size: 1G + filesystem: ext4 + mountpoint: /srv + mount_options: + - ro + +network: {} diff --git a/inventory/host_vars/ch-mimas2.yml b/inventory/host_vars/ch-mimas2.yml index 46fc78d2..49973cd1 100644 --- a/inventory/host_vars/ch-mimas2.yml +++ b/inventory/host_vars/ch-mimas2.yml @@ -4,8 +4,6 @@ install: credentials: token: "{{ vault_hcloud_api_token }}" server_name: "{{ host_name }}" - disks: - root_lvm_size: all network: {} diff --git a/inventory/host_vars/ch-oulu.yml b/inventory/host_vars/ch-oulu.yml index d0d035d2..e63e6f2d 100644 --- a/inventory/host_vars/ch-oulu.yml +++ b/inventory/host_vars/ch-oulu.yml @@ -2,13 +2,14 @@ install: efi: true disks: - root_lvm_size: 15G primary: software-raid raid: level: 1 members: - /dev/disk/by-id/nvme-Samsung_SSD_970_PRO_1TB_S462NF0M800161Z - /dev/disk/by-id/nvme-Samsung_SSD_970_PRO_1TB_S462NF0M800191M + system_lvm: + size: 15G network: nameservers: diff --git a/inventory/host_vars/ele-lt.yml b/inventory/host_vars/ele-lt.yml index 5ef66f54..1bfcf901 100644 --- a/inventory/host_vars/ele-lt.yml +++ b/inventory/host_vars/ele-lt.yml @@ -3,8 +3,6 @@ install: cloud: credentials: token: "{{ vault_hcloud_api_token }}" - disks: - root_lvm_size: all network: {} diff --git a/inventory/host_vars/sk-2019.yml b/inventory/host_vars/sk-2019.yml index 353fe8c1..23dbbc15 100644 --- a/inventory/host_vars/sk-2019.yml +++ b/inventory/host_vars/sk-2019.yml @@ -10,7 +10,8 @@ install: members: - /dev/nvme0n1 - /dev/nvme1n1 - root_lvm_size: 20G + system_lvm: + size: 20G network: {} diff --git a/inventory/host_vars/sk-2019vm.yml b/inventory/host_vars/sk-2019vm.yml index e989d37e..a131189c 100644 --- a/inventory/host_vars/sk-2019vm.yml +++ b/inventory/host_vars/sk-2019vm.yml @@ -10,7 +10,8 @@ install: members: - /dev/nvme0n1 - /dev/nvme1n1 - root_lvm_size: 10G + system_lvm: + size: 10G network: nameservers: "{{ vm_host.network.dns }}" diff --git a/inventory/host_vars/sk-cloudia/vars.yml b/inventory/host_vars/sk-cloudia/vars.yml index f8167017..0e4e1340 100644 --- a/inventory/host_vars/sk-cloudia/vars.yml +++ b/inventory/host_vars/sk-cloudia/vars.yml @@ -10,7 +10,8 @@ install: members: - /dev/nvme0n1 - /dev/nvme1n1 - root_lvm_size: 15G + system_lvm: + size: 15G network: {} diff --git a/inventory/host_vars/sk-tomnext.yml b/inventory/host_vars/sk-tomnext.yml index 3702bd54..410a1d29 100644 --- a/inventory/host_vars/sk-tomnext.yml +++ b/inventory/host_vars/sk-tomnext.yml @@ -10,7 +10,8 @@ install: members: - /dev/nvme0n1 - /dev/nvme1n1 - root_lvm_size: 10G + system_lvm: + size: 10G network: nameservers: "{{ vm_host.network.dns }}" diff --git a/inventory/hosts.ini b/inventory/hosts.ini index 28fa65d3..751c55a6 100644 --- a/inventory/hosts.ini +++ b/inventory/hosts.ini @@ -25,14 +25,13 @@ ch-router-obsd host_name=router 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-hclouttest host_name=hcloud-test +ch-hcloudtest host_name=hcloud-test ch-oulu host_name=oulu host_domain=helsinki.at [chaos-at-home:children] mz-chaos-at-home chaos-at-home-switches chaos-at-home-ap -chaos-at-home-k8s [mz-chaos-at-home] mz-router ansible_host=chmz-router @@ -326,7 +325,6 @@ k8s-emc [kubernetes-cluster:children] k8s-emc k8s-lwl -k8s-chtest [standalone-kubelet] sk-cloudia diff --git a/roles/cloud/install/defaults/main.yml b/roles/cloud/install/defaults/main.yml new file mode 100644 index 00000000..975400a5 --- /dev/null +++ b/roles/cloud/install/defaults/main.yml @@ -0,0 +1,21 @@ +--- +hetzner_boot_size: 512M + +hetzner_system_lvm_size_default: all +hetzner_system_lvm_volumes_default: + - name: root + size: 2560M + filesystem: ext4 + mountpoint: / + - name: var + size: 1280M + filesystem: ext4 + mountpoint: /var + - name: var+log + size: 768M + filesystem: ext4 + mountpoint: /var/log + mount_options: + - noatime + - nodev + - noexec diff --git a/roles/cloud/install/templates/hetzner_installimage.conf.j2 b/roles/cloud/install/templates/hetzner_installimage.conf.j2 index ed22f286..e3cd4c4e 100644 --- a/roles/cloud/install/templates/hetzner_installimage.conf.j2 +++ b/roles/cloud/install/templates/hetzner_installimage.conf.j2 @@ -13,12 +13,14 @@ DRIVE1 {{ install_cooked.disks.primary }} DRIVE1 /dev/sda {% endif %} BOOTLOADER grub -PART /boot ext4 512M -PART lvm {{ host_name }} {{ install_cooked.disks.root_lvm_size }} -{% if install_cooked.disks.root_lvm_size != "all" %} +PART /boot ext4 {{ hetzner_boot_size }} +{% set system_lvm_size = install_cooked.system_lvm.size | default(hetzner_system_lvm_size_default) %} +PART lvm {{ host_name }} {{ system_lvm_size }} +{% if system_lvm_size != "all" %} PART /dummy ext4 all {% endif %} -LV {{ host_name }} root / ext4 2560M -LV {{ host_name }} var /var ext4 1280M -LV {{ host_name }} var+log /var/log ext4 768M +{% set system_lvm_volumes = install_cooked.system_lvm.volumes | default(hetzner_system_lvm_volumes_default) %} +{% for volume in system_lvm_volumes %} +LV {{ host_name }} {{ volume.name }} {{ volume.mountpoint }} {{ volume.filesystem }} {{ volume.size }} +{% endfor %} IMAGE {{ latest_image.stdout }} diff --git a/roles/cloud/install/templates/hetzner_postinst.sh.j2 b/roles/cloud/install/templates/hetzner_postinst.sh.j2 index 613f57ac..d9de15c9 100644 --- a/roles/cloud/install/templates/hetzner_postinst.sh.j2 +++ b/roles/cloud/install/templates/hetzner_postinst.sh.j2 @@ -27,7 +27,12 @@ passwd -d root && passwd -l root {% if install_distro == "debian" %} sed -e 's/^allow-hotplug/auto/' -i /etc/network/interfaces {% endif %} -sed -r 's#(\s+/var/log\s+ext4\s+)defaults#\1noatime,nodev,noexec#g' -i /etc/fstab +{% set system_lvm_volumes = install_cooked.system_lvm.volumes | default(hetzner_system_lvm_volumes_default) %} +{% for volume in system_lvm_volumes %} +{% if 'mount_options' in volume %} +sed -r 's#(\s+{{ volume.mountpoint }}\s+{{ volume.filesystem }}\s+)defaults#\1{{ volume.mount_options | join(",") }}#g' -i /etc/fstab +{% endif %} +{% endfor %} mkdir -p -m 0700 /target/root/.ssh cat < /root/.ssh/authorized_keys @@ -42,7 +47,8 @@ swapoff -a sed -e '/^\/swapfile/d' -i /etc/fstab rm -f /swapfile -{% if install_cooked.disks.root_lvm_size != "all" %} +{% set system_lvm_size = install_cooked.system_lvm.size | default('all') %} +{% if system_lvm_size != "all" %} sed -e '/\/dummy/d' -i /etc/fstab cat > /post-install-finalize < Date: Sat, 4 Jul 2020 17:55:08 +0200 Subject: remove ch-hcloudtest --- inventory/host_vars/ch-hcloudtest.yml | 21 --------------------- inventory/hosts.ini | 2 -- 2 files changed, 23 deletions(-) delete mode 100644 inventory/host_vars/ch-hcloudtest.yml (limited to 'inventory/host_vars') diff --git a/inventory/host_vars/ch-hcloudtest.yml b/inventory/host_vars/ch-hcloudtest.yml deleted file mode 100644 index 0a2ca334..00000000 --- a/inventory/host_vars/ch-hcloudtest.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -install: - cloud: - credentials: - token: "{{ vault_hcloud_api_token }}" - server_name: "{{ host_name }}" - system_lvm: - size: 13G - volumes: - - name: root - size: 7G - filesystem: ext4 - mountpoint: / - - name: srv - size: 1G - filesystem: ext4 - mountpoint: /srv - mount_options: - - ro - -network: {} diff --git a/inventory/hosts.ini b/inventory/hosts.ini index 751c55a6..5d19bee4 100644 --- a/inventory/hosts.ini +++ b/inventory/hosts.ini @@ -25,7 +25,6 @@ ch-router-obsd host_name=router 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-hcloudtest host_name=hcloud-test ch-oulu host_name=oulu host_domain=helsinki.at [chaos-at-home:children] @@ -276,7 +275,6 @@ sk-tomnext [hcloud] ch-mimas2 ele-lt -ch-hcloudtest [hcloud:children] emc-dist -- cgit v1.2.3 From 5d6b44058a8d907fbc64865c0be4d298e0e55a82 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 4 Jul 2020 23:25:51 +0200 Subject: install/preseed: convert old host configs to new partman layout --- inventory/host_vars/ch-equinox-ws.yml | 18 ++++++ inventory/host_vars/ele-telesto.yml | 25 +++++++- inventory/host_vars/lw-telesto.yml | 25 +++++++- .../templates/preseed_xubuntu-focal-desktop.cfg.j2 | 73 +--------------------- 4 files changed, 65 insertions(+), 76 deletions(-) (limited to 'inventory/host_vars') diff --git a/inventory/host_vars/ch-equinox-ws.yml b/inventory/host_vars/ch-equinox-ws.yml index d71f38d8..84ca3962 100644 --- a/inventory/host_vars/ch-equinox-ws.yml +++ b/inventory/host_vars/ch-equinox-ws.yml @@ -5,6 +5,24 @@ install: efi: true disks: primary: /dev/disk/by-id/nvme-Samsung_SSD_970_PRO_1TB_S462NF0MA04112K + system_lvm: + volumes: + - name: root + size: 30G + filesystem: ext4 + mountpoint: / + - name: var+log + size: 768M + filesystem: ext4 + mountpoint: /var/log + mount_options: + - noatime + - nodev + - noexec + - name: home + size: 200G + filesystem: ext4 + mountpoint: /home network: nameservers: "{{ network_zones.lan.dns }}" diff --git a/inventory/host_vars/ele-telesto.yml b/inventory/host_vars/ele-telesto.yml index a8b2b162..8fe1376d 100644 --- a/inventory/host_vars/ele-telesto.yml +++ b/inventory/host_vars/ele-telesto.yml @@ -1,9 +1,30 @@ --- base_modules_blacklist: "{{ base_modules_blacklist_all_but_sound }}" -preseed_template_name: "xubuntu-eoan-desktop-with-raid" +preseed_template_name: "xubuntu-focal-desktop" -install: {} +install: + disks: + primary: software-raid + raid: + level: 1 + members: + - /dev/sda + - /dev/sdb + system_lvm: + volumes: + - name: root + size: 20G + filesystem: ext4 + mountpoint: / + - name: var+log + size: 768M + filesystem: ext4 + mountpoint: /var/log + mount_options: + - noatime + - nodev + - noexec network: nameservers: "{{ network_zones.lan.dns }}" diff --git a/inventory/host_vars/lw-telesto.yml b/inventory/host_vars/lw-telesto.yml index 4a10338e..a225d787 100644 --- a/inventory/host_vars/lw-telesto.yml +++ b/inventory/host_vars/lw-telesto.yml @@ -1,9 +1,30 @@ --- base_modules_blacklist: "{{ base_modules_blacklist_all_but_sound }}" -preseed_template_name: "xubuntu-eoan-desktop-with-raid" +preseed_template_name: "xubuntu-focal-desktop" -install: {} +install: + disks: + primary: software-raid + raid: + level: 1 + members: + - /dev/sda + - /dev/sdb + system_lvm: + volumes: + - name: root + size: 20G + filesystem: ext4 + mountpoint: / + - name: var+log + size: 768M + filesystem: ext4 + mountpoint: /var/log + mount_options: + - noatime + - nodev + - noexec network: nameservers: diff --git a/roles/installer/debian/preseed/templates/preseed_xubuntu-focal-desktop.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_xubuntu-focal-desktop.cfg.j2 index eeda9943..2312f2b0 100644 --- a/roles/installer/debian/preseed/templates/preseed_xubuntu-focal-desktop.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_xubuntu-focal-desktop.cfg.j2 @@ -57,78 +57,7 @@ d-i time/zone string Europe/Vienna d-i clock-setup/ntp boolean false -d-i partman/early_command string \ - debconf-set partman-auto/disk "$(readlink -f {{ hostvars[install_hostname].install_cooked.disks.primary }})"; \ - debconf-set grub-installer/bootdev "$(readlink -f {{ hostvars[install_hostname].install_cooked.disks.primary }})"; \ - umount -l /media || true - -d-i partman/confirm boolean true -d-i partman/confirm_nooverwrite boolean true -d-i partman-md/device_remove_md boolean true -d-i partman-md/confirm boolean true -d-i partman-md/confirm_nooverwrite boolean true -d-i partman-lvm/device_remove_lvm boolean true -d-i partman-lvm/confirm boolean true -d-i partman-lvm/confirm_nooverwrite boolean true - -d-i partman-auto/method string lvm -d-i partman-auto/purge_lvm_from_device boolean true -d-i partman-auto-lvm/new_vg_name string {{ hostvars[install_hostname].host_name }} -d-i partman-auto-lvm/guided_size string max -d-i partman-auto-lvm/no_boot boolean true - -{% if (hostvars[install_hostname].install_cooked.efi | default(false)) %} -d-i partman-efi/non_efi_system boolean true -d-i partman/choose_label string gpt -d-i partman/default_label string gpt -{% endif %} -d-i partman-auto/expert_recipe string \ - boot-root :: \ -{% if (hostvars[install_hostname].install_cooked.efi | default(false)) %} - 100 100 128 fat16 \ - $defaultignore{ } $primary{ } $bootable{ } \ - method{ efi } format{ } \ - . \ -{% endif %} - 1000 10000 -1 ext4 \ - $defaultignore{ } $primary{ } $bootable{ } \ - method{ lvm } vg_name{ {{ hostvars[install_hostname].host_name }} } \ - . \ - 15360 10000 20480 ext4 \ - $lvmok{ } in_vg{ {{ hostvars[install_hostname].host_name }} } \ - method{ format } format{ } \ - use_filesystem{ } filesystem{ ext4 } \ - mountpoint{ / } \ - . \ - 768 10000 768 ext4 \ - $lvmok{ } in_vg{ {{ hostvars[install_hostname].host_name }} } \ - method{ format } format{ } \ - use_filesystem{ } filesystem{ ext4 } \ - mountpoint{ /var/log } \ - options/nodev{ nodev } options/noatime{ noatime } \ - options/noexec{ noexec } \ - . \ - 20480 10000 40960 ext4 \ - $lvmok{ } in_vg{ {{ hostvars[install_hostname].host_name }} } \ - method{ format } format{ } \ - use_filesystem{ } filesystem{ ext4 } \ - mountpoint{ /home } \ - . \ - 16 20000 -1 ext4 \ - $lvmok{ } in_vg{ {{ hostvars[install_hostname].host_name }} } \ - lv_name{ dummy } \ - . - -d-i partman-basicfilesystems/no_swap true -d-i partman-partitioning/confirm_write_new_label boolean true -d-i partman/choose_partition select finish - - -## boot devices are configured by partman/early_command -d-i grub-installer/bootdev seen true -d-i grub-installer/choose_bootdev seen true -d-i grub-installer/only_debian boolean true -d-i grub-installer/with_other_os boolean false +{% include 'partman_config.j2' %} d-i base-installer/install-recommends boolean false -- cgit v1.2.3