summaryrefslogtreecommitdiffstats
path: root/roles/bootstrap/tasks/install-ubuntu.yml
diff options
context:
space:
mode:
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