diff --git a/roles/debian/tasks/apt-sources.yml b/roles/debian/tasks/apt-sources.yml index f0fae01..0ebe6d2 100644 --- a/roles/debian/tasks/apt-sources.yml +++ b/roles/debian/tasks/apt-sources.yml @@ -41,11 +41,13 @@ dest: "/etc/apt/sources.list.d/debian.sources" when: ansible_distribution_release == "bookworm" -- name: Remove /etc/apt/sources.list for Debian 12 +- name: Empty /etc/apt/sources.list for Debian 12 become: true - ansible.builtin.file: + ansible.builtin.lineinfile: path: /etc/apt/sources.list + regexp: ".*" state: absent + create: yes when: ansible_distribution_release == "bookworm" - name: Update APT cache