# shell changed\_when a file is updated

**URL:** <https://forum.ansible.com/t/shell-changed-when-a-file-is-updated/16025>\
**Category:** Ansible Project\
**Created:** [August 24, 2014, 6:48pm UTC](https://forum.ansible.com/t/shell-changed-when-a-file-is-updated/16025 "2014-08-24T18:48:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akos\_Vandra](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@Akos\_Vandra](https://forum.ansible.com/u/Akos_Vandra)\
**Post date:** [August 24, 2014, 6:48pm UTC](https://forum.ansible.com/t/shell-changed-when-a-file-is-updated/16025/1 "2014-08-24T18:48:09Z")

</div>

Hello!

Is it possible to do something similar to the creates argument, but  
one that would affect the changed attribute?

- shell: ./configure  
&nbsp;&nbsp;register: last\_command  
&nbsp;&nbsp;args:  
&nbsp;&nbsp;&nbsp;&nbsp;updates: Makefile

Would return changed=true when the configure script changed the  
Makefile, and changed=false when it generates the same Makefile.

This will enable us to do

- shell: make all  
&nbsp;&nbsp;when: last\_command | changed

Currently I don't think there is a way other than fetching the md5sum  
of the Makefile before and after then configure command, and comparing  
them, but that seems clumsy.

Regards,  
&nbsp;&nbsp;Akos Vandra

---

<div class="post-metadata">

**Author:** ![Akos\_Vandra](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@Akos\_Vandra](https://forum.ansible.com/u/Akos_Vandra)\
**Post date:** [August 24, 2014, 6:50pm UTC](https://forum.ansible.com/t/shell-changed-when-a-file-is-updated/16025/2 "2014-08-24T18:50:28Z")

</div>

Another use-case would be when performing an "rvm get", which would  
upgrade, (and possibly change) the rvm binary, and we would need to do  
some reloading stuff if that happens.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [August 25, 2014, 2:11pm UTC](https://forum.ansible.com/t/shell-changed-when-a-file-is-updated/16025/3 "2014-08-25T14:11:56Z")

</div>

Check this section of the docs out: [http://docs.ansible.com/playbooks\_error\_handling.html#overriding-the-changed-result](http://docs.ansible.com/playbooks_error_handling.html#overriding-the-changed-result)
