summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-06-28 13:39:15 +0200
committerChristian Pointner <equinox@spreadspace.org>2020-07-01 11:37:40 +0200
commit6ab537c997cf1bee0071f2d2c823793717444cfe (patch)
tree4da1d699e20979e5cd6ffda95a76c46aec633e90
parentpreseed: move partman config to common template (diff)
extract parman config from all pressed files
-rw-r--r--roles/installer/debian/preseed/templates/partman_raid_config.j268
-rw-r--r--roles/installer/debian/preseed/templates/partman_ws_config.j265
-rw-r--r--roles/installer/debian/preseed/templates/preseed_debian-buster-with-raid.cfg.j275
-rw-r--r--roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j22
-rw-r--r--roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j22
-rw-r--r--roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j22
-rw-r--r--roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j22
-rw-r--r--roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j22
-rw-r--r--roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j22
-rw-r--r--roles/installer/debian/preseed/templates/preseed_xubuntu-focal-desktop.cfg.j268
10 files changed, 147 insertions, 141 deletions
diff --git a/roles/installer/debian/preseed/templates/partman_raid_config.j2 b/roles/installer/debian/preseed/templates/partman_raid_config.j2
new file mode 100644
index 00000000..866b3b9f
--- /dev/null
+++ b/roles/installer/debian/preseed/templates/partman_raid_config.j2
@@ -0,0 +1,68 @@
+d-i partman-auto/disk string /dev/sda /dev/sdb
+d-i grub-installer/bootdev string /dev/sda /dev/sdb
+
+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 raid
+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/choose_label string dos
+d-i partman/default_label string dos
+d-i partman-auto/choose_recipe select boot-root
+d-i partman-auto/expert_recipe string \
+ boot-root :: \
+ 256 512 256 raid \
+ $lvmignore{ } $primary{ } method{ raid } \
+ . \
+ 1000 10000 -1 raid \
+ $lvmignore{ } $primary{ } method{ raid } \
+ . \
+ 15360 10000 20480 ext4 \
+ $defaultignore{ } $lvmok{ } \
+ in_vg{ {{ hostvars[install_hostname].host_name }} } \
+ method{ format } format{ } \
+ use_filesystem{ } filesystem{ ext4 } \
+ mountpoint{ / } \
+ . \
+ 768 10000 768 ext4 \
+ $defaultignore{ } $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 20480 ext4 \
+ $defaultignore{ } $lvmok{ } \
+ in_vg{ {{ hostvars[install_hostname].host_name }} } \
+ method{ format } format{ } \
+ use_filesystem{ } filesystem{ ext4 } \
+ mountpoint{ /home } \
+ . \
+ 16 20000 -1 ext4 \
+ $defaultignore{ } $lvmok{ } \
+ in_vg{ {{ hostvars[install_hostname].host_name }} } \
+ lv_name{ dummy } \
+ .
+
+d-i partman-auto-raid/recipe string \
+ 1 2 0 ext4 /boot \
+ /dev/sda1#/dev/sdb1 \
+ . \
+ 1 2 0 lvm - \
+ /dev/sda2#/dev/sdb2 \
+ .
+
+d-i partman-basicfilesystems/no_swap true
+d-i partman-partitioning/confirm_write_new_label boolean true
+d-i partman/choose_partition select finish
diff --git a/roles/installer/debian/preseed/templates/partman_ws_config.j2 b/roles/installer/debian/preseed/templates/partman_ws_config.j2
new file mode 100644
index 00000000..88b3f1ec
--- /dev/null
+++ b/roles/installer/debian/preseed/templates/partman_ws_config.j2
@@ -0,0 +1,65 @@
+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
diff --git a/roles/installer/debian/preseed/templates/preseed_debian-buster-with-raid.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-buster-with-raid.cfg.j2
index 7b7cfd27..17419ce3 100644
--- a/roles/installer/debian/preseed/templates/preseed_debian-buster-with-raid.cfg.j2
+++ b/roles/installer/debian/preseed/templates/preseed_debian-buster-with-raid.cfg.j2
@@ -45,73 +45,8 @@ d-i clock-setup/utc boolean true
d-i time/zone string Europe/Vienna
d-i clock-setup/ntp boolean false
-d-i partman-auto/disk string /dev/sda /dev/sdb
-
-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 raid
-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/choose_label string dos
-d-i partman/default_label string dos
-d-i partman-auto/choose_recipe select boot-root
-d-i partman-auto/expert_recipe string \
- boot-root :: \
- 256 512 256 raid \
- $lvmignore{ } $primary{ } method{ raid } \
- . \
- 1000 10000 -1 raid \
- $lvmignore{ } $primary{ } method{ raid } \
- . \
- 15360 10000 20480 ext4 \
- $defaultignore{ } $lvmok{ } \
- in_vg{ {{ hostvars[install_hostname].host_name }} } \
- method{ format } format{ } \
- use_filesystem{ } filesystem{ ext4 } \
- mountpoint{ / } \
- . \
- 768 10000 768 ext4 \
- $defaultignore{ } $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 20480 ext4 \
- $defaultignore{ } $lvmok{ } \
- in_vg{ {{ hostvars[install_hostname].host_name }} } \
- method{ format } format{ } \
- use_filesystem{ } filesystem{ ext4 } \
- mountpoint{ /home } \
- . \
- 16 20000 -1 ext4 \
- $defaultignore{ } $lvmok{ } \
- in_vg{ {{ hostvars[install_hostname].host_name }} } \
- lv_name{ dummy } \
- .
-
-d-i partman-auto-raid/recipe string \
- 1 2 0 ext4 /boot \
- /dev/sda1#/dev/sdb1 \
- . \
- 1 2 0 lvm - \
- /dev/sda2#/dev/sdb2 \
- .
-
-d-i partman-basicfilesystems/no_swap true
-d-i partman-partitioning/confirm_write_new_label boolean true
-d-i partman/choose_partition select finish
+
+{% include 'partman_raid_config.j2' %}
d-i base-installer/install-recommends boolean false
@@ -122,8 +57,10 @@ d-i pkgsel/include string openssh-server python python-apt
d-i pkgsel/upgrade select safe-upgrade
popularity-contest popularity-contest/participate boolean false
-d-i grub-installer/choose_bootdev string /dev/sda /dev/sdb
-d-i grub-installer/bootdev string /dev/sda /dev/sdb
+
+## grub-installer/bootdev is set by partman/early_command
+d-i grub-installer/bootdev seen true
+d-i grub-installer/choose_bootdev string manual
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean false
diff --git a/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2
index 965f3ff5..8b740eef 100644
--- a/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2
+++ b/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2
@@ -58,7 +58,7 @@ d-i pkgsel/upgrade select safe-upgrade
popularity-contest popularity-contest/participate boolean false
-## grub-installer/bootdev is set by early_command
+## grub-installer/bootdev is set by partman/early_command
d-i grub-installer/bootdev seen true
d-i grub-installer/choose_bootdev string manual
d-i grub-installer/only_debian boolean true
diff --git a/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2
index 2ef63b9e..590914a7 100644
--- a/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2
+++ b/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2
@@ -58,7 +58,7 @@ d-i pkgsel/upgrade select safe-upgrade
popularity-contest popularity-contest/participate boolean false
-## grub-installer/bootdev is set by early_command
+## grub-installer/bootdev is set by partman/early_command
d-i grub-installer/bootdev seen true
d-i grub-installer/choose_bootdev string manual
d-i grub-installer/only_debian boolean true
diff --git a/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2
index e751735c..02902b77 100644
--- a/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2
+++ b/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2
@@ -58,7 +58,7 @@ d-i pkgsel/upgrade select safe-upgrade
popularity-contest popularity-contest/participate boolean false
-## grub-installer/bootdev is set by early_command
+## grub-installer/bootdev is set by partman/early_command
d-i grub-installer/bootdev seen true
d-i grub-installer/choose_bootdev string manual
d-i grub-installer/only_debian boolean true
diff --git a/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2
index 41d38ff8..e80d38ae 100644
--- a/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2
+++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2
@@ -67,7 +67,7 @@ popularity-contest popularity-contest/participate boolean false
d-i pkgsel/update-policy select none
-## grub-installer/bootdev is set by early_command
+## grub-installer/bootdev is set by partman/early_command
d-i grub-installer/bootdev seen true
d-i grub-installer/choose_bootdev string manual
d-i grub-installer/only_debian boolean true
diff --git a/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2
index f65b3145..8442cd31 100644
--- a/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2
+++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2
@@ -67,7 +67,7 @@ popularity-contest popularity-contest/participate boolean false
d-i pkgsel/update-policy select none
-## grub-installer/bootdev is set by early_command
+## grub-installer/bootdev is set by partman/early_command
d-i grub-installer/bootdev seen true
d-i grub-installer/choose_bootdev string manual
d-i grub-installer/only_debian boolean true
diff --git a/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2
index 6990cc55..d4ca1b30 100644
--- a/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2
+++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2
@@ -64,7 +64,7 @@ popularity-contest popularity-contest/participate boolean false
d-i pkgsel/update-policy select none
-## grub-installer/bootdev is set by early_command
+## grub-installer/bootdev is set by partman/early_command
d-i grub-installer/bootdev seen true
d-i grub-installer/choose_bootdev string manual
d-i grub-installer/only_debian boolean true
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 dd066085..d3295872 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,71 +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
+{% include 'partman_ws_config.j2' %}
d-i base-installer/install-recommends boolean false
@@ -134,7 +70,7 @@ popularity-contest popularity-contest/participate boolean false
d-i pkgsel/update-policy select none
-## grub-installer/bootdev is set by early_command
+## grub-installer/bootdev is set by partman/early_command
d-i grub-installer/bootdev seen true
d-i grub-installer/choose_bootdev string manual
d-i grub-installer/only_debian boolean true