summaryrefslogtreecommitdiffstats
path: root/roles/bootstrap/tasks/install-ubuntu.yml
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2025-09-21 17:17:08 +0200
committerAhmed Abdelhalim <[email protected]>2025-09-21 17:17:08 +0200
commita82425b10738c9119075c2347e258d5048530f1d (patch)
tree9a7b1ca65528ab19e8faa1d6ffbfd5e4091899c8 /roles/bootstrap/tasks/install-ubuntu.yml
parentcf24e81b55c1e038f17d795ac103c58b7bd9b12c (diff)
Clean up bootmgr and fix systemd-boot regression issue
Also update the syntax to use the new loop syntax instead of with_items
Diffstat (limited to 'roles/bootstrap/tasks/install-ubuntu.yml')
-rw-r--r--roles/bootstrap/tasks/install-ubuntu.yml18
1 files changed, 14 insertions, 4 deletions
diff --git a/roles/bootstrap/tasks/install-ubuntu.yml b/roles/bootstrap/tasks/install-ubuntu.yml
index 1b22c69..407da3c 100644
--- a/roles/bootstrap/tasks/install-ubuntu.yml
+++ b/roles/bootstrap/tasks/install-ubuntu.yml
@@ -30,7 +30,7 @@
dest: "{{ item.dest }}"
mode: "0640"
content: "{{ item.content }}"
- with_items:
+ loop:
- dest: "{{ mnt_root_path }}/etc/apt/preferences.d/ignored-package"
content: "{{ bootstrap_apt_ignored_preferences }}"
- dest: "{{ mnt_root_path }}/etc/apt/sources.list"
@@ -40,11 +40,21 @@
ansible.builtin.command:
cmd: "arch-chroot {{ mnt_root_path }} {{ item }}"
changed_when: true
- with_items:
+ loop:
- "apt-get update"
- "apt-get install -y {{ bootstrap_distro.packages | join(' ') }}"
-- name: "Run bootclt"
+- name: "Clean up old Linux Boot Manager entries"
+ ansible.builtin.shell:
+ cmd: |
+ for entry in $(efibootmgr | grep "Linux Boot Manager" | cut -d'*' -f1 | tr -d 'Boot'); do
+ efibootmgr -b $entry -B
+ done
+ changed_when: false
+ failed_when: false
+
+# NOTE: bootctl is not run in chroot to workaround https://github.com/systemd/systemd/issues/36174
+- name: "Run bootctl"
ansible.builtin.command:
- cmd: "arch-chroot {{ mnt_root_path }} bootctl install"
+ cmd: "bootctl install --esp-path={{ mnt_boot_path }}"
changed_when: true