Skip to content

Commit

Permalink
Only notify slack if we aren't running in check mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Jan 8, 2025
1 parent 284e989 commit 1b0be7c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ansible/play
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"

0 comments on commit 1b0be7c

Please sign in to comment.