# tracking progress & undo strategy

**URL:** <https://forum.ansible.com/t/tracking-progress-undo-strategy/25631>\
**Category:** Ansible Project\
**Created:** [September 28, 2017, 9:53pm UTC](https://forum.ansible.com/t/tracking-progress-undo-strategy/25631 "2017-09-28T21:53:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![iurly](https://avatars.discourse-cdn.com/v4/letter/i/b2d939/32.png) [@iurly](https://forum.ansible.com/u/iurly)\
**Post date:** [September 28, 2017, 9:53pm UTC](https://forum.ansible.com/t/tracking-progress-undo-strategy/25631/1 "2017-09-28T21:53:18Z")

</div>

Hi there,  
I just started evaluating ansible as the means to handle a few remote systems.  
Namely I’m talking about a bunch of raspberry pi’s running raspbian, which should be running pretty much the same configuration.  
I find ansible very useful and powerful but I have a few doubts whether I’m using the right tool or not, or just using it the wrong way.

a) Is there any way to track the output/progress of running tasks?  
Some operations like the ones performed by the apt module might take an extremely long time to run and it would be nice to be able to see what’s going on as it happens.

b) I was also wondering if there’s any way to “undo” a certain playbook, or at least a given execution.  
I understand modules have a way of telling whether their execution “touched” the system or not, so it shouldn’t be impossible to save that status information somewhere (e.g. the existing version of the file) so to be able to apply it in reverse at a later stage.

Does that make any sense?  
Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [September 29, 2017, 1:29am UTC](https://forum.ansible.com/t/tracking-progress-undo-strategy/25631/2 "2017-09-29T01:29:56Z")

</div>

a) not currently, but we are looking at making this a feature, but  
modules will need to specifically support it

b) not automatic, you can use block/rescue to deal with immediate  
rollbacks, you can register the output and save it in case you need to  
reverse it.

---

<div class="post-metadata">

**Author:** ![iurly](https://avatars.discourse-cdn.com/v4/letter/i/b2d939/32.png) [@iurly](https://forum.ansible.com/u/iurly)\
**Post date:** [September 29, 2017, 6:16am UTC](https://forum.ansible.com/t/tracking-progress-undo-strategy/25631/3 "2017-09-29T06:16:30Z")

</div>

Hi Brian,  
thank you for your feedback.  
For b), you mean logging the output? How could I do that? Would that also include e.g. the existing version of a file being overwritten?

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [September 29, 2017, 2:07pm UTC](https://forum.ansible.com/t/tracking-progress-undo-strategy/25631/4 "2017-09-29T14:07:31Z")

</div>

b) can mean many things, depending on what you want.

For example, most 'file alteration modules' have a backup option to  
preserve the file before the alteration.  
Some also support the 'diff' option that returns a 'patch' of  
before/after the change.  
You can always 'register' the results and then write that to a log, or  
enable a callback that does this automatically.

There are many options, it mostly depends on exactly what you want.

---

<div class="post-metadata">

**Author:** ![iurly](https://avatars.discourse-cdn.com/v4/letter/i/b2d939/32.png) [@iurly](https://forum.ansible.com/u/iurly)\
**Post date:** [September 29, 2017, 2:47pm UTC](https://forum.ansible.com/t/tracking-progress-undo-strategy/25631/5 "2017-09-29T14:47:00Z")

</div>

I see. But that means acting at the developer level, not bare "user", right?  
I mean, in order to do that I'll have to write some python code, correct?  
Could you please point out where to start looking in the documentation?  
Thanks again, that's a very interesting insight!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [September 29, 2017, 3:31pm UTC](https://forum.ansible.com/t/tracking-progress-undo-strategy/25631/6 "2017-09-29T15:31:05Z")

</div>

Depends, in many cases you can use existing features (the backup  
option), it is mostly depending on what you specifically want to do.

I'm not sure i can direct you to specific docs as what you ask is very  
general. I would got at least through the introduction in  
[https://docs.ansible.com/ansible](https://docs.ansible.com/ansible)

and then look at the playbook/playbook special topics sections to get  
more in depth into some of the options.
