# Ansible revert back operation

**URL:** <https://forum.ansible.com/t/ansible-revert-back-operation/30637>\
**Category:** Ansible Developer\
**Created:** [June 24, 2019, 6:33am UTC](https://forum.ansible.com/t/ansible-revert-back-operation/30637 "2019-06-24T06:33:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Preethi\_Muruganantha](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@Preethi\_Muruganantha](https://forum.ansible.com/u/Preethi_Muruganantha)\
**Post date:** [June 24, 2019, 6:33am UTC](https://forum.ansible.com/t/ansible-revert-back-operation/30637/1 "2019-06-24T06:33:33Z")

</div>

I have three IPs (machines) listed in the inventory file.  
I have to run the playbook in all the 3 mchines.  
For eg., Lets consider I am deploying the application in all the 3 machines.  
When the deployment fails in any of the machines it has to revert back the operations in all the 3 machines/(or to the machines where the deployment is completed) eventhough it is successfully deployed.  
I have the revert\_back playbook written seperately.

Is there any way in ansible to achieve this requirement?

It will be helpful for me if anyone could guide me in achieving this requirement.

---

<div class="post-metadata">

**Author:** ![Db0](https://avatars.discourse-cdn.com/v4/letter/d/9f8e36/32.png) [@Db0](https://forum.ansible.com/u/Db0)\
**Post date:** [June 24, 2019, 7:34am UTC](https://forum.ansible.com/t/ansible-revert-back-operation/30637/2 "2019-06-24T07:34:58Z")

</div>

Instead of reverting the operation, it might be better to instruct ansible to perform the operation serially rather than on parallel. Then if the operation fails on one, it won’t run on the others, and you have to run the revert\_back playbook manually.

You can use a block rescue: to run the revert tasks automatically, but this will consider the run a success, so you’ll also need to include a custom failed: tak in your block to prevent other systems from being modified.,
