shell changed_when a file is updated

31 views
Skip to first unread message

Akos Vandra

unread,
Aug 24, 2014, 2:48:12 PM8/24/14
to ansible-project
Hello!

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

- shell: ./configure
register: last_command
args:
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
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,
Akos Vandra

Akos Vandra

unread,
Aug 24, 2014, 2:50:31 PM8/24/14
to ansible-project
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.

Michael DeHaan

unread,
Aug 25, 2014, 10:12:03 AM8/25/14
to ansible...@googlegroups.com


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAHHcNocxLP%2B06ShcKN4EkLjZbh9rxFzFChT43cm-%2B7QiQ0W8wQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages