I used your example as a base for triggering ansible through a python script, however while the output suggest that the connection to the node is made and the playbook is running, individual steps on the various roles fail consistently in contrast to running the playbook using the ansible-playbook command line tool passing the same playbook.
The output suggests no clear reasons for this behavior.
Its working fine only if I have my host listed in /etc/ansible/hosts, but I want to pass my custom host file while running a playbook. Can you tell me how to do so?