<p>To complete Jiri's answer, I found out that <code>ansible-runner</code> is used as ansible runtime in the <a href="https://github.com/operator-framework" rel="nofollow noreferrer">openshift-operator</a> framework, so you run a ansible playbook or an ansible role in a pod to reconcile cluster status when changes appears on resources.</p>

<p>So <code>ansible-runner</code> is a really the runtime execution for ansible as <code>runc</code> or <code>cri-o</code> can be for containers execution.</p>

CC BY-SA 4.0
2019-11-14T14:27:39.050Z
2019-11-14T14:54:51.160Z
2019-11-14T14:54:51.160Z
Baptiste Mille-Mathias
<p>This project is to support automation of running ansible playbooks. There is a GUI based project called <strong>Ansible Tower</strong> or <a href="https://github.com/ansible/awx" rel="noreferrer">AWX</a> to do that, but <strong>ansible-runner</strong> seems to be the underlying layer of the automation in essence replacing <strong>ansible-playbook</strong> command.</p>

<p>There are some really serious issues for automation when trying to use <strong>ansible-playbook</strong> as part of some scripts. The output of <strong>ansible-playbook</strong> 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 <strong>ansible-runner</strong> 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.</p>

<p>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.</p>

CC BY-SA 4.0
2018-08-30T08:56:32.830Z
2018-08-30T08:56:32.830Z
Jiri Klouda
<p>I've read the <a href="https://github.com/ansible/ansible-runner/blob/master/README.md" rel="noreferrer">README file</a> from the github repository as well as the <a href="https://ansible-runner.readthedocs.io/en/latest/" rel="noreferrer">documentation site</a> 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 ?</p>

CC BY-SA 4.0
2018-08-27T21:04:12.927Z
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.
Tensibai
CC BY-SA 4.0
2019-05-31T21:32:42.613Z
also the documentation link is https://ansible-runner.readthedocs.io/en/latest/
Shobi
<ansible><automation>
What is ansible-runner about?
Baptiste Mille-Mathias
# What is ansible-runner about?

(Asked by: username_0 on 2018-08-25)

I've read the [README file](https://github.com/ansible/ansible-runner/blob/master/README.md) from the github repository as well as the [documentation site](https://ansible-runner.readthedocs.io/en/latest/) 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 ?

**Tags:** ansible, automation

> **Comments:**
> **username_1**: 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.  
> **username_2**: also the documentation link is https://ansible-runner.readthedocs.io/en/latest/  

---

## 2 answers

### Answer by username_3 on 2018-08-30. Score: 12 | Accepted answer

This project is to support automation of running ansible playbooks. There is a GUI based project called **Ansible Tower** or [AWX](https://github.com/ansible/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.


---

### Answer by username_0 on 2019-11-14. Score: 1

To complete Jiri's answer, I found out that `ansible-runner` is used as ansible runtime in the [openshift-operator](https://github.com/operator-framework) 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.


---

