Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ubuntu 24.04 with the latest ansible 2.16 #78

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
40 changes: 40 additions & 0 deletions ansible-core/ubuntu2404/Dockerfile
Original file line number Diff line number Diff line change
@@ -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="[email protected]" \
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 && \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@willhallonline If you want me to use pip instead for this packages, I can change it.

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" ]