0Pricing
Ansible Academy · Lesson

Support Check Mode in Your Module

Make custom code dry-run safe.

What Check Mode Is

With check mode, users run a playbook using --check to preview changes. Nothing is actually modified on the host.

ansible-playbook site.yml --check

Your Module Must Opt In

Check mode is not automatic. You declare support so Ansible knows your module promises to make no changes in this mode.

All lessons in this course

  1. When to Build a Custom Module
  2. AnsibleModule & Argument Spec
  3. Return JSON & Honor changed
  4. Support Check Mode in Your Module
← Back to Ansible Academy