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 11, 2020
1 parent 1705f1a commit aabdaa7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 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 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
8 changes: 0 additions & 8 deletions utils/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +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)"
fi

exec tini -- "${@}"

0 comments on commit aabdaa7

Please sign in to comment.