From b9ac6ef205311c7410cb48d84e6a0b59dcfc56e7 Mon Sep 17 00:00:00 2001 From: Macley <26381427+Macleykun@users.noreply.github.com> Date: Sat, 1 Feb 2025 23:00:35 +0100 Subject: [PATCH] customize and see if this entrypoint works swell --- .github/release.yml | 18 ------------------ .github/renovate.json | 6 ------ .github/workflows/container.yml | 27 --------------------------- Dockerfile | 18 +++++++++--------- requirements/ansible.yaml | 5 ++++- requirements/pip.list | 7 ++----- 6 files changed, 15 insertions(+), 66 deletions(-) delete mode 100644 .github/release.yml delete mode 100644 .github/renovate.json delete mode 100644 .github/workflows/container.yml diff --git a/.github/release.yml b/.github/release.yml deleted file mode 100644 index cd97cac..0000000 --- a/.github/release.yml +++ /dev/null @@ -1,18 +0,0 @@ -changelog: - exclude: - authors: - - renovate[bot] - categories: - - title: Breaking Changes 🛠 - labels: - - breaking-change - - major - - title: Features 🎉 - labels: - - enhancement - - feat - - feature - - minor - - title: Other Changes - labels: - - "*" diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index d182a9f..0000000 --- a/.github/renovate.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": [ - "github>justsomescripts/common-actions//.github/renovate-common#main", - ":semanticCommits" - ] -} diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml deleted file mode 100644 index 01a0291..0000000 --- a/.github/workflows/container.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Build Container Image - -on: - pull_request: - branches: - - main - types: - - closed - schedule: - - cron: '0 4 * * 0' - workflow_dispatch: - -jobs: - build-container: - uses: justsomescripts/github-common-actions/.github/workflows/container.build.yml@main - secrets: inherit - with: - containerfile: Containerfile - enable_cosign: false - push_ghcr: true - push_dockerhub: true - push_quay: true - permissions: - checks: write - contents: write - packages: write - security-events: write diff --git a/Dockerfile b/Dockerfile index 6971414..0e554c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,24 +18,22 @@ FROM python:alpine WORKDIR /runner/ # Add non-root user - ARG USER=ansible - ARG GROUP=ansible - ARG UID=1000 - ARG GID=1000 + ARG USER=ansible && \ + GROUP=ansible && \ + UID=1000 && \ + GID=1000 RUN addgroup ${GROUP} --gid ${GID} && \ adduser ${USER} --uid ${UID} \ --ingroup "${GROUP}" \ --disabled-password && \ - chown ${USER}:${GROUP} /runner/ - - RUN chmod 777 /runner/ /home/ansible/ + chown ${USER}:${GROUP} /runner/ /home/"${USER}"/ # Add requirements COPY requirements/apk.list requirements/pip.list requirements/ansible.yaml /requirements/ RUN apk add --update --no-cache $(cat /requirements/apk.list) && \ ln -s /usr/local/bin/python3 /usr/bin/python3 && \ - pip install --upgrade --no-cache-dir $(grep ansible-core /requirements/pip.list) + pip install --upgrade --no-cache-dir $(grep ansible-core /requirements/pip.list) # Needed for ansible-navigator # Copy python environment (Ansible required args and scripts) ENV PATH=/opt/ansible_venv/bin:${PATH} \ @@ -57,7 +55,9 @@ FROM python:alpine --requirements-file /requirements/ansible.yaml --collections-path "/usr/share/ansible/collections" && \ chmod -R a=rX /usr/share/ansible - ENV HOME=/home/ansible + ENV HOME=/home/"${USER}" # Switch to non-root user USER ${UID}:${GID} + + ENTRYPOINT ["ansible --version && pip list && ansible-galaxy collection list && ansible-galaxy role list"] \ No newline at end of file diff --git a/requirements/ansible.yaml b/requirements/ansible.yaml index a3e7dfd..295a6f9 100644 --- a/requirements/ansible.yaml +++ b/requirements/ansible.yaml @@ -1,4 +1,7 @@ --- collections: - name: community.general - - name: ansible.windows + - name: containers.podman + - name: ansible.posix +# - name: community.mysql +# - name: community.crypto \ No newline at end of file diff --git a/requirements/pip.list b/requirements/pip.list index a69b004..b096198 100644 --- a/requirements/pip.list +++ b/requirements/pip.list @@ -1,5 +1,2 @@ -ansible-core==2.18.1 -ansible-runner -dnspython -pypsrp -requests \ No newline at end of file +ansible-core +ansible-runner \ No newline at end of file