summaryrefslogtreecommitdiff
path: root/roles/installer/debian
diff options
context:
space:
mode:
Diffstat (limited to 'roles/installer/debian')
-rw-r--r--roles/installer/debian/preseed/templates/partman_config.j214
-rw-r--r--roles/installer/debian/preseed/templates/partman_early-command.sh.j26
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