I've read the README file from the github repository as well as the documentation site of ansible-runner (from the official ansible project) but I don't understand what is ansible-runner about and in which case can it be useful ? Is it a project bring additional features or it is created to run ansible in a different way ?
-
Just a guess from your description : I think it could be useful in a bastion host architecture, where only this host is accessible from ansible client and it takes care of playing the run book to isolated hosts, in a dmz for exemple.– TensibaiCommented Aug 27, 2018 at 21:04
-
also the documentation link is ansible-runner.readthedocs.io/en/latest– ShobiCommented May 31, 2019 at 21:32
2 Answers
This project is to support automation of running ansible playbooks. There is a GUI based project called Ansible Tower or AWX to do that, but ansible-runner seems to be the underlying layer of the automation in essence replacing ansible-playbook command.
There are some really serious issues for automation when trying to use ansible-playbook as part of some scripts. The output of ansible-playbook is the most awful thing under the sun when it comes to parsing. So you have to start with writing your own output plugin and then write a parser for that, then you need to figure out how to manage the environment variables and passwords and many other things. So ansible-runner is the answer to this. It would preserve the artifacts from running a task or playbook and make encapsulation of ansible in further automation possible.
You can run it from shell, you can run it as python module and there is even a reference container for it and obviously it is used by AWX. Further the project's event emitter will hopefully be much better pluggable to monitoring systems like ELK and to Message Bus type systems.
To complete Jiri's answer, I found out that ansible-runner
is used as ansible runtime in the openshift-operator framework, so you run a ansible playbook or an ansible role in a pod to reconcile cluster status when changes appears on resources.
So ansible-runner
is a really the runtime execution for ansible as runc
or cri-o
can be for containers execution.