From 63879b91be2ac0fb92a90d76c4f6cd679646534f Mon Sep 17 00:00:00 2001 From: Kyle Lexmond Date: Sun, 22 Dec 2024 06:26:40 +0000 Subject: [PATCH] Add my own docker images of fedora 40 & 41 --- .github/workflows/ci.yml | 43 +++++++++++++++++++++++++++++++++++++- tests/fedora-40.Dockerfile | 39 ++++++++++++++++++++++++++++++++++ tests/fedora-41.Dockerfile | 39 ++++++++++++++++++++++++++++++++++ 3 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 tests/fedora-40.Dockerfile create mode 100644 tests/fedora-41.Dockerfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b9ac4ac..d71a1b81 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,6 @@ jobs: - "centos:stream9" - "fedora:38" - "fedora:39" - - "fedora:40" - "almalinux:9" - "rockylinux:9" @@ -120,3 +119,45 @@ jobs: find /etc/openvpn/ -maxdepth 3 -name openvpn_udp_1194.conf -type f -exec cat {} \; echo "cat alpha-*.ovpn" find /etc/openvpn/ -maxdepth 3 -name "alpha-*.ovpn" -type f -exec cat {} \; + + # diodonfrost's images are broken for fedora 40 (thinks it's rawhide) and fedora 41 doesn't exist, so I built my own + build-broken-fedora: + runs-on: ubuntu-latest + name: fedora-${{ matrix.version }} + needs: + - check-syntax + strategy: + fail-fast: false + matrix: + version: + - "fedora:40" + - "fedora:41" + container: + image: ghcr.io/kyl191/ansible-${{ matrix.version }} + env: + container: docker + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup + - ${{ github.workspace }}:/etc/ansible/roles/ansible-role-openvpn + options: "--cap-add NET_ADMIN --cap-add SYS_ADMIN --device /dev/net/tun" + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup ansible.posix collection for firewalld + run: ansible-galaxy collection install ansible.posix + - name: Setup community.general collection for ufw + run: ansible-galaxy collection install community.general + - name: Make sure ansible connection is sane + run: ansible -m setup -c local -i 127.0.0.1, all + - name: Run ansible playbook + run: ansible-playbook /etc/ansible/roles/ansible-role-openvpn/tests/test.yml -vv + - name: Check idempotency + run: ansible-playbook /etc/ansible/roles/ansible-role-openvpn/tests/test.yml -vv + - name: Container state debug output + continue-on-error: true + run: | + ls -lR /etc/openvpn + echo "cat openvpn_udp_1194.conf" + find /etc/openvpn/ -maxdepth 3 -name openvpn_udp_1194.conf -type f -exec cat {} \; + echo "cat alpha-*.ovpn" + find /etc/openvpn/ -maxdepth 3 -name "alpha-*.ovpn" -type f -exec cat {} \; diff --git a/tests/fedora-40.Dockerfile b/tests/fedora-40.Dockerfile new file mode 100644 index 00000000..5cde8a30 --- /dev/null +++ b/tests/fedora-40.Dockerfile @@ -0,0 +1,39 @@ +FROM fedora:40 +LABEL org.opencontainers.image.source=https://github.com/kyl191/ansible-role-openvpn +LABEL org.opencontainers.image.title="Fedora 40 with Ansible" +LABEL org.opencontainers.image.description="Fedora 40 with Ansible, duplicate of https://github.com/diodonfrost/docker-ansible/blob/master/fedora-ansible/Dockerfile.fedora-40, just rebuilt so it's not using the rawhide release" + +# Update Fedora +RUN dnf -y update && dnf clean all + +# Install systemd +RUN dnf -y install systemd && dnf clean all; \ +(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ +rm -f /lib/systemd/system/multi-user.target.wants/*; \ +rm -f /etc/systemd/system/*.wants/*; \ +rm -f /lib/systemd/system/local-fs.target.wants/*; \ +rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ +rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ +rm -f /lib/systemd/system/basic.target.wants/*; \ +rm -f /lib/systemd/system/anaconda.target.wants/*; + +RUN dnf -y install \ + git \ + ansible \ + sudo \ + which \ + openssh-server openssh-clients \ + findutils \ + unzip \ + rsync \ + libxcrypt-compat \ + fuse-libs \ + && dnf clean all + +RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers + +RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts + +VOLUME ["/sys/fs/cgroup"] + +CMD ["/usr/sbin/init"] diff --git a/tests/fedora-41.Dockerfile b/tests/fedora-41.Dockerfile new file mode 100644 index 00000000..0d6d2f37 --- /dev/null +++ b/tests/fedora-41.Dockerfile @@ -0,0 +1,39 @@ +FROM fedora:41 +LABEL org.opencontainers.image.source=https://github.com/kyl191/ansible-role-openvpn +LABEL org.opencontainers.image.title="Fedora 41 with Ansible" +LABEL org.opencontainers.image.description="Fedora 41 with Ansible, based off https://github.com/diodonfrost/docker-ansible/blob/master/fedora-ansible/Dockerfile.fedora-40" + +# Update Fedora +RUN dnf -y update && dnf clean all + +# Install systemd +RUN dnf -y install systemd && dnf clean all; \ +(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ +rm -f /lib/systemd/system/multi-user.target.wants/*; \ +rm -f /etc/systemd/system/*.wants/*; \ +rm -f /lib/systemd/system/local-fs.target.wants/*; \ +rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ +rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ +rm -f /lib/systemd/system/basic.target.wants/*; \ +rm -f /lib/systemd/system/anaconda.target.wants/*; + +RUN dnf -y install \ + git \ + ansible \ + sudo \ + which \ + openssh-server openssh-clients \ + findutils \ + unzip \ + rsync \ + libxcrypt-compat \ + fuse-libs \ + && dnf clean all + +RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers + +RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts + +VOLUME ["/sys/fs/cgroup"] + +CMD ["/usr/sbin/init"]