From 2f00ada542d9ac3c29ce3d6af9a2fad994413d09 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 3 Jul 2020 01:52:18 +0200 Subject: preseed: software-raid with root_lvm_size works now --- roles/installer/debian/preseed/templates/partman_config.j2 | 14 +++++++++++++- .../debian/preseed/templates/partman_early-command.sh.j2 | 6 ------ 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'roles/installer/debian/preseed') diff --git a/roles/installer/debian/preseed/templates/partman_config.j2 b/roles/installer/debian/preseed/templates/partman_config.j2 index 88b6a088..ca6feb41 100644 --- a/roles/installer/debian/preseed/templates/partman_config.j2 +++ b/roles/installer/debian/preseed/templates/partman_config.j2 @@ -52,10 +52,22 @@ d-i partman-auto/expert_recipe string $lvmignore{ } $primary{ } $bootable{ } \ method{ raid } \ . \ - 10240 10340 -1 raid \ +{% if 'root_lvm_size' in hostvars[install_hostname].install_cooked.disks and hostvars[install_hostname].install_cooked.disks.root_lvm_size != 'all' %} +{% set root_lvm_size = ((hostvars[install_hostname].install_cooked.disks.root_lvm_size | human_to_bytes) / (1024*1024)) | int %} + {{ root_lvm_size }} {{ root_lvm_size }} {{ root_lvm_size }} raid \ $lvmignore{ } $primary{ } \ method{ raid } \ . \ + 8 108 -1 ext4 \ + $lvmignore{ } $primary{ } \ + method{ unused } \ + . \ +{% else %} + 5120 5120 5120 raid \ + $lvmignore{ } $primary{ } \ + method{ raid } \ + . \ +{% endif %} {% else %} {% if 'root_lvm_size' in hostvars[install_hostname].install_cooked.disks and hostvars[install_hostname].install_cooked.disks.root_lvm_size != 'all' %} {% set root_lvm_size = ((hostvars[install_hostname].install_cooked.disks.root_lvm_size | human_to_bytes) / (1024*1024)) | int %} diff --git a/roles/installer/debian/preseed/templates/partman_early-command.sh.j2 b/roles/installer/debian/preseed/templates/partman_early-command.sh.j2 index 6187fbea..9c720e92 100644 --- a/roles/installer/debian/preseed/templates/partman_early-command.sh.j2 +++ b/roles/installer/debian/preseed/templates/partman_early-command.sh.j2 @@ -31,9 +31,3 @@ debconf-set grub-installer/bootdev "$disks" ## https://unix.stackexchange.com/questions/510445/install-grub-bootloader-dynamically-to-multiple-disks . /usr/share/debconf/confmodule db_fset grub-installer/bootdev seen true - - -## wipe existing partition tables, 1M should be enough to get rid of them -for disk in $disks; do - dd if=/dev/zero "of=$disk" bs=32768 count=32 -done -- cgit v1.2.3