Running Ansible Scripts in Dry Run Mode

Red Hat – Ansible

Quite often you’re clear on what your Ansible playbook should be doing and perhaps even know the syntax is correct, but there are still concerns about the implications. In such cases it’s best to run your Ansible playbook in dry run mode: preview changes without actually making them.

How To Preview Ansible Playbook Run

Simply add the –check parameter to the end of your ansible-playbook command:

$ ansible-playbook try.yaml --check

This will show you exactly the changes the playbook would have made, but without actually making them.

Ansible would even go as far as computing the necessary changes as if you made them, lining up variable values etc. It would also show you what will get changed as if it’s already changed – but without any risks.

That’s it for today, this is a very short note but I’ll come back and revisit it soon to provide examples.

See Also