# how to abort ansible execution in callback

**URL:** <https://forum.ansible.com/t/how-to-abort-ansible-execution-in-callback/19935>\
**Category:** Ansible Project\
**Created:** [December 4, 2015, 6:35am UTC](https://forum.ansible.com/t/how-to-abort-ansible-execution-in-callback/19935 "2015-12-04T06:35:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leon\_Xie](https://avatars.discourse-cdn.com/v4/letter/l/5e9695/32.png) [@Leon\_Xie](https://forum.ansible.com/u/Leon_Xie)\
**Post date:** [December 4, 2015, 6:35am UTC](https://forum.ansible.com/t/how-to-abort-ansible-execution-in-callback/19935/1 "2015-12-04T06:35:50Z")

</div>

hi all,

I want to abort entire ansible execution in a callback file.  
how could I implement that?

The below code doesn’t work:

def runner\_on\_failed(self, host, res, ignore\_errors=False):  
sys.exit(1)

thanks a lot in advance.
