From a30d96f718fd44396d58f85bba074e3781ca88f1 Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Tue, 21 Feb 2023 21:03:35 +0000 Subject: [PATCH] Empty sources.list instead of removing --- roles/debian/tasks/apt-sources.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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