Remove Ansible from control plane

Execution Environments or bust!
This commit is contained in:
Shane McDonald
2021-02-08 14:29:32 -05:00
parent ea39cbce73
commit ddcbc408b9
2 changed files with 3 additions and 33 deletions

View File

@@ -4,15 +4,9 @@
### DO NOT EDIT ### DO NOT EDIT
### ###
# Locations - set globally to be used across stages
ARG COLLECTION_BASE="/var/lib/awx/vendor/awx_ansible_collections"
ARG ANSIBLE_BRANCH=devel
# Build container # Build container
FROM centos:8 as builder FROM centos:8 as builder
ARG ANSIBLE_BRANCH
ENV LANG en_US.UTF-8 ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8 ENV LC_ALL en_US.UTF-8
@@ -49,8 +43,7 @@ RUN dnf -y update && \
xmlsec1-devel \ xmlsec1-devel \
xmlsec1-openssl-devel xmlsec1-openssl-devel
RUN python3 -m ensurepip && pip3 install "virtualenv < 20" && \ RUN python3 -m ensurepip && pip3 install "virtualenv < 20"
pip3 install --no-cache-dir https://github.com/ansible/ansible/archive/${ANSIBLE_BRANCH}.tar.gz
# Install & build requirements # Install & build requirements
ADD Makefile /tmp/Makefile ADD Makefile /tmp/Makefile
@@ -61,11 +54,9 @@ ADD requirements/requirements_ansible.txt \
requirements/requirements.txt \ requirements/requirements.txt \
requirements/requirements_tower_uninstall.txt \ requirements/requirements_tower_uninstall.txt \
requirements/requirements_git.txt \ requirements/requirements_git.txt \
requirements/collections_requirements.yml \
/tmp/requirements/ /tmp/requirements/
RUN cd /tmp && make requirements_awx requirements_ansible_py3 RUN cd /tmp && make requirements_awx requirements_ansible_py3
RUN cd /tmp && make requirements_collections
{% if (build_dev|bool) or (kube_dev|bool) %} {% if (build_dev|bool) or (kube_dev|bool) %}
ADD requirements/requirements_dev.txt /tmp/requirements ADD requirements/requirements_dev.txt /tmp/requirements
@@ -84,9 +75,6 @@ RUN make sdist && \
# Final container(s) # Final container(s)
FROM centos:8 FROM centos:8
ARG COLLECTION_BASE
ARG ANSIBLE_BRANCH
ENV LANG en_US.UTF-8 ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8 ENV LC_ALL en_US.UTF-8
@@ -100,7 +88,6 @@ RUN dnf -y update && \
dnf module -y enable 'postgresql:12' && \ dnf module -y enable 'postgresql:12' && \
dnf config-manager --set-enabled powertools && \ dnf config-manager --set-enabled powertools && \
dnf -y install acl \ dnf -y install acl \
bubblewrap \
git-core \ git-core \
git-lfs \ git-lfs \
glibc-langpack-en \ glibc-langpack-en \
@@ -135,11 +122,7 @@ RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master
RUN curl -L -o /usr/bin/tini https://github.com/krallin/tini/releases/download/v0.19.0/tini-{{ tini_architecture | default('amd64') }} && \ RUN curl -L -o /usr/bin/tini https://github.com/krallin/tini/releases/download/v0.19.0/tini-{{ tini_architecture | default('amd64') }} && \
chmod +x /usr/bin/tini chmod +x /usr/bin/tini
RUN python3 -m ensurepip && pip3 install "virtualenv < 20" supervisor {% if build_dev|bool %}flake8{% endif %} && \ RUN python3 -m ensurepip && pip3 install "virtualenv < 20" supervisor {% if build_dev|bool %}flake8{% endif %}
pip3 install --no-cache-dir https://github.com/ansible/ansible/archive/${ANSIBLE_BRANCH}.tar.gz
# TODO: Remove this once launch script removes need for postres modules
RUN ansible-galaxy collection install --collections-path /usr/share/ansible/collections community.general community.postgresql
RUN rm -rf /root/.cache && rm -rf /tmp/* RUN rm -rf /root/.cache && rm -rf /tmp/*
@@ -185,7 +168,7 @@ COPY --from=builder /var/lib/awx /var/lib/awx
RUN ln -s /var/lib/awx/venv/awx/bin/awx-manage /usr/bin/awx-manage RUN ln -s /var/lib/awx/venv/awx/bin/awx-manage /usr/bin/awx-manage
{%if build_dev|bool %} {%if build_dev|bool %}
COPY --from=quay.io/shanemcd/receptor /usr/bin/receptor /usr/bin/receptor COPY --from=quay.io/shanemcd/receptor:latest /usr/bin/receptor /usr/bin/receptor
RUN openssl req -nodes -newkey rsa:2048 -keyout /etc/nginx/nginx.key -out /etc/nginx/nginx.csr \ RUN openssl req -nodes -newkey rsa:2048 -keyout /etc/nginx/nginx.key -out /etc/nginx/nginx.csr \
-subj "/C=US/ST=North Carolina/L=Durham/O=Ansible/OU=AWX Development/CN=awx.localhost" && \ -subj "/C=US/ST=North Carolina/L=Durham/O=Ansible/OU=AWX Development/CN=awx.localhost" && \
openssl x509 -req -days 365 -in /etc/nginx/nginx.csr -signkey /etc/nginx/nginx.key -out /etc/nginx/nginx.crt && \ openssl x509 -req -days 365 -in /etc/nginx/nginx.csr -signkey /etc/nginx/nginx.key -out /etc/nginx/nginx.crt && \
@@ -239,11 +222,6 @@ RUN for dir in \
/var/lib/awx/rsyslog/rsyslog.conf ; \ /var/lib/awx/rsyslog/rsyslog.conf ; \
do touch $file ; chmod g+rw $file ; chgrp root $file ; done do touch $file ; chmod g+rw $file ; chgrp root $file ; done
# Adjust any remaining permissions
RUN chmod u+s /usr/bin/bwrap ; \
chgrp -R root ${COLLECTION_BASE} ; \
chmod -R g+rw ${COLLECTION_BASE}
{% if (build_dev|bool) or (kube_dev|bool) %} {% if (build_dev|bool) or (kube_dev|bool) %}
RUN for dir in \ RUN for dir in \
/var/lib/awx/venv \ /var/lib/awx/venv \

View File

@@ -1,14 +1,6 @@
#!/bin/bash #!/bin/bash
set +x set +x
# Wait for the databases to come up
ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=postgres port=5432" all
ansible -i "127.0.0.1," -c local -v -m wait_for -a "path=/var/run/redis/redis.sock" all
# In case AWX in the container wants to connect to itself, use "docker exec" to attach to the container otherwise
# TODO: FIX
#/etc/init.d/ssh start
# Move to the source directory so we can bootstrap # Move to the source directory so we can bootstrap
if [ -f "/awx_devel/manage.py" ]; then if [ -f "/awx_devel/manage.py" ]; then
cd /awx_devel cd /awx_devel