# Expanding the command module: rc\_ok, rc\_changed, rc\_failed?

**URL:** <https://forum.ansible.com/t/expanding-the-command-module-rc-ok-rc-changed-rc-failed/12329>\
**Category:** Ansible Project\
**Created:** [February 10, 2013, 8:40pm UTC](https://forum.ansible.com/t/expanding-the-command-module-rc-ok-rc-changed-rc-failed/12329 "2013-02-10T20:40:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fdavis](https://avatars.discourse-cdn.com/v4/letter/f/a698b9/32.png) [@fdavis](https://forum.ansible.com/u/fdavis)\
**Post date:** [February 10, 2013, 8:40pm UTC](https://forum.ansible.com/t/expanding-the-command-module-rc-ok-rc-changed-rc-failed/12329/1 "2013-02-10T20:40:37Z")

</div>

An issue that seems to come up here and there is that  
the command module assumes changed, unless rc!=0,  
in which case it assumes failure.

Maybe we could add “rc\_changed”, “rc\_failed”, and “rc\_ok”.  
This way the command module could be easily integrated into other playbook logic.

In the case of yum check-update, invocation might look something like:

- command: yum check-update rc\_ok=0 rc\_changed=100

This could be extended to comma separated lists of values to support  
the wide range of utilities out there.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [February 10, 2013, 9:43pm UTC](https://forum.ansible.com/t/expanding-the-command-module-rc-ok-rc-changed-rc-failed/12329/2 "2013-02-10T21:43:00Z")

</div>

+1

I think we'll only need rc\_failed and rc\_changed

Anything that isn't failed is ok.
