diff options
author | Christian Pointner <equinox@spreadspace.org> | 2020-07-03 01:52:18 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2020-07-03 01:52:18 +0200 |
commit | 2f00ada542d9ac3c29ce3d6af9a2fad994413d09 (patch) | |
tree | 49a61028f926be5d8b45e9beb9240e06ab6d9c9e | |
parent | another attempt to tackle root_lvm_size issue (diff) |
preseed: software-raid with root_lvm_size works now
-rw-r--r-- | roles/installer/debian/preseed/templates/partman_config.j2 | 14 | ||||
-rw-r--r-- | roles/installer/debian/preseed/templates/partman_early-command.sh.j2 | 6 |
2 files changed, 13 insertions, 7 deletions
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 |