From 1b0be7c72c9b5ec6935984cfdb508afdb51a5b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arturo=20Filast=C3=B2?= Date: Wed, 8 Jan 2025 10:18:14 +0100 Subject: [PATCH] Only notify slack if we aren't running in check mode --- ansible/play | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ansible/play b/ansible/play index ffbc990..26aeff3 100755 --- a/ansible/play +++ b/ansible/play @@ -8,5 +8,8 @@ ANSIBLE_SLACK_CMD=`printf "%q " "$0" "$@"` ANSIBLE_SLACK_CMD="${ANSIBLE_SLACK_CMD% }" # strip trailing whitespace export ANSIBLE_SLACK_CMD -ansible localhost --module-name include_role --args name=notify-slack +# Check if --check or -C is present in the arguments +if [[ ! " $* " =~ " --check " && ! " $* " =~ " -C " ]]; then + ansible localhost --module-name include_role --args name=notify-slack +fi ansible-playbook "$@"