From aa786b1b1dd83a0856b110ec7426ad880864fc2f Mon Sep 17 00:00:00 2001 From: Christoph Schug Date: Sun, 3 Mar 2024 17:57:02 +0100 Subject: [PATCH] fix: tell Ansible about the idempotency of this task This shell command doesn't change state on the system, therefore it is safe to set `changed_when` to `false`, and we can also set `check_mode` to `false` here to allow execution when run in check mode. --- ansible/maintenance/maint-diskspace.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ansible/maintenance/maint-diskspace.yaml b/ansible/maintenance/maint-diskspace.yaml index 23f0386..5164855 100644 --- a/ansible/maintenance/maint-diskspace.yaml +++ b/ansible/maintenance/maint-diskspace.yaml @@ -9,6 +9,8 @@ set -euo pipefail df -Ph / | awk 'NR==2 {print $5}' executable: /bin/bash + changed_when: false + check_mode: false register: disk_usage # - name: Send discord message when disk space is over 80%