mirror of
https://github.com/Expand-sys/awx-on-k3s
synced 2025-12-16 05:52:15 +11:00
2 KiB
2 KiB
Examples of Ansible Runner
Environment in This Example
- CentOS 8.2
- Python 3.9
- Docker 20.10.7
Install
python3 -m pip install ansible-runner
Prepare Required Files
Refer projects/demo.yml and env/settings.
Your own Execution Environment can be used using container_image in env/settings.
Invoke Ansible Runner
The sample playbook will help you figure out the differences between Execution Environments, such as Ansible version, pip list, etc.
ansible-runner run . -p demo.yml
The settings can also be given directly as arguments like --container-image without using env/settings.
Tips
- If
process_isolationis set tofalseas default,ansible-runnerwill just work as a wrapper for the localansible-playbookcommand. - If
process_isolationis set totrue,connection: localpoints to the container itself, so the playbook cannot affectlocalhostwhich means the container host. To avoid this, you need to SSH to local host without usingconnection: local. Related issues is here. container_imagedefaults toquay.io/ansible/ansible-runner:devel. You can check available tags for the public Execution Environment atquay.io/ansible/ansible-runner- The image from
quay.io/ansible/awx-eewhich is default Execution Environment for AWX also can be specified. - The
process_isolation_show_pathsdescribed in the documentation does not work with Docker and Podman. Instead, you can usecontainer_volume_mountsas described inenv/settings, but this is not documented.