On 22/05/19 7:05 AM, Yz Xyz wrote:
I have python script and have to call ansible playbook and tasks  in various phases of script execution. What is preferred way to call ansible playbook or task?

I see python API was suggested to use for internal purpose only.
https://docs.ansible.com/ansible/latest/dev_guide/developing_api.html#python-api-example

The other way is to use subprocess. Want to know if subprocess can be used reliably ?

I too want to use the Python API.  Since Ansible does not guarantee Python API compatibility with older versions, this can become a moving target.

I have been using subprocess to execute Ansible playbooks. Of course it works reliably like executing any other command. Ansible is no different.

--

Sudheer Satyanarayana
System Administrator And Developer
Tech Chorus - https://www.techchorus.net

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ab8b89eb-c69e-a5e6-2c64-e31628096868%40techchorus.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to