From a123a32febd9116611819f08400413d4d1a6cd76 Mon Sep 17 00:00:00 2001 From: Sandwich Date: Sat, 21 Feb 2026 01:22:37 +0100 Subject: [PATCH] fix(bootstrap): replace brittle sed with ansible.builtin.replace for ubuntu universe repo --- roles/bootstrap/tasks/ubuntu.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/roles/bootstrap/tasks/ubuntu.yml b/roles/bootstrap/tasks/ubuntu.yml index f0316c2..0a78720 100644 --- a/roles/bootstrap/tasks/ubuntu.yml +++ b/roles/bootstrap/tasks/ubuntu.yml @@ -51,9 +51,10 @@ changed_when: bootstrap_ubuntu_base_result.rc == 0 - name: Enable universe repository - ansible.builtin.command: "{{ chroot_command }} sed -i '1s|$| universe|' /etc/apt/sources.list" - register: bootstrap_ubuntu_repo_result - changed_when: bootstrap_ubuntu_repo_result.rc == 0 + ansible.builtin.replace: + path: /mnt/etc/apt/sources.list + regexp: '^(deb\s+\S+\s+\S+\s+main)$' + replace: '\1 universe' - name: Update package lists ansible.builtin.command: "{{ chroot_command }} apt update"