From f944a3c6ee2fb997a05f891c1c40f5c2d0aba7c0 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 8 May 2023 10:20:02 +0930 Subject: [PATCH] chore: initial project files !3 --- .dockerignore | 2 ++ ansible.cfg | 4 ++++ dockerfile | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 .dockerignore create mode 100644 ansible.cfg create mode 100644 dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a03425c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.gitlab-ci.yml +README.md diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..047d6f8 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,4 @@ +[defaults] +collections_path=/etc/ansible/collections +roles_path=/etc/ansible/roles +log_path=/ansible.log diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..61f2dcd --- /dev/null +++ b/dockerfile @@ -0,0 +1,56 @@ +# docker pull python:3.9.16-slim-bullseye +# docker pull python:3.10.11-slim-bullseye + +FROM python:3.9.16-slim-bullseye as scratchpad + + +RUN apt update && \ + apt install --no-install-recommends -y \ + git + + +RUN git clone -b development --depth 1 https://gitlab.com/nofusscomputing/projects/ansible-roles.git /tmp/ansible-roles + + + +FROM python:3.9.16-slim-bullseye + +COPY --from=scratchpad /tmp/ansible-roles/roles /etc/ansible/roles + +# Ref: https://github.com/opencontainers/image-spec/blob/d86384efdb8c30770a92415c100f57a9bffbb64e/annotations.md + +LABEL \ + # org.opencontainers.image.authors="{contributor url}" \ + org.opencontainers.image.vendor="No Fuss Computing" \ + # org.opencontainers.image.url="{dockerhub url}" \ + # org.opencontainers.image.documentation="{docs url}" \ + # org.opencontainers.image.source="{repo url}" \ + # org.opencontainers.image.revision="{git commit sha at time of build}" \ + org.opencontainers.image.title="No Fuss Computings Ansible Execution Environment" \ + org.opencontainers.image.description="An ansible execution environment for awx/tower and CI/CD pipelines" \ + org.opencontainers.image.vendor="No Fuss Computing" \ + # org.opencontainers.image.version="{git tag}" + + +RUN apt update && \ + apt install --no-install-recommends -y \ + git \ + ssh && \ + rm -rf /var/lib/apt/lists/* && \ + mkdir -p /etc/ansible/roles && \ + mkdir -p /etc/ansible/collections && \ + mkdir -p /workdir + +WORKDIR /workdir + +COPY ansible.cfg /etc/ansible/ansible.cfg + + +RUN pip install --upgrade pip \ + && pip install \ + ansible \ + ansible-lint + +RUN ansible-galaxy collection install \ + awx.awx \ + kubernetes.core \ No newline at end of file