Skip to content

Commit

Permalink
Install collection into image as opposed to runner
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanCoding committed Sep 4, 2020
1 parent 9af2069 commit eff4de3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 18 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ ADD demo/project /runner/project
ADD demo/env /runner/env
ADD demo/inventory /runner/inventory

# Install the collection for ansible-runner integrations
ADD ansible_runner/lib/ansible_collections/runner /usr/share/ansible/collections/ansible_collections/runner

# UNDO Before 2.0 Release:
# Install Ansible and Runner
#ADD https://releases.ansible.com/ansible-runner/ansible-runner.el8.repo /etc/yum.repos.d/ansible-runner.repo
#RUN dnf install -y ansible-runner
# Install Ansible
RUN dnf install -y python3-pip rsync openssh-clients sshpass glibc-langpack-en git \
https://github.com/krallin/tini/releases/download/v0.19.0/tini_0.19.0-amd64.rpm && \
rm -rf /var/cache/dnf

RUN dnf install -y gcc python3-devel
RUN pip3 install bindep https://github.com/ansible/ansible/archive/devel.tar.gz \
https://github.com/ansible/ansible-runner/archive/devel.tar.gz
RUN pip3 install bindep psutil https://github.com/ansible/ansible/archive/devel.tar.gz

RUN useradd runner && usermod -aG root runner

Expand Down
2 changes: 1 addition & 1 deletion ansible_runner/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@
("--container-image",),
dict(
dest="container_image",
default="ansible/ansible-runner",
default="quay.io/ansible/ansible-runner:devel",
help="Container image to use when running an ansible task"
)
),
Expand Down
3 changes: 2 additions & 1 deletion ansible_runner/runner_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def __init__(self,
rotate_artifacts=0, host_pattern=None, binary=None, extravars=None, suppress_ansible_output=False,
process_isolation=False, process_isolation_executable='podman', process_isolation_path=None,
process_isolation_hide_paths=None, process_isolation_show_paths=None, process_isolation_ro_paths=None,
container_image='ansible/ansible-runner', container_volume_mounts=None, container_options=None,
container_image='quay.io/ansible/ansible-runner:devel',
container_volume_mounts=None, container_options=None,
resource_profiling=False, resource_profiling_base_cgroup='ansible-runner', resource_profiling_cpu_poll_interval=0.25,
resource_profiling_memory_poll_interval=0.25, resource_profiling_pid_poll_interval=0.25,
resource_profiling_results_dir=None,
Expand Down
2 changes: 1 addition & 1 deletion test/data/job_env/env/settings
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
process_isolation_executable: podman
process_isolation_executable: docker
process_isolation: true
10 changes: 0 additions & 10 deletions utils/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,4 @@ runner:x:`id -u`:`id -g`:,,,:/home/runner:/bin/bash
EOF
fi

if [[ -n "${LAUNCHED_BY_RUNNER}" ]]; then
RUNNER_CALLBACKS=$(python3 -c "import ansible_runner.callbacks; print(ansible_runner.callbacks.__file__)")

# TODO: respect user callback settings via
# env ANSIBLE_CALLBACK_PLUGINS or ansible.cfg
export ANSIBLE_CALLBACK_PLUGINS="$(dirname $RUNNER_CALLBACKS)"

export ANSIBLE_STDOUT_CALLBACK=awx_display
fi

exec tini -- "${@}"

0 comments on commit eff4de3

Please sign in to comment.