A very simple library for running Ansible playbooks and retreiving their output as a dictionary.
from playbook_runner import playbook_runner as playbook_runner
ap = playbook_runner.AnsiblePlaybook('/path/to/inventory', '/path/to/ansible/playbook/directory')
ret = ap.run_playbook('playbook.yml', {'play_host_groups': 'my_group', 'param1': 'val1'})
pip3 install playbook-runner
If you want to contribute to playbook_runner
development:
-
Make a fresh fork of
playbook_runner
repository -
Modify code as you see fit
-
Add tests to your feature
-
Go to your Github fork and create new Pull Request
We will thank you for every contribution :)