I would like to restrict Ansible deployment actions to dry-run only (i.e. --check
and / or --diff
) for certain hosts / groups.
The best I was able to come up with, is to check in every playbook, maybe as a pre_task
, if deployment happens to such a dry-run only machine. If so check if ansible_check_mode
is set, if not exit with a message otherwise proceed. This is everything but a nice approach.
Is there something similar to ansible_ssh_extra_args
for Ansible args I missed?
At least nothing is mentioned in the docs at Connecting to hosts: behavioral inventory parameters.
Any alternatives?