# run playbook in Ansible v2 with python

**URL:** <https://forum.ansible.com/t/run-playbook-in-ansible-v2-with-python/24410>\
**Category:** Ansible Project\
**Created:** [May 7, 2017, 12:22pm UTC](https://forum.ansible.com/t/run-playbook-in-ansible-v2-with-python/24410 "2017-05-07T12:22:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ESWAR\_RAO](https://avatars.discourse-cdn.com/v4/letter/e/3e96dc/32.png) [@ESWAR\_RAO](https://forum.ansible.com/u/ESWAR_RAO)\
**Post date:** [May 7, 2017, 12:22pm UTC](https://forum.ansible.com/t/run-playbook-in-ansible-v2-with-python/24410/1 "2017-05-07T12:22:43Z")

</div>

Hi All,

I am trying to invoke ansible playbook V2 from python modules.

I am following below link:

(1) [http://docs.ansible.com/ansible/dev\_guide/developing\_api.html](http://docs.ansible.com/ansible/dev_guide/developing_api.html)

(2) [http://stackoverflow.com/questions/37783145/how-to-run-playbook-api-in-ansible-v2](http://stackoverflow.com/questions/37783145/how-to-run-playbook-api-in-ansible-v2)

Can some one please help me/provide links about how to invoke playbook.yml with custom ResultCallback  
so that we can log the errors/failure so that i can declare as failure in my python module.

Thanks  
Eswar Rao
