diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index 889ff87..734e3d7 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -105,11 +105,45 @@ jobs: --tag git.cryptic.systems/volker.raschek/ansible:${TAG}-rockylinux-9 \ . + push-rocky-linux-10: + runs-on: ubuntu-latest-amd64 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 + with: + registry: git.cryptic.systems + username: ${{ github.repository_owner }} + password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }} + + - uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 + with: + registry: harbor.cryptic.systems + username: ${{ secrets.HARBOR_CRYPTIC_SYSTEMS_USERNAME }} + password: ${{ secrets.HARBOR_CRYPTIC_SYSTEMS_PASSWORD }} + + - uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0 + with: + image: docker.io/tonistiigi/binfmt:qemu-v10.2.3 # renovate: datasource=docker registryUrl=https://docker.io depName=tonistiigi/binfmt extractVersion='qemu-(?v\d+\.\d+\.\d+)$' + + - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 + + - name: Build and push image + run: | + TAG=$(echo ${{ github.ref_name }} | sed 's/v//gm') + + docker buildx build \ + --file Dockerfile.rockylinux10 \ + --push \ + --tag git.cryptic.systems/volker.raschek/ansible:${TAG}-rockylinux-10 \ + . + sync-to-hub-docker-io: needs: - push-arch-linux - push-rocky-linux-8 - push-rocky-linux-9 + - push-rocky-linux-10 runs-on: ubuntu-latest steps: - name: Copy images to docker.io @@ -119,7 +153,7 @@ jobs: apt-get update --yes apt-get install --yes skopeo - for suffix in archlinux rockylinux-8 rockylinux-9; do + for suffix in archlinux rockylinux-8 rockylinux-9 rockylinux-10; do skopeo copy \ --all \ --dest-password ${{ secrets.DOCKER_IO_PASSWORD }} \ diff --git a/Dockerfile.rockylinux10 b/Dockerfile.rockylinux10 new file mode 100644 index 0000000..6255465 --- /dev/null +++ b/Dockerfile.rockylinux10 @@ -0,0 +1,36 @@ +FROM docker.io/library/rockylinux:10 + +RUN dnf update --assumeyes && \ + dnf install --assumeyes bash-completion sudo && \ + dnf install --assumeyes epel-release && \ + dnf install --assumeyes ansible-core && \ + dnf install --assumeyes python3.12 python3-boto3 python3-botocore && \ + dnf remove --assumeyes epel-release && \ + dnf clean all + +# We must change python to 3.12 (default 3.9), to be compliant with ansible-core. Furthermore, we must upgrade pip to +# latest version. Otherwise is still used pip for python 3.9. At least, we install boto3, which is required for the aws +# dynamic inventory manually, because the official python-boto3 package is for python 3.9. At least, we install +# ansible-lint via pip to be able to lint ansible roles. +RUN ln --symbolic --force /usr/bin/python3.12 /usr/bin/python3 && \ + curl --fail --silent --location https://bootstrap.pypa.io/get-pip.py --output get-pip.py && \ + python3 get-pip.py && \ + pip install ansible-lint boto3 passlib + +# Install Azure Client +RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc && \ + dnf install --assumeyes https://packages.microsoft.com/config/rhel/10.0/packages-microsoft-prod.rpm && \ + dnf update --assumeyes && \ + dnf install --assumeyes azure-cli + +# Create default ansible inventory file +RUN mkdir --parents /etc/ansible +RUN echo -e "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts + +# Remove unnecessary getty and udev targets that result in high CPU usage when +# using multiple containers with molecule +# (https://github.com/ansible/molecule/issues/1104) +RUN rm --recursive --force /lib/systemd/system/systemd*udev* && \ + rm --recursive --force /lib/systemd/system/getty.target + +VOLUME [ "/sys/fs/cgroup", "/tmp", "/run"] \ No newline at end of file diff --git a/Dockerfile.rockylinux9 b/Dockerfile.rockylinux9 index 446118a..c33d1a9 100644 --- a/Dockerfile.rockylinux9 +++ b/Dockerfile.rockylinux9 @@ -17,6 +17,12 @@ RUN ln --symbolic --force /usr/bin/python3.12 /usr/bin/python3 && \ python3 get-pip.py && \ pip install ansible-lint boto3 passlib +# Install Azure Client +RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc && \ + dnf install --assumeyes https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm && \ + dnf update --assumeyes && \ + dnf install --assumeyes azure-cli + # Create default ansible inventory file RUN mkdir --parents /etc/ansible RUN echo -e "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts diff --git a/Makefile b/Makefile index 4008bb5..4914508 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,15 @@ ANSIBLE_RL9_IMAGE_VERSION?=latest ANSIBLE_RL9_IMAGE_VERSION_SUFFIX=rockylinux-9 ANSIBLE_RL9_IMAGE_FULLY_QUALIFIED=${ANSIBLE_RL9_IMAGE_REGISTRY_HOST}/${ANSIBLE_RL9_IMAGE_NAMESPACE}/${ANSIBLE_RL9_IMAGE_REPOSITORY}:${ANSIBLE_RL9_IMAGE_VERSION}-${ANSIBLE_RL9_IMAGE_VERSION_SUFFIX} +# RockyLinux9 +ANSIBLE_RL10_IMAGE_REGISTRY_HOST?=git.cryptic.systems +ANSIBLE_RL10_IMAGE_REGISTRY_USER?=volker.raschek +ANSIBLE_RL10_IMAGE_NAMESPACE?=${ANSIBLE_RL8_IMAGE_REGISTRY_USER} +ANSIBLE_RL10_IMAGE_REPOSITORY:=ansible +ANSIBLE_RL10_IMAGE_VERSION?=latest +ANSIBLE_RL10_IMAGE_VERSION_SUFFIX=rockylinux-10 +ANSIBLE_RL10_IMAGE_FULLY_QUALIFIED=${ANSIBLE_RL10_IMAGE_REGISTRY_HOST}/${ANSIBLE_RL10_IMAGE_NAMESPACE}/${ANSIBLE_RL10_IMAGE_REPOSITORY}:${ANSIBLE_RL10_IMAGE_VERSION}-${ANSIBLE_RL10_IMAGE_VERSION_SUFFIX} + # BUILD ANSIBLE ARCHLINUX CONTAINER IMAGE # ============================================================================== PHONY:=container-image/build/arch-linux @@ -102,6 +111,30 @@ container-image/push/rocky-linux-9: echo ${ANSIBLE_ARCH_IMAGE_REGISTRY_PASSWORD} | ${CONTAINER_RUNTIME} login ${ANSIBLE_ARCH_IMAGE_REGISTRY_HOST} --username ${ANSIBLE_ARCH_IMAGE_REGISTRY_USER} --password-stdin ${CONTAINER_RUNTIME} push ${ANSIBLE_ARCH_IMAGE_FULLY_QUALIFIED} +# BUILD ANSIBLE RL10 CONTAINER IMAGE +# ============================================================================== +PHONY:=container-image/build/rocky-linux-10 +container-image/build/rocky-linux-10: + ${CONTAINER_RUNTIME} build \ + --file Dockerfile.rockylinux10 \ + --no-cache \ + --pull \ + --tag ${ANSIBLE_RL10_IMAGE_FULLY_QUALIFIED} \ + . + +# DELETE ANSIBLE RL10 CONTAINER IMAGE +# ============================================================================== +PHONY:=container-image/delete/rocky-linux-10 +container-image/delete/rocky-linux-10: + - ${CONTAINER_RUNTIME} image rm ${ANSIBLE_RL10_IMAGE_FULLY_QUALIFIED} + +# PUSH ANSIBLE RL10 CONTAINER IMAGE +# ============================================================================== +PHONY+=container-image/push/rocky-linux-10 +container-image/push/rocky-linux-10: + echo ${ANSIBLE_ARCH_IMAGE_REGISTRY_PASSWORD} | ${CONTAINER_RUNTIME} login ${ANSIBLE_ARCH_IMAGE_REGISTRY_HOST} --username ${ANSIBLE_ARCH_IMAGE_REGISTRY_USER} --password-stdin + ${CONTAINER_RUNTIME} push ${ANSIBLE_ARCH_IMAGE_FULLY_QUALIFIED} + # PHONY # ============================================================================== # Declare the contents of the PHONY variable as phony. We keep that information