[Python] How to use Ansible 2.0 Python API to run a Playbook?

Discussão em 'Python' iniciado por Stack, Setembro 9, 2024.

  1. Stack

    Stack Membro Participativo

    I'm trying to write a Python script which will call existing Ansible playbooks as it goes (because I want to loop over a list of plays while looping over a list of variables).

    This post explains it very well, for ansible pre-2.0: Running ansible-playbook using Python API

    This doc explains it very well if you're writing a new playbook in your script: http://docs.ansible.com/ansible/developing_api.html

    But I don't see how to call an existing playbook using Python API 2.0, and ansible.runner no longer works.

    Continue reading...

Compartilhe esta Página