Simple class to manage Ansible within Python. Though Ansible only works on Python 2, this class will be usable on Python 3 when Ansible works on it.
The reason of using python instead of a regular ansible playbook is that at the time of writing this, there's a bug that makes imposible the normal use of include_role
with loops. More information here. To learn how to program a playbook in Python, read the source code and read this article and the Ansible's page dedicated to the Python API.
You can clone the repository and install from source (you should always use a virtualenv):
git clone https://github.com/paradigmadigital/programansible
cd programansible
python setup.py install
Or you can simply use pip:
pip install git+https://github.com/paradigmadigital/programansible/