# Checking for \`--check\` or \`--dry-run\` inside callback module

**URL:** <https://forum.ansible.com/t/checking-for-check-or-dry-run-inside-callback-module/25197>\
**Category:** Ansible Project\
**Created:** [August 7, 2017, 8:55pm UTC](https://forum.ansible.com/t/checking-for-check-or-dry-run-inside-callback-module/25197 "2017-08-07T20:55:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anand.patel](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@anand.patel](https://forum.ansible.com/u/anand.patel)\
**Post date:** [August 7, 2017, 8:55pm UTC](https://forum.ansible.com/t/checking-for-check-or-dry-run-inside-callback-module/25197/1 "2017-08-07T20:55:43Z")

</div>

Hi I am creating a custom callback module and I want it to have different behavior when in `check` or `dry-run` mode. However I have not found a way to detect this, is there a way for me to tell as a callback plugin if we are running in check mode?  
The goal is to only run this module when dry-run or check is enabled.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [August 8, 2017, 12:59pm UTC](https://forum.ansible.com/t/checking-for-check-or-dry-run-inside-callback-module/25197/2 "2017-08-08T12:59:34Z")

</div>

For development question you might have better luck in the development mailing list [https://groups.google.com/forum/#!forum/ansible-devel](https://groups.google.com/forum/#!forum/ansible-devel)
