DEV Community

Cover image for Why and how to check if an Ansible module supports check_mode?
XLAB Steampunk
XLAB Steampunk

Posted on

Why and how to check if an Ansible module supports check_mode?

Ansible check_mode is an extremely useful feature when creating or editing an Ansible playbook, especially when running complex playbooks that involve major changes to servers. check_mode lets you see what the playbook will do without actually changing anything on the remote servers. This dry run helps you find potential errors that would seriously damage the servers or completely shut them down. Better safe than sorry, right?

But not all Ansible modules support 𝐜𝐡𝐞𝐜𝐤_𝐦𝐨𝐝𝐞 and for some this is not clearly specified in their documentation! Modules that don't support it do not report what changes they might have made, making the dry run unreliable.

So how can you check whether modules from your playbook support check_mode or not? Simple. Ansible Playbook Quality Scanner checks the modules for you and solves the question immediately. Try it out.

Top comments (0)