Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions playbooks/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
ansible.builtin.command:
cmd: ssh -O stop root@{{ inventory_hostname }} -p 8922
changed_when: true
failed_when: false
tags:
- molecule-notest

Expand Down
10 changes: 5 additions & 5 deletions playbooks/tasks/install_system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
community.general.filesystem:
fstype: vfat
opts: -F 32 -s 1 -n EFI
dev: "/dev/disk/by-id/{{ ansible_facts.devices[item].partitions[item + '1'].links.ids[0] }}"
dev: "/dev/disk/by-id/{{ (ansible_facts.devices[item].partitions | dictsort | first)[1].links.ids[0] }}"
loop: "{{ root_disks }}"

- name: Create the zfs rpool pool
Expand All @@ -64,7 +64,7 @@
rpool
{{ pool_mode | default() }}
{% for disk in root_disks %}
{{ ansible_facts.devices[disk].partitions[disk + "2"].links.ids[0] }}
{{ (ansible_facts.devices[disk].partitions | dictsort | last)[1].links.ids[0] }}
{% endfor %}
responses:
Enter new passphrase: "{{ zfs_pool_password }}"
Expand Down Expand Up @@ -178,7 +178,7 @@
{{ ansible_facts.distribution_release }}
/mnt
environment:
http_proxy: "{{ (apt_proxy_url | length > 0) | ternary(apt_proxy_url, omit) }}"
http_proxy: "{{ (apt_proxy_url | default('') | length > 0) | ternary(apt_proxy_url, omit) }}"
args:
creates: /mnt/etc

Expand Down Expand Up @@ -220,12 +220,12 @@
opts: defaults,umask=0077,relatime
passno: "1"
path: /mnt/boot/efi
src: /dev/{{ root_disks[0] }}1
src: /dev/{{ (ansible_facts.devices[root_disks[0]].partitions | dictsort | first)[0] }}
state: mounted

- name: Mount mirror esp partitions
ansible.posix.mount:
src: /dev/{{ item }}1
src: /dev/{{ (ansible_facts.devices[item].partitions | dictsort | first)[0] }}
path: /mnt/boot/efi/.esp-{{ item }}
fstype: vfat
opts: defaults,umask=0077,relatime
Expand Down
4 changes: 2 additions & 2 deletions playbooks/tasks/setup_system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@
ansible.builtin.copy:
# yamllint disable rule:line-length
content: |
UUID={{ ansible_facts.devices[root_disks[0]].partitions[root_disks[0] + "1"].uuid }} /boot/efi vfat defaults,{% if root_disks | length > 1 %}nofail,{% endif %}umask=0077,relatime,x-systemd.after=zfs-mount.service 0 1
UUID={{ (ansible_facts.devices[root_disks[0]].partitions | dictsort | first)[1].uuid }} /boot/efi vfat defaults,{% if root_disks | length > 1 %}nofail,{% endif %}umask=0077,relatime,x-systemd.after=zfs-mount.service 0 1
{% if root_disks | length > 1 %}
{% for disk in root_disks[1:] %}
UUID={{ ansible_facts.devices[disk].partitions[disk + "1"].uuid }} /boot/efi/.esp-{{ disk }} vfat defaults,nofail,umask=0077,relatime,x-systemd.after=zfs-mount.service 0 1
UUID={{ (ansible_facts.devices[disk].partitions | dictsort | first)[1].uuid }} /boot/efi/.esp-{{ disk }} vfat defaults,nofail,umask=0077,relatime,x-systemd.after=zfs-mount.service 0 1
{% endfor %}
{%- endif -%}
rpool/var /var zfs x-systemd.before=zfs-mount.service 0 0
Expand Down