Probably the best example of running a playbook via Python code is
actually /usr/bin/ansible-playbook itself, though it uses nearly all
of the flags.
https://github.com/ansible/ansible/blob/devel/bin/ansible-playbook
Anything referenced there either comes from command line flags or is
constructed further up in that file.
Hope that helps!
On Sat, Feb 23, 2013 at 6:24 PM, Kyle Heath <
hea...@gmail.com> wrote:
> I'm new to Ansible... I would like to create a library of playbooks and then
> use ansible's python api to run the playbooks and get the result from a
> larger python script.
>
> I see there is an example of how to use the ansible.runner.Runner() from
> python, but that seems to be useful for running modules. I would like to
> run a playbook from a yml file (specifying the host, and private_key
> parameters directly from python). I found the playbooks.Playbook() python
> class, but the constructor requires several parameters which I am not sure
> how to construct... callbacks... runner callbacks... etc
>
> Any pointers or any examples of how to use the python API?
>
> Cheers,
> Kyle
>
> --
> 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
ansible-proje...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>