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 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'roles/installer/debian/preseed/templates/partman_config.j2') 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 %} -- cgit v1.2.3