From 46254976f266ab1e098098b771eb10b420a5d1c6 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Fri, 13 Nov 2026 07:21:13 -0700 Subject: [PATCH] ci: use ubuntu 26.04 with podman 5.x and disable apparmor restriction Both ansible-test 2.22 and bootc related workflows that use podman have permission issues related to AppArmor. Use ubuntu 26.04 and disable both AppArmor and the unprivileged_userns restriction for those workflows, and use podman instead of docker for ansible-test. The bootc tests already use podman. The python 3.14 in ubuntu-26.04 does not have python requests so ensure it exists. Signed-off-by: Rich Megginson --- .github/workflows/actions.lock | 2 +- .github/workflows/ansible-lint.yml | 2 +- .../workflows/ansible-managed-var-comment.yml | 2 +- .github/workflows/ansible-test.yml | 26 +++++++++---------- .github/workflows/build_docs.yml | 8 +++--- .github/workflows/python-unit-test.yml | 2 +- .../workflows/qemu-kvm-integration-tests.yml | 15 ++++++++++- 7 files changed, 34 insertions(+), 23 deletions(-) diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock index 2063b40..adeaf14 100644 --- a/.github/workflows/actions.lock +++ b/.github/workflows/actions.lock @@ -110,7 +110,7 @@ dependencies: repo_id: 259445878 'linux-system-roles/.github@main': ref: 'main' - commit: 'sha1-6a871b700c52584c272c33029b1bdd62a0e474cb' + commit: 'sha1-c685ee6b59776f177edf523bf4eab71c8ee195eb' owner_id: 28014670 repo_id: 320092621 'sclorg/testing-farm-as-github-action@v4.3.1': diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index dd6056e..e9d0713 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -68,7 +68,7 @@ jobs: - name: Install tox, tox-lsr run: | set -euxo pipefail - pip3 install "git+https://github.com/linux-system-roles/tox-lsr@b30596c6fd1863b2eed20206ef32d13eac478e18" + pip3 install "git+https://github.com/linux-system-roles/tox-lsr@241b655430b2fa3c2406b6d2a1190c9febb34b5b" - name: Set up Python uses: actions/setup-python@v7.1.0 diff --git a/.github/workflows/ansible-managed-var-comment.yml b/.github/workflows/ansible-managed-var-comment.yml index dea01f6..6e52377 100644 --- a/.github/workflows/ansible-managed-var-comment.yml +++ b/.github/workflows/ansible-managed-var-comment.yml @@ -57,7 +57,7 @@ jobs: - name: Install tox, tox-lsr run: | set -euxo pipefail - pip3 install "git+https://github.com/linux-system-roles/tox-lsr@b30596c6fd1863b2eed20206ef32d13eac478e18" + pip3 install "git+https://github.com/linux-system-roles/tox-lsr@241b655430b2fa3c2406b6d2a1190c9febb34b5b" - name: Run ansible-plugin-scan run: | diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml index 47a6307..ddc811a 100644 --- a/.github/workflows/ansible-test.yml +++ b/.github/workflows/ansible-test.yml @@ -71,7 +71,7 @@ jobs: - name: Install tox, tox-lsr run: | set -euxo pipefail - pip3 install "git+https://github.com/linux-system-roles/tox-lsr@b30596c6fd1863b2eed20206ef32d13eac478e18" + pip3 install "git+https://github.com/linux-system-roles/tox-lsr@241b655430b2fa3c2406b6d2a1190c9febb34b5b" - name: Set up Python uses: actions/setup-python@v7.1.0 @@ -81,25 +81,23 @@ jobs: - name: Convert role to collection format run: tox -e collection + # https://bugs.launchpad.net/ubuntu/+source/podman/+bug/2154379 + # https://lists.ubuntu.com/archives/apparmor/2026-January/013962.html + - name: Disable AppArmor and unprivileged_userns restriction and use podman for docker + if: matrix.versions.ansible == '2-22' + run: | + sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 + sudo apt install -y podman-docker apparmor-utils + # disable AppArmor + sudo aa-teardown + sudo aa-status && echo ERROR: failed to disable AppArmor || echo INFO: AppArmor disabled + - name: Run ansible-test - if: matrix.versions.ansible != '2-22' run: | tox \ -x testenv:ansible-test-${{ matrix.versions.ansible }}.basepython="python${{ matrix.versions.python }}" \ -e ansible-test-${{ matrix.versions.ansible }} - # https://bugs.launchpad.net/ubuntu/+source/podman/+bug/2154379 - - name: Run ansible-test 2.22 without a container - if: matrix.versions.ansible == '2-22' - run: | - set -euo pipefail - python -m pip install 'ansible-core==2.22.*' - tempdir=$(mktemp -d) - trap 'rm -rf "$tempdir"' EXIT - cp -a .tox/ansible_collections "$tempdir/" - cd "$tempdir/ansible_collections/fedora/linux_system_roles" - ansible-test sanity - - name: Set final commit status if: always() && github.event_name == 'issue_comment' && steps.head_sha_context.outputs.head_sha != '' uses: linux-system-roles/.github/github-actions/commit-status@main diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 01f1e12..574d0e9 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -91,8 +91,8 @@ jobs: if [ -z "${existed_in_remote}" ]; then echo "Creating $branch branch" - git config --global user.name "${{ github.actor }}" - git config --global user.email "${{ github.actor }}@users.noreply.github.com" + git config --global user.name "$GITHUB_ACTOR" + git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" git checkout --orphan $branch git reset --hard git commit --allow-empty -m "Initializing $branch branch" @@ -140,8 +140,8 @@ jobs: - name: Commit changes run: | - git config --global user.name "${{ github.actor }}" - git config --global user.email "${{ github.actor }}@users.noreply.github.com" + git config --global user.name "$GITHUB_ACTOR" + git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" git add ${{ env.RELEASE_VERSION }}/README.html docs/index.html git commit -m "Update README.html for ${{ env.RELEASE_VERSION }}" diff --git a/.github/workflows/python-unit-test.yml b/.github/workflows/python-unit-test.yml index d192f58..e6079b3 100644 --- a/.github/workflows/python-unit-test.yml +++ b/.github/workflows/python-unit-test.yml @@ -94,7 +94,7 @@ jobs: tox=tox virtualenv=virtualenv fi - pip install "$tox" "$virtualenv" "git+https://github.com/linux-system-roles/tox-lsr@b30596c6fd1863b2eed20206ef32d13eac478e18" + pip install "$tox" "$virtualenv" "git+https://github.com/linux-system-roles/tox-lsr@241b655430b2fa3c2406b6d2a1190c9febb34b5b" # If you have additional OS dependency packages e.g. libcairo2-dev # then put them in .github/config/ubuntu-requirements.txt, one # package per line. diff --git a/.github/workflows/qemu-kvm-integration-tests.yml b/.github/workflows/qemu-kvm-integration-tests.yml index 18aa325..cb24b5c 100644 --- a/.github/workflows/qemu-kvm-integration-tests.yml +++ b/.github/workflows/qemu-kvm-integration-tests.yml @@ -141,7 +141,7 @@ jobs: python3 -m pip install --upgrade pip sudo apt update sudo apt install -y --no-install-recommends git ansible-core genisoimage qemu-system-x86 qemu-utils - pip3 install "git+https://github.com/linux-system-roles/tox-lsr@b30596c6fd1863b2eed20206ef32d13eac478e18" + pip3 install "git+https://github.com/linux-system-roles/tox-lsr@241b655430b2fa3c2406b6d2a1190c9febb34b5b" - name: Check for podman version 5 or higher id: check_podman_version @@ -166,6 +166,17 @@ jobs: curl -o ~/.config/linux-system-roles.json https://raw.githubusercontent.com/linux-system-roles/linux-system-roles.github.io/master/download/linux-system-roles.json + # https://bugs.launchpad.net/ubuntu/+source/podman/+bug/2154379 + # https://lists.ubuntu.com/archives/apparmor/2026-January/013962.html + - name: Disable AppArmor and unprivileged_userns restriction + if: steps.check_platform.outputs.supported && startsWith(matrix.scenario.env, 'container') + run: | + sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 + # disable AppArmor + sudo apt install -y apparmor-utils + sudo aa-teardown + sudo aa-status && echo ERROR: failed to disable AppArmor || echo INFO: AppArmor disabled + - name: Run qemu integration tests if: steps.check_platform.outputs.supported && startsWith(matrix.scenario.env, 'qemu') run: >- @@ -257,6 +268,8 @@ jobs: if: steps.check_platform.outputs.supported && failure() run: | set -euo pipefail + # ensure python3-requests for check_logs + sudo apt install -y python3-requests # grab check_logs.py script curl -s -L -o check_logs.py https://raw.githubusercontent.com/linux-system-roles/auto-maintenance/refs/heads/main/check_logs.py chmod +x check_logs.py