# module.exit\_json with rc \> 0

**URL:** <https://forum.ansible.com/t/module-exit-json-with-rc-0/24070>\
**Category:** Ansible Developer\
**Created:** [March 27, 2017, 4:39pm UTC](https://forum.ansible.com/t/module-exit-json-with-rc-0/24070 "2017-03-27T16:39:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Oliver](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@Peter\_Oliver](https://forum.ansible.com/u/Peter_Oliver)\
**Post date:** [March 27, 2017, 4:39pm UTC](https://forum.ansible.com/t/module-exit-json-with-rc-0/24070/1 "2017-03-27T16:39:19Z")

</div>

> From a module, if I call module.exit\_json() with a variable called rc with some value greater than zero, Ansible always treats the task as failed (despite me not having called module.fail\_json()). Is there some way to override this from within the module? Is rc a bad name to return if I don't want this behaviour?

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [March 28, 2017, 8:34am UTC](https://forum.ansible.com/t/module-exit-json-with-rc-0/24070/2 "2017-03-28T08:34:56Z")

</div>

​Yes :)​ That's basically how the module reports a failure.
