# ok\_on\_rc / failed\_on\_rc

**URL:** <https://forum.ansible.com/t/ok-on-rc-failed-on-rc/12453>\
**Category:** Ansible Project\
**Created:** [March 4, 2013, 6:45pm UTC](https://forum.ansible.com/t/ok-on-rc-failed-on-rc/12453 "2013-03-04T18:45:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yves\_Dorfsman](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@Yves\_Dorfsman](https://forum.ansible.com/u/Yves_Dorfsman)\
**Post date:** [March 4, 2013, 6:45pm UTC](https://forum.ansible.com/t/ok-on-rc-failed-on-rc/12453/1 "2013-03-04T18:45:47Z")

</div>

I know we talked about this, but I don't think we ever reached a conclusion.

I often run the command or shell module to be able to register values, and when successful, it shows as changed, even though nothing has changed, it was just looking up a value (a grep etc...).

Could we add a ok\_on\_rc = 0, or something along those lines, to prevent this those two modules?

---

<div class="post-metadata">

**Author:** ![Yves\_Dorfsman](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@Yves\_Dorfsman](https://forum.ansible.com/u/Yves_Dorfsman)\
**Post date:** [March 11, 2013, 10:12pm UTC](https://forum.ansible.com/t/ok-on-rc-failed-on-rc/12453/2 "2013-03-11T22:12:57Z")

</div>

I haven't seen any comment on this:

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [March 11, 2013, 10:15pm UTC](https://forum.ansible.com/t/ok-on-rc-failed-on-rc/12453/3 "2013-03-11T22:15:10Z")

</div>

Great.

Shell and command is exactly where we want it, and they are just one  
module anyway that shares code (command) 🙂
