- ansible docker images
- ansible play for cleaning hosts (apt autoremove) - mondrian(incomplete) - lock postgres to version 10 - update jenkins dockerfile
This commit is contained in:
73
dockerfiles/tasks/ansible/Dockerfile-2.0
Normal file
73
dockerfiles/tasks/ansible/Dockerfile-2.0
Normal file
@@ -0,0 +1,73 @@
|
||||
#http://ruleoftech.com/2017/dockerizing-all-the-things-running-ansible-inside-docker-container
|
||||
FROM alpine:3.7
|
||||
|
||||
ENV ANSIBLE_VERSION 2.0.0
|
||||
|
||||
ENV BUILD_PACKAGES \
|
||||
bash \
|
||||
curl \
|
||||
tar \
|
||||
openssh-client \
|
||||
sshpass \
|
||||
git \
|
||||
python \
|
||||
py-boto \
|
||||
py-dateutil \
|
||||
py-httplib2 \
|
||||
py-jinja2 \
|
||||
py-paramiko \
|
||||
py-pip \
|
||||
py-yaml \
|
||||
ca-certificates
|
||||
|
||||
# If installing ansible@testing
|
||||
#RUN \
|
||||
# echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> #/etc/apk/repositories
|
||||
|
||||
RUN set -x && \
|
||||
\
|
||||
echo "==> Adding build-dependencies..." && \
|
||||
apk --update add --virtual build-dependencies \
|
||||
gcc \
|
||||
musl-dev \
|
||||
libffi-dev \
|
||||
openssl-dev \
|
||||
python-dev && \
|
||||
\
|
||||
echo "==> Upgrading apk and system..." && \
|
||||
apk update && apk upgrade && \
|
||||
\
|
||||
echo "==> Adding Python runtime..." && \
|
||||
apk add --no-cache ${BUILD_PACKAGES} && \
|
||||
pip install --upgrade pip && \
|
||||
pip install python-keyczar docker-py && \
|
||||
\
|
||||
echo "==> Installing Ansible..." && \
|
||||
pip install ansible==${ANSIBLE_VERSION} && \
|
||||
\
|
||||
echo "==> Cleaning up..." && \
|
||||
apk del build-dependencies && \
|
||||
rm -rf /var/cache/apk/* && \
|
||||
\
|
||||
echo "==> Adding hosts for convenience..." && \
|
||||
mkdir -p /etc/ansible /ansible && \
|
||||
echo "[local]" >> /etc/ansible/hosts && \
|
||||
echo "localhost" >> /etc/ansible/hosts
|
||||
|
||||
ENV ANSIBLE_GATHERING smart
|
||||
ENV ANSIBLE_HOST_KEY_CHECKING false
|
||||
ENV ANSIBLE_RETRY_FILES_ENABLED false
|
||||
ENV ANSIBLE_ROLES_PATH /ansible/playbooks/roles
|
||||
ENV ANSIBLE_SSH_PIPELINING True
|
||||
ENV PYTHONPATH /ansible/lib
|
||||
ENV PATH /ansible/bin:$PATH
|
||||
ENV ANSIBLE_LIBRARY /ansible/library
|
||||
|
||||
WORKDIR /ansible/playbooks
|
||||
|
||||
ENTRYPOINT ["ansible-playbook"]
|
||||
|
||||
RUN addgroup ansible \
|
||||
&& adduser -h /home/ansible -u 1000 -S -G ansible ansible
|
||||
|
||||
USER ansible
|
||||
Reference in New Issue
Block a user