diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2024-02-24 23:36:10 -0800 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2024-02-24 23:36:10 -0800 |
commit | e8aa372958b235aacb1d472351fd864dd1826417 (patch) | |
tree | 524242cbd751af912da03f0f66494dd47f14ea8d | |
parent | install_gentoo: split mounts (diff) | |
download | ansible-e8aa372958b235aacb1d472351fd864dd1826417.tar.gz ansible-e8aa372958b235aacb1d472351fd864dd1826417.tar.bz2 ansible-e8aa372958b235aacb1d472351fd864dd1826417.zip |
gentoo_install: tweak to non-LVM rootfs
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r-- | roles/install_gentoo/tasks/disks.yml | 65 | ||||
-rw-r--r-- | roles/install_gentoo/tasks/early-mount.yml | 2 |
2 files changed, 35 insertions, 32 deletions
diff --git a/roles/install_gentoo/tasks/disks.yml b/roles/install_gentoo/tasks/disks.yml index a39aa45..50db3c3 100644 --- a/roles/install_gentoo/tasks/disks.yml +++ b/roles/install_gentoo/tasks/disks.yml @@ -27,12 +27,16 @@ - name: write partition layout file ansible.builtin.copy: dest: /tmp/partition.sfdisk - # RootFS on LVM + # This is a consistent disk layout for all systems, EFI or Legacy + # non-LVM RootFS + # TODO: where should boot be set? EFI vs BIOSBP content: | label: gpt - p1 : start=1MiB, size=63MiB, type=uefi, name=EFI - p2 : start=64MiB, size=448MiB, type=raid, name=BOOT - p3 : start=512MiB, size=+, type=lvm, name=LVM + p1 : start=1MiB, size=1MiB, type=21686148-6449-6E6F-744E-656564454649, name=BIOS + p2 : start=2MiB, size=63MiB, type=uefi, name=EFI + p3 : start=64MiB, size=448MiB, type=raid, name=BOOT + p4 : start=512MiB, size=30GiB, type=raid, name=ROOT + p5 : start=+, size=+, type=lvm, name=LVM tags: - partition @@ -66,37 +70,49 @@ tags: - mdadm - - name: mdadm p1 - ansible.builtin.command: "mdadm --create -e 1.0 /dev/md1 --level=raid1 -n 2 {{ md1_dev }}" - tags: - - mdadm - - name: mdadm p2 ansible.builtin.command: "mdadm --create -e 1.0 /dev/md2 --level=raid1 -n 2 {{ md2_dev }}" tags: - mdadm + + - name: mdadm p3 + ansible.builtin.command: "mdadm --create -e 1.0 /dev/md3 --level=raid1 -n 2 {{ md3_dev }}" + tags: + - mdadm + + - name: mdadm p4 + ansible.builtin.command: "mdadm --create -e 1.0 /dev/md4 --level=raid1 -n 2 {{ md4_dev }}" + tags: + - mdadm - - name: format p1/mkfs + - name: format p2/mkfs ansible.builtin.command: "mkfs.fat -F 16 -n EFI {{ item }}" tags: - mkfs loop: - - /dev/md1 + - /dev/md2 - - name: format p2/mkfs + - name: format p3/mkfs ansible.builtin.command: "mkfs.ext4 -T floppy,news -L BOOT {{ item }}" loop: - - /dev/md2 + - /dev/md3 + tags: + - mkfs + + - name: format p4/mkfs + ansible.builtin.command: "mkfs.ext4 -T floppy,news -L ROOT {{ item }}" + loop: + - /dev/md4 tags: - mkfs - - name: format p3/pvcreate + - name: format p5/pvcreate ansible.builtin.command: "pvcreate {{ ansible_loop.allitems|join(' ') }}" loop_control: extended: true loop: - - /dev/nvme0n1p3 - - /dev/nvme1n1p3 + - /dev/nvme0n1p5 + - /dev/nvme1n1p5 tags: - lvm - pvcreate @@ -105,8 +121,8 @@ ansible.builtin.set_fact: pvs: "{{ ansible_loop.allitems|join(' ') }}" loop: - - /dev/nvme0n1p3 - - /dev/nvme1n1p3 + - /dev/nvme0n1p5 + - /dev/nvme1n1p5 loop_control: extended: true tags: @@ -126,16 +142,3 @@ tags: - lvm - vgcreate - - - name: lvcreate root - ansible.builtin.command: "lvcreate --type raid1 -L 30g --name rootfs {{ vgs }}" - tags: - - lvm - - lvcreate - - - name: mkfs root - ansible.builtin.command: "mkfs.ext4 -T floppy,news -L ROOTFS /dev/{{ vgs }}/rootfs" - tags: - - rootfs - - mkfs - diff --git a/roles/install_gentoo/tasks/early-mount.yml b/roles/install_gentoo/tasks/early-mount.yml index ba65856..089ad80 100644 --- a/roles/install_gentoo/tasks/early-mount.yml +++ b/roles/install_gentoo/tasks/early-mount.yml @@ -8,7 +8,7 @@ - early-mount - name: mount / - ansible.builtin.command: "mount /dev/{{ vgs }}/rootfs /mnt/gentoo" + ansible.builtin.command: "mount LABEL=ROOT /mnt/gentoo" tags: - mount - early-mount |