Questions tagged [ansible-runner]

Ansible Runner is a tool and python library that helps when interfacing with Ansible directly or as part of another system whether that be through a container image interface, as a standalone tool, or as a Python module that can be imported. The goal is to provide a stable and consistent interface abstraction to Ansible.

More information about Ansible Runner is available at:

  1. https://github.com/ansible/ansible-runner
  2. https://ansible-runner.readthedocs.io/en/latest/

For information on the larger Ansible project, see: https://stackoverflow.com/tags/ansible/info

22 questions
0
votes
1 answer

Get output from ansible runner in form of json/yaml

I am executing Ansible playbook from python via ansible_runner. My requirement is to enhance logs and also fetch certain event result. Ansible playbook when executed from command line gives human readable output in form of json/yaml. But how to…
Aquib
  • 1
  • 1
0
votes
1 answer

Ansbile Runner callback for stdout specified: awx_display Error

I am developing an agent includes ansible-runner, while I am running any playbook it is normal. However when I compile it using pyinstaller, I am getting below error while executing…
Dogac Topay
  • 3
  • 1
  • 2
0
votes
0 answers

Python script sub directory path in Azure Functions

I currently have a python project that contains python script, and azure function files. This is the structure of the project: ├── ansible-deploy-pipelines.yml ├── ansibleazurefunc │ ├── __init__.py │ ├── function.json │ └── sample.dat ├──…
ghenzi83
  • 109
  • 1
  • 13
0
votes
1 answer

Ansible Runner consecutive calls mess up when done too fast

I have made a piece of software using the official Ansible Runner libraries that receives several remote calls to run 1 or N times 1 or M playbooks... The Ansible run config is sequential, although this should not be relevant for different calls (if…
xCovelus
  • 578
  • 1
  • 9
  • 20
0
votes
1 answer

use ansible-runner as Python module Interface to Ansible error: RunnerConfig' object has no attribute 'command'

I use ansible 2.9.13 and ansible-runner 1.4.6 Below is my Python code: from ansible_runner import Runner, RunnerConfig f = open('/home/george/dev/beeops/ansible_private/keyfile', 'r') key = f.read() rc =…
Geroge
  • 3
  • 1
0
votes
1 answer

How do I set a timeout for an Ansible Runner task?

In the following hypothetical example, I'm executing sleep for five sec on the remote host via the shell module. I'd like the Ansible Runner to timeout after four seconds if the remote shell process hasn't returned. Is this possible? r =…
0
votes
1 answer

How do I list hosts using Ansible 1.x API

Ansible-playbook has a --list-hosts cli switch that just outputs the hosts affected by each play in a playbook. I am looking for a way to access to same information through the python API. The (very) basic script I am using to test right now…
1
2