Skip to content

Commit

Permalink
Merge pull request #490 from maxamillion/cli_execenv_rebase
Browse files Browse the repository at this point in the history
Add adhoc and playbook subcommands for CLI Exec Env usage

Reviewed-by: Shane McDonald <me@shanemcd.com>
             https://github.com/shanemcd
  • Loading branch information
ansible-zuul[bot] committed Aug 13, 2020
2 parents 832850a + 548893c commit 743793b
Show file tree
Hide file tree
Showing 19 changed files with 1,176 additions and 500 deletions.
38 changes: 28 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,52 @@
FROM centos:8
FROM docker.io/centos:8

ADD https://github.com/krallin/tini/releases/download/v0.18.0/tini /bin/tini
ADD utils/entrypoint.sh /bin/entrypoint
ADD demo/project /runner/project
ADD demo/env /runner/env
ADD demo/inventory /runner/inventory

# 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
#ADD https://releases.ansible.com/ansible-runner/ansible-runner.el8.repo /etc/yum.repos.d/ansible-runner.repo
#RUN dnf install -y ansible-runner
RUN dnf install -y epel-release && \
dnf install -y ansible-runner python3-pip sudo rsync openssh-clients sshpass glibc-langpack-en git && \
pip3 install ansible && \
chmod +x /bin/tini /bin/entrypoint && \
dnf install -y python3-pip sudo rsync openssh-clients sshpass glibc-langpack-en git && \
alternatives --set python /usr/bin/python3 && \
chmod +x /bin/tini && \
rm -rf /var/cache/dnf

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

RUN useradd runner && usermod -aG root runner

ADD utils/entrypoint.sh /bin/entrypoint
RUN chmod +x /bin/entrypoint

# In OpenShift, container will run as a random uid number and gid 0. Make sure things
# are writeable by the root group.
RUN mkdir -p /runner/inventory /runner/project /runner/artifacts /runner/.ansible/tmp && \
chmod -R g+w /runner && chgrp -R root /runner && \
chmod g+w /etc/passwd
RUN for dir in \
/home/runner \
/home/runner/.ansible \
/runner \
/home/runner \
/runner/env \
/runner/inventory \
/runner/project \
/runner/artifacts ; \
do mkdir -m 0775 -p $dir ; chmod g+rw $dir ; chown -R runner:runner $dir ; done && \
for file in \
/home/runner/.ansible/galaxy_token \
/etc/passwd ; \
do touch $file ; chmod g+rw $file ; chgrp runner $file ; done

VOLUME /runner

ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
ENV RUNNER_BASE_COMMAND=ansible-playbook
ENV HOME=/runner
ENV HOME=/home/runner

WORKDIR /runner

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ docs:
cd docs && make html

image:
$(CONTAINER_ENGINE) pull centos:8
$(CONTAINER_ENGINE) pull docker.io/centos:8
$(CONTAINER_ENGINE) build --rm=true -t $(IMAGE_NAME) .

devimage:
Expand Down

0 comments on commit 743793b

Please sign in to comment.