Enforcing or preventing check mode on tasks
If you want certain tasks to run in check mode always, or never, regardless of whether you run the playbook with or without--check, you can add thecheck_modeoption to those tasks:
For example:
Running single tasks withcheck_mode:truecan be useful for testing Ansible modules, either to test the module itself or to test the conditions under which a module would make changes. You can register variables (seeConditionals) on these tasks for even more detail on the potential changes.