From b321a5d57f4b5ca5169f953fd9f39b93b7b21b14 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 25 Sep 2022 15:31:26 +0200 Subject: ch-equinot-t450s on jammy (WIP) --- .../installer/ubuntu/autoinstall/defaults/main.yml | 2 + .../autoinstall/templates/autoinstall.yml.j2 | 96 ++++++++++++---------- 2 files changed, 53 insertions(+), 45 deletions(-) (limited to 'roles/installer/ubuntu') diff --git a/roles/installer/ubuntu/autoinstall/defaults/main.yml b/roles/installer/ubuntu/autoinstall/defaults/main.yml index a470dfac..109ad855 100644 --- a/roles/installer/ubuntu/autoinstall/defaults/main.yml +++ b/roles/installer/ubuntu/autoinstall/defaults/main.yml @@ -13,6 +13,8 @@ ubuntu_autoinstall_virtual_machine: no # ubuntu_autoinstall_desktop: xubuntu +ubuntu_autoinstall_manual_partitioning: no + ubuntu_autoinstall_efi_esp_size: 128M ubuntu_autoinstall_swraid_boot_size: 256M diff --git a/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 b/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 index 496363a9..1dfd44db 100644 --- a/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 +++ b/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 @@ -27,37 +27,42 @@ autoinstall: {% endif %} {% endif %} +{% if ubuntu_autoinstall_manual_partitioning %} + interactive-sections: + - storage + +{% else %} storage: config: -{% if install.disks.primary != "software-raid" %} +{% if install.disks.primary != "software-raid" %} - id: disk-primary type: disk path: {{ install.disks.primary }} -{% if install.efi | default(false) %} +{% if install.efi | default(false) %} ptable: gpt -{% else %} +{% else %} ptable: msdos grub_device: true -{% endif %} +{% endif %} wipe: superblock-recursive -{% else %} -{% for raid_member in install.disks.raid.members %} +{% else %} +{% for raid_member in install.disks.raid.members %} - id: raid-disk{{ loop.index }} type: disk path: {{ raid_member }} -{% if install.efi | default(false) %} +{% if install.efi | default(false) %} ptable: gpt -{% else %} +{% else %} ptable: msdos grub_device: true -{% endif %} +{% endif %} wipe: superblock-recursive -{% endfor %} -{% endif %} +{% endfor %} +{% endif %} -{% if install.efi | default(false) %} -{% set part_offset = 1 %} -{% if install.disks.primary != "software-raid" %} +{% if install.efi | default(false) %} +{% set part_offset = 1 %} +{% if install.disks.primary != "software-raid" %} - id: partition-esp type: partition device: disk-primary @@ -74,8 +79,8 @@ autoinstall: type: mount device: format-esp path: /boot/efi -{% else %} -{% for raid_member in install.disks.raid.members %} +{% else %} +{% for raid_member in install.disks.raid.members %} - id: partition-esp{{ loop.index }} type: partition device: raid-disk{{ loop.index }} @@ -92,28 +97,28 @@ autoinstall: type: mount device: format-esp{{ loop.index }} path: /boot/efi -{% endfor %} -{% endif %} +{% endfor %} +{% endif %} -{% else %} -{% set part_offset = 0 %} -{% endif %} -{% if install.disks.primary == "software-raid" %} -{% for raid_member in install.disks.raid.members %} +{% else %} +{% set part_offset = 0 %} +{% endif %} +{% if install.disks.primary == "software-raid" %} +{% for raid_member in install.disks.raid.members %} - id: raid-partition-boot{{ loop.index }} type: partition device: raid-disk{{ loop.index }} number: {{ part_offset + 1 }} size: {{ ubuntu_autoinstall_swraid_boot_size | human_to_bytes }} -{% endfor %} +{% endfor %} - id: partition-boot type: raid name: md-boot raidlevel: {{ install.disks.raid.level }} devices: -{% for raid_member in install.disks.raid.members %} +{% for raid_member in install.disks.raid.members %} - raid-partition-boot{{ loop.index }} -{% endfor %} +{% endfor %} - id: format-boot type: format volume: partition-boot @@ -122,60 +127,60 @@ autoinstall: type: mount device: format-boot path: /boot -{% set part_offset = part_offset + 1 %} +{% set part_offset = part_offset + 1 %} -{% endif %} -{% set system_lvm_size = install.system_lvm.size | default(ubuntu_autoinstall_system_lvm_size_default) %} -{% set system_lvm_volumes = install.system_lvm.volumes | default(ubuntu_autoinstall_system_lvm_volumes_default) %} -{% if install.disks.primary != "software-raid" %} +{% endif %} +{% set system_lvm_size = install.system_lvm.size | default(ubuntu_autoinstall_system_lvm_size_default) %} +{% set system_lvm_volumes = install.system_lvm.volumes | default(ubuntu_autoinstall_system_lvm_volumes_default) %} +{% if install.disks.primary != "software-raid" %} - id: partition-lvm type: partition device: disk-primary flag: linux number: {{ part_offset + 1 }} -{% if system_lvm_size != 'all' %} +{% if system_lvm_size != 'all' %} size: {{ system_lvm_size | human_to_bytes }} - id: partition-unused type: partition device: disk-primary flag: linux number: {{ part_offset + 2 }} -{% endif %} +{% endif %} size: -1 -{% else %} -{% for raid_member in install.disks.raid.members %} +{% else %} +{% for raid_member in install.disks.raid.members %} - id: raid-partition-lvm{{ loop.index }} type: partition device: raid-disk{{ loop.index }} number: {{ part_offset + 1 }} -{% if system_lvm_size != 'all' %} +{% if system_lvm_size != 'all' %} size: {{ system_lvm_size | human_to_bytes }} - id: raid-partition-unused{{ loop.index }} type: partition device: raid-disk{{ loop.index }} flag: linux number: {{ part_offset + 2 }} -{% endif %} +{% endif %} size: -1 -{% endfor %} +{% endfor %} - id: partition-lvm type: raid name: md-lvm raidlevel: {{ install.disks.raid.level }} devices: -{% for raid_member in install.disks.raid.members %} +{% for raid_member in install.disks.raid.members %} - raid-partition-lvm{{ loop.index }} -{% endfor %} +{% endfor %} -{% endif %} +{% endif %} - id: lvm-vg-system type: lvm_volgroup devices: - partition-lvm name: {{ host_name }} -{% for volume in system_lvm_volumes %} +{% for volume in system_lvm_volumes %} - id: lvm-lv-{{ volume.name }} type: lvm_partition volgroup: lvm-vg-system @@ -189,11 +194,12 @@ autoinstall: type: mount device: format-{{ volume.name }} path: {{ volume.mountpoint }} -{% if 'mount_options' in volume and (volume.mount_options | length) > 0 %} +{% if 'mount_options' in volume and (volume.mount_options | length) > 0 %} options: '{{ volume.mount_options | join(",") }}' -{% endif %} +{% endif %} -{% endfor %} +{% endfor %} +{% endif %} apt: primary: - uri: http://{{ apt_repo_providers[apt_repo_provider].ubuntu.host }}{{ apt_repo_providers[apt_repo_provider].ubuntu.path }} -- cgit v1.2.3