diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 70ccb31..2ebbe27 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,7 +8,7 @@ variables: DOCKER_IMAGE_PUBLISH_NAME: 'ansible-ee' DOCKER_IMAGE_PUBLISH_REGISTRY: docker.io/nofusscomputing DOCKER_IMAGE_PUBLISH_URL: https://hub.docker.com/r/nofusscomputing/$DOCKER_IMAGE_PUBLISH_NAME - PAGES_ENVIRONMENT_PATH: projects/execution_environment/ + PAGES_ENVIRONMENT_PATH: projects/ansible/execution_environment/ include: - project: nofusscomputing/projects/gitlab-ci @@ -27,6 +27,7 @@ Build/Cache Python Packages: - name: docker:23-dind entrypoint: ["env", "-u", "DOCKER_HOST"] command: ["dockerd-entrypoint.sh"] + needs: [] variables: DOCKER_HOST: tcp://docker:2375/ DOCKER_DRIVER: overlay2 @@ -49,7 +50,8 @@ Build/Cache Python Packages: --platform=$DOCKER_IMAGE_BUILD_TARGET_PLATFORMS . \ --build-arg CI_JOB_TOKEN=$CI_JOB_TOKEN \ --build-arg CI_API_V4_URL=$CI_API_V4_URL \ - --build-arg CI_PROJECT_ID=$CI_PROJECT_ID + --build-arg CI_PROJECT_ID=$CI_PROJECT_ID \ + --progress plain rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' when: never diff --git a/dockerfile b/dockerfile index 56ab4f6..f2ca644 100644 --- a/dockerfile +++ b/dockerfile @@ -2,7 +2,7 @@ FROM --platform=$TARGETPLATFORM quay.io/ansible/receptor:devel as receptor -FROM --platform=$TARGETPLATFORM python:3.11-bullseye +FROM --platform=$TARGETPLATFORM python:3.11-slim-bookworm # Ansible chucks a wobbler without. see: https://github.com/ansible/ansible/issues/78283 ENV LC_ALL en_US.UTF-8 @@ -11,7 +11,7 @@ ENV DEBIAN_FRONTEND noninteractive ENV ANSIBLE_PLAYBOOK_DIR=/etc/ansible/playbooks -ENV ANSIBLE_COLLECTIONS_PATHS=/etc/ansible/collections +ENV ANSIBLE_COLLECTIONS_PATH=/etc/ansible/collections COPY includes / @@ -36,10 +36,10 @@ RUN apt update \ && cd /tmp \ && apt-get download \ libc-bin \ - && dpkg --extract ./libc-bin_*.deb /tmp/deb \ + && dpkg --extract $(ls | grep libc-bin_ | grep -a '.deb') /tmp/deb \ && cp /tmp/deb/sbin/ldconfig /sbin/ \ && rm -Rf /tmp/deb \ - && rm libc-bin_*.deb \ + && rm $(ls | grep libc-bin_ | grep -a '.deb') \ && apt-get install --reinstall \ libc-bin \ # EoF fixing dpkg ldconfig not found error @@ -57,6 +57,7 @@ RUN apt update \ postgresql-common \ postgresql-client \ mariadb-client \ + mariadb-client-core \ && mkdir -p /etc/ansible/roles \ && mkdir -p /etc/ansible/collections \ && mkdir -p /workdir \ @@ -83,15 +84,15 @@ RUN pip install --index-url https://gitlab.com/api/v4/projects/45741845/packages RUN ansible-galaxy collection install \ - awx.awx==23.5.0 \ + awx.awx==23.6.0 \ # ansible.posix.authorized_key for SSH ansible.posix==1.5.4 \ ansible.utils==3.0.0 \ - community.dns==2.6.4 \ + community.dns==2.7.0 \ # docker managment - community.docker==3.4.11 \ + community.docker==3.5.0 \ # community.general.gitlab_* - community.general==8.1.0 \ + community.general==8.2.0 \ community.mysql==3.8.0 \ - community.postgresql==3.2.0 \ + community.postgresql==3.3.0 \ kubernetes.core==3.0.0 diff --git a/dockerfile-build_cache b/dockerfile-build_cache index e35d9a6..7f8a3ff 100644 --- a/dockerfile-build_cache +++ b/dockerfile-build_cache @@ -1,4 +1,4 @@ -FROM --platform=$TARGETPLATFORM python:3.11-slim-bookworm as wheelbuild +FROM --platform=$TARGETPLATFORM python:3.11-bookworm as wheelbuild ARG CI_JOB_TOKEN ARG CI_API_V4_URL @@ -6,62 +6,91 @@ ARG CI_PROJECT_ID ENV LC_ALL en_US.UTF-8 + ENV PATH /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.cargo/bin::~/.cargo/bin -RUN export DEBIAN_FRONTEND=noninteractive \ - && dpkg-reconfigure debconf -f noninteractive +ENV DEBIAN_FRONTEND noninteractive -RUN apt update \ - && apt install --reinstall -yq \ - git \ + +RUN dpkg-reconfigure debconf -f noninteractive + + +RUN apt update + +# SoF fixing dpkg ldconfig not found error +# Download Binary +RUN cd /tmp \ + && apt-get download \ + libc-bin + +RUN ls -la + +# Extract Binary +RUN cd /tmp; \ + dpkg --extract $(ls | grep libc-bin_ | grep -a '.deb') /tmp/deb; ls -laR + +# # Extracted? +# RUN ls -laR + +# Copy to home location +RUN cp /tmp/deb/sbin/ldconfig /sbin/ + +# Confirm present +RUN ls -l /sbin/ldconfig + +# Confirm can be found +RUN which ldconfig + +# Cleanup +# RUN rm -Rf /tmp/deb \ +# && rm libc-bin_*.deb + +# Should re-install without issue +RUN apt-get install --reinstall \ + libc-bin +# EoF fixing dpkg ldconfig not found error +# Set Locale to en_US as ansible requires a locale for it to function without chucking a tantrum!! + + +RUN apt install -yq \ + build-essential \ + cargo \ curl \ - rustc cargo \ - libpq-dev || true - - -RUN mkdir -p /tmp/python_modules /tmp/python_builds + git \ + libffi-dev \ + libpq-dev \ + libssl-dev \ + mariadb-client \ + mariadb-client-core \ + openssh-client \ + pkg-config \ + postgresql-client \ + postgresql-common \ + python3-dev \ + rustc RUN rustc --version \ && cargo --version -RUN export DEBIAN_FRONTEND=noninteractive \ - && apt update \ - && apt --fix-broken install \ - && apt install -y libc-bin locales-all \ - && apt update \ - && apt install --reinstall -yq \ - openssh-client \ - git || true \ - && dpkg --purge --force-all libc-bin \ - && apt-get install -y \ - openssh-client \ - git - - -RUN export DEBIAN_FRONTEND=noninteractive \ - && apt update \ - && apt install --no-install-recommends -yq libc-bin locales-all \ - && apt-get install --reinstall -yq \ - build-essential \ - libssl-dev \ - libffi-dev \ - python3-dev \ - cargo \ - pkg-config \ - libpq-dev || true RUN pip install --upgrade pip + RUN pip install --upgrade \ setuptools \ wheel \ setuptools-rust \ twine + COPY requirements.txt /tmp/requirements.txt + +RUN mkdir -p /tmp/python_modules /tmp/python_builds + + RUN cd /tmp/python_modules \ && pip download --dest . --check-build-dependencies \ -r /tmp/requirements.txt @@ -70,7 +99,11 @@ RUN cd /tmp/python_modules \ RUN cd /tmp/python_modules \ # && export PATH=$PATH:~/.cargo/bin \ && echo "[DEBUG] PATH=$PATH" \ - && pip wheel --wheel-dir /tmp/python_builds --find-links . *.whl + && pip wheel --wheel-dir /tmp/python_builds --find-links . *.whl; \ + pip wheel --wheel-dir /tmp/python_builds --find-links . *.tar.gz; + +RUN cd /tmp; \ + ls -laR RUN TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --verbose --skip-existing --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi /tmp/python_builds/* diff --git a/docs/projects/execution_environment/index.md b/docs/projects/ansible/execution_environment/index.md similarity index 96% rename from docs/projects/execution_environment/index.md rename to docs/projects/ansible/execution_environment/index.md index 9a162ae..c5c9777 100644 --- a/docs/projects/execution_environment/index.md +++ b/docs/projects/ansible/execution_environment/index.md @@ -8,9 +8,9 @@ about: https://gitlab.com/nofusscomputing/projects/ansible/execution_environment This docker container is designed to be used with Ansible AWX/Tower or from within the Gitlab CI/CD Environment. Included in the container are the following projects from us: -- [Ansible Playbooks](../ansible_playbooks/index.md) +- [Ansible Playbooks](../playbooks/index.md) -- [Ansible Roles](../ansible-roles/index.md) +- [Ansible Roles](../roles/index.md) This container can be found at dockerhub at and for use from docker with `docker pull nofusscomputing/ansible-ee`. versioning and git tags are in accordance with semver. diff --git a/docs/projects/ansible-roles/index.md b/docs/projects/ansible/index.md similarity index 100% rename from docs/projects/ansible-roles/index.md rename to docs/projects/ansible/index.md diff --git a/docs/projects/ansible_playbooks/index.md b/docs/projects/ansible/playbooks/index.md similarity index 100% rename from docs/projects/ansible_playbooks/index.md rename to docs/projects/ansible/playbooks/index.md diff --git a/docs/projects/ansible/roles/index.md b/docs/projects/ansible/roles/index.md new file mode 100644 index 0000000..e69de29 diff --git a/mkdocs.yml b/mkdocs.yml index d0d7fb0..100dc4f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -17,11 +17,18 @@ nav: - projects/index.md - - Ansible Roles: + - Ansible: + + - projects/ansible/index.md - Execution Environment: - - projects/execution_environment/index.md + - projects/ansible/execution_environment/index.md + + - Playbooks: projects/ansible/playbooks/index.md + + - Roles: projects/ansible/roles/index.md + - Operations: diff --git a/requirements.txt b/requirements.txt index cc27f24..cb1a207 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,14 @@ ansible-core==2.16.1 ansible-lint==6.15.0 ansible-runner==2.3.4 -awxkit==23.5.1 +awxkit==23.6.0 # Required for community.general.gitlab_* -python_gitlab==3.14.0 +python_gitlab==4.3.0 # community.postgresql psycopg2==2.9.9 # community.mysql PyMySQL==1.1.0 -dnspython +dnspython==2.4.2 -xmltodict==0.13.0 \ No newline at end of file +xmltodict==0.13.0