fix(bootstrap): replace brittle sed with ansible.builtin.replace for ubuntu universe repo

This commit is contained in:
2026-02-21 01:22:37 +01:00
parent 54c704de4e
commit a123a32feb

View File

@@ -51,9 +51,10 @@
changed_when: bootstrap_ubuntu_base_result.rc == 0 changed_when: bootstrap_ubuntu_base_result.rc == 0
- name: Enable universe repository - name: Enable universe repository
ansible.builtin.command: "{{ chroot_command }} sed -i '1s|$| universe|' /etc/apt/sources.list" ansible.builtin.replace:
register: bootstrap_ubuntu_repo_result path: /mnt/etc/apt/sources.list
changed_when: bootstrap_ubuntu_repo_result.rc == 0 regexp: '^(deb\s+\S+\s+\S+\s+main)$'
replace: '\1 universe'
- name: Update package lists - name: Update package lists
ansible.builtin.command: "{{ chroot_command }} apt update" ansible.builtin.command: "{{ chroot_command }} apt update"