diff --git a/debian-update.yml b/debian-update.yml index c55c4f1..10ba92a 100644 --- a/debian-update.yml +++ b/debian-update.yml @@ -14,8 +14,10 @@ - name: Check if backports are enabled in sources.list ansible.builtin.lineinfile: - dest: /etc/apt/sources.list - line: "backports" + path: /etc/apt/sources.list + regex: "backports" + state: absent + changed_when: false check_mode: true register: backports @@ -26,7 +28,7 @@ upgrade: dist when: - ansible_distribution == 'Debian' - - backports.stat.exists == true + - backports.found == 1 - name: Check if reboot is required ansible.builtin.stat: