From fee8cb3dbd3b9d704468b53592bcf4152939d76c Mon Sep 17 00:00:00 2001 From: Jeffrey Serio Date: Wed, 22 Jan 2025 22:25:21 -0600 Subject: [PATCH] Fix condition check --- debian-update.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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: