# Ansible check mode magic variable

**URL:** <https://forum.ansible.com/t/ansible-check-mode-magic-variable/24701>\
**Category:** Ansible Project\
**Created:** [June 12, 2017, 5:03pm UTC](https://forum.ansible.com/t/ansible-check-mode-magic-variable/24701 "2017-06-12T17:03:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maggie\_Pease](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@Maggie\_Pease](https://forum.ansible.com/u/Maggie_Pease)\
**Post date:** [June 12, 2017, 5:03pm UTC](https://forum.ansible.com/t/ansible-check-mode-magic-variable/24701/1 "2017-06-12T17:03:05Z")

</div>

Hi,

When running in with the --check mode flag, Ansible sets a magic variable ansible\_check\_mode to true.

Should it be possible to also set it to true using an extra var like:

ansible-playbook -i inventories/Dev playbook.yml -e 'ansible\_check\_mode=true' ?

I tried setting it with the extra var and it did not turn on check mode.

My intended use-case is as part of a Jenkins job that has a checkbox parameter that toggles check mode.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 15, 2017, 8:16pm UTC](https://forum.ansible.com/t/ansible-check-mode-magic-variable/24701/2 "2017-06-15T20:16:46Z")

</div>

Have it pass --check .. its not a var, though it creates one for you  
to be able to use in conditionals, the reverse is not true.
