From 237471830480dc1845b19f61ce77cf80af53bf5e Mon Sep 17 00:00:00 2001 From: guenhter Date: Tue, 21 May 2024 06:55:12 +0200 Subject: [PATCH] Add support for ubuntu 24.04 with the latest ansible 2.16 --- .gitlab-ci.yml | 11 ++++++++ CHANGELOG.md | 4 +++ README.md | 1 + ansible-core/ubuntu2404/Dockerfile | 40 ++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 ansible-core/ubuntu2404/Dockerfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3d9a04b..9174507 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -249,3 +249,14 @@ build-ubuntu-2204: - docker push --all-tags "$DOCKER_HUB_REGISTRY_IMAGE" only: - tags + +build-ubuntu-2404: + stage: build + script: + - docker build --pull -t "$CI_REGISTRY_IMAGE:2.16-ubuntu-24.04" -t "$DOCKER_HUB_REGISTRY_IMAGE:2.16-ubuntu-24.04" -t "$CI_REGISTRY_IMAGE:$ANSIBLE_CORE_216-ubuntu-24.04" -t "$DOCKER_HUB_REGISTRY_IMAGE:$ANSIBLE_CORE_216-ubuntu-24.04" --build-arg ANSIBLE_CORE_VERSION=${ANSIBLE_CORE_216} --build-arg ANSIBLE_VERSION=${ANSIBLE_216} --build-arg ANSIBLE_LINT=${ANSIBLE_LINT_216} ansible-core/ubuntu2404/ + - docker push --all-tags "$CI_REGISTRY_IMAGE" + - docker logout + - docker login -u "$DOCKER_HUB_USERNAME" -p "$DOCKER_HUB_PASSWORD" + - docker push --all-tags "$DOCKER_HUB_REGISTRY_IMAGE" + only: + - tags diff --git a/CHANGELOG.md b/CHANGELOG.md index d4699d0..08ec5e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v5.0.3 + +- Add Ubuntu 24.04 + ## v5.0.2 - Remove Rocky Linux 10 (as that doesn't exist yet). diff --git a/README.md b/README.md index 3076cc6..6c6b9e9 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ This includes: | Bookworm Slim (Debian 12) | [Dockerfile](https://github.com/willhallonline/docker-ansible/blob/master/ansible-core/debian-bookworm-slim/Dockerfile) | | `2.14-bookworm-slim` | `2.15-bookworm-slim` | `2.16-bookworm-slim` | | Rocky Linux 9 | [Dockerfile](https://github.com/willhallonline/docker-ansible/blob/master/ansible-core/rocky9/Dockerfile) | | `2.14-rockylinux-9` | `2.15-rockylinux-9` | | | Ubuntu 22.04 | [Dockerfile](https://github.com/willhallonline/docker-ansible/blob/master/ansible-core/ubuntu2204/Dockerfile) | | `2.14-ubuntu-22.04` | `2.15-ubuntu-22.04` | `2.16-ubuntu-22.04` | +| Ubuntu 24.04 | [Dockerfile](https://github.com/willhallonline/docker-ansible/blob/master/ansible-core/ubuntu2404/Dockerfile) | | `2.16-ubuntu-24.04` | ### ARM Releases diff --git a/ansible-core/ubuntu2404/Dockerfile b/ansible-core/ubuntu2404/Dockerfile new file mode 100644 index 0000000..a7ef999 --- /dev/null +++ b/ansible-core/ubuntu2404/Dockerfile @@ -0,0 +1,40 @@ +FROM ubuntu:24.04 + +ARG ANSIBLE_CORE_VERSION +ARG ANSIBLE_VERSION +ARG ANSIBLE_LINT +ENV ANSIBLE_CORE_VERSION ${ANSIBLE_CORE_VERSION} +ENV ANSIBLE_VERSION ${ANSIBLE_VERSION} +ENV ANSIBLE_LINT ${ANSIBLE_LINT} +ENV PIPX_BIN_DIR=/usr/local/bin + +# Labels. +LABEL maintainer="will@willhallonline.co.uk" \ + org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.name="willhallonline/ansible" \ + org.label-schema.description="Ansible inside Docker" \ + org.label-schema.url="https://github.com/willhallonline/docker-ansible" \ + org.label-schema.vcs-url="https://github.com/willhallonline/docker-ansible" \ + org.label-schema.vendor="Will Hall Online" \ + org.label-schema.docker.cmd="docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/id_rsa willhallonline/ansible:2.16-ubuntu-24.04" + +RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ + apt-get install -y gnupg2 pipx sshpass git openssh-client && \ + apt-get install -y python3 python3-cffi python3-mitogen python3-jmespath && \ + rm -rf /var/lib/apt/lists/* && \ + apt-get clean + +RUN pipx install ansible-core==${ANSIBLE_CORE_VERSION} && \ + pipx install ansible==${ANSIBLE_VERSION} ansible-lint==${ANSIBLE_LINT} && \ + pipx install pywinrm --include-deps && \ + rm -rf /root/.cache/pip* + +RUN mkdir /ansible && \ + mkdir -p /etc/ansible && \ + echo 'localhost' > /etc/ansible/hosts + +WORKDIR /ansible + +CMD [ "ansible-playbook", "--version" ]