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.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, β€œnot bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay