summaryrefslogtreecommitdiff
path: root/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2')
-rw-r--r--roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2100
1 files changed, 93 insertions, 7 deletions
diff --git a/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 b/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2
index 97b54b0a..52eb0d44 100644
--- a/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2
+++ b/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2
@@ -29,19 +29,35 @@ autoinstall:
storage:
config:
+{% if install_cooked.disks.primary != "software-raid" %}
- id: disk-primary
type: disk
path: {{ install_cooked.disks.primary }}
-{% if install_cooked.efi | default(false) %}
+{% if install_cooked.efi | default(false) %}
ptable: gpt
+{% else %}
+ ptable: msdos
+ grub_device: true
+{% endif %}
+ wipe: superblock-recursive
{% else %}
+{% for raid_member in install_cooked.disks.raid.members %}
+ - id: raid-disk{{ loop.index }}
+ type: disk
+ path: {{ raid_member }}
+{% if install_cooked.efi | default(false) %}
+ ptable: gpt
+{% else %}
ptable: msdos
grub_device: true
-{% endif %}
+{% endif %}
wipe: superblock-recursive
+{% endfor %}
+{% endif %}
{% if install_cooked.efi | default(false) %}
{% set part_offset = 1 %}
+{% if install_cooked.disks.primary != "software-raid" %}
- id: partition-esp
type: partition
device: disk-primary
@@ -49,6 +65,25 @@ autoinstall:
number: 1
size: {{ ubuntu_autoinstall_efi_esp_size | human_to_bytes }}
grub_device: true
+{% else %}
+{% for raid_member in install_cooked.disks.raid.members %}
+ - id: raid-partition-esp{{ loop.index }}
+ type: partition
+ device: raid-disk{{ loop.index }}
+ flag: boot
+ number: 1
+ size: {{ ubuntu_autoinstall_efi_esp_size | human_to_bytes }}
+ grub_device: true
+{% endfor %}
+ - id: partition-esp
+ type: raid
+ raidlevel: {{ install_cooked.disks.raid.level }}
+ metadata: 0.90
+ devices:
+{% for raid_member in install_cooked.disks.raid.members %}
+ - raid-partition-esp{{ loop.index }}
+{% endfor %}
+{% endif %}
- id: format-esp
type: format
volume: partition-esp
@@ -61,25 +96,76 @@ autoinstall:
{% else %}
{% set part_offset = 0 %}
+{% endif %}
+{% if install_cooked.disks.primary == "software-raid" %}
+{% for raid_member in install_cooked.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 %}
+ - id: partition-boot
+ type: raid
+ raidlevel: {{ install_cooked.disks.raid.level }}
+ devices:
+{% for raid_member in install_cooked.disks.raid.members %}
+ - raid-partition-boot{{ loop.index }}
+{% endfor %}
+ - id: format-boot
+ type: format
+ volume: partition-boot
+ fstype: ext4
+ - id: mount-boot
+ type: mount
+ device: format-boot
+ path: /boot
+{% set part_offset = part_offset + 1 %}
{% endif %}
{% set system_lvm_size = install_cooked.system_lvm.size | default(ubuntu_autoinstall_system_lvm_size_default) %}
{% set system_lvm_volumes = install_cooked.system_lvm.volumes | default(ubuntu_autoinstall_system_lvm_volumes_default) %}
+{% if install_cooked.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_cooked.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' %}
+ 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 %}
+ size: -1
+{% endfor %}
+ - id: partition-lvm
+ type: raid
+ raidlevel: {{ install_cooked.disks.raid.level }}
+ devices:
+{% for raid_member in install_cooked.disks.raid.members %}
+ - raid-partition-lvm{{ loop.index }}
+{% endfor %}
+
+{% endif %}
- id: lvm-vg-system
type: lvm_volgroup
devices:
@@ -146,9 +232,9 @@ autoinstall:
- curtin in-target --target=/target -- sed -e 's/^\(\s*#*\s*Port.*\)/Port {{ ansible_port }}/' -i /etc/ssh/sshd_config
{% endif %}
- curtin in-target --target=/target -- apt-mark manual iputils-ping isc-dhcp-client netcat-openbsd netplan.io sudo
- - curtin in-target --target=/target -- apt-get -y -q purge policykit-1 multipath-tools ubuntu-minimal unattended-upgrades sound-theme-freedesktop thin-provisioning-tools cryptsetup mdadm byobu open-iscsi btrfs-progs pollinate lxd-agent-loader
-{% if not ubuntu_autoinstall_virtual_machine %}
- - curtin in-target --target=/target -- apt-get -y -q purge open-vm-tools
+ - curtin in-target --target=/target -- apt-get -y -q purge policykit-1 multipath-tools ubuntu-minimal unattended-upgrades sound-theme-freedesktop thin-provisioning-tools cryptsetup byobu open-iscsi btrfs-progs pollinate lxd-agent-loader open-vm-tools
+{% if install_cooked.disks.primary != "software-raid" %}
+ - curtin in-target --target=/target -- apt-get -y -q purge mdadm
{% endif %}
- curtin in-target --target=/target -- env SUDO_FORCE_REMOVE=yes apt-get -y -q purge sudo
- curtin in-target --target=/target -- apt-get -y -q autoremove