# Reversible include\_tasks - A feature for Ansible

**URL:** <https://forum.ansible.com/t/reversible-include-tasks-a-feature-for-ansible/35974>\
**Category:** Ansible Developer\
**Created:** [November 6, 2021, 9:12pm UTC](https://forum.ansible.com/t/reversible-include-tasks-a-feature-for-ansible/35974 "2021-11-06T21:12:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_Eisler](https://avatars.discourse-cdn.com/v4/letter/t/e19b73/32.png) [@Tim\_Eisler](https://forum.ansible.com/u/Tim_Eisler)\
**Post date:** [November 6, 2021, 9:12pm UTC](https://forum.ansible.com/t/reversible-include-tasks-a-feature-for-ansible/35974/1 "2021-11-06T21:12:48Z")

</div>

Hello.

I have added a feature to my fork that allows a task file to be shared by a block and a rescue but to run the tasks in reverse order in rescue to achieve an undo.

I did this because it was a great exercise to study Ansible and the Python code that makes it work, and maybe the feature is useful.

The feature modifies include\_tasks to allow optional parameter “reverse: True”

More details and examples can be found a Gist I wrote at [https://gist.github.com/TimEisler/c4c5e49d7c05a60c92527a60866c3abd](https://gist.github.com/TimEisler/c4c5e49d7c05a60c92527a60866c3abd) to describe it.

Is this something that is of interest to you, maintainers?

Thanks  
Tim Eisler

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [November 6, 2021, 9:26pm UTC](https://forum.ansible.com/t/reversible-include-tasks-a-feature-for-ansible/35974/2 "2021-11-06T21:26:37Z")

</div>

Hi Tim,

it might be a good idea to create an issue in  
[https://github.com/ansible/proposals/](https://github.com/ansible/proposals/) for this. That might also give  
your proposal a bit more visibility.

Best,  
Felix

---

<div class="post-metadata">

**Author:** ![Tim\_Eisler](https://avatars.discourse-cdn.com/v4/letter/t/e19b73/32.png) [@Tim\_Eisler](https://forum.ansible.com/u/Tim_Eisler)\
**Post date:** [November 6, 2021, 11:55pm UTC](https://forum.ansible.com/t/reversible-include-tasks-a-feature-for-ansible/35974/3 "2021-11-06T23:55:17Z")

</div>

Done. [Reversible include\_tasks · Issue #201 · ansible/proposals (github.com)](https://github.com/ansible/proposals/issues/201)

Thanks  
Tim
