Documentation homepage Last update: Sep 22, 2021

Ansible Runner Integration Overview

Much of the code in AWX around ansible and ansible-playbook invocation has been removed and put into the project ansible-runner. AWX now calls out to ansible-runner to invoke ansible and ansible-playbook.

Lifecycle

In AWX, a task of a certain job type is kicked off (i.e., RunJob, RunProjectUpdate, RunInventoryUpdate, etc.) in tasks.py. A temp directory is built to house ansible-runner parameters (i.e., envvars, cmdline, extravars, etc.). The temp directory is filled with the various concepts in AWX (i.e., ssh keys, extra vars, etc.). The code then builds a set of parameters to be passed to the ansible-runner Python module interface, ansible-runner.interface.run(). This is where AWX passes control to ansible-runner. Feedback is gathered by AWX via callbacks and handlers passed in.

The callbacks and handlers are:

Debugging

If you want to debug ansible-runner, then set AWX_CLEANUP_PATHS=False, run a job, observe the job's AWX_PRIVATE_DATA_DIR property, and go the node where the job was executed and inspect that directory.

If you want to debug the process that ansible-runner invoked (i.e., Ansible or ansible-playbook), then observe the Job's job_env, job_cwd, and job_args parameters.