From 43b2a013615bee83b1d3dc8aec7b58f76fca3ac5 Mon Sep 17 00:00:00 2001 From: Emil Simeonov Date: Sat, 20 Jun 2026 21:12:43 +0200 Subject: [PATCH] fix: use systemd as container command for rootless molecule tests Rootless Docker requires loginctl enable-linger and systemctl --user, which need systemd as PID 1 inside the container. Updated all platform entries to use /lib/systemd/systemd (or /usr/lib/systemd/systemd for Arch) as the container command instead of sleep infinity. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- scripts/distribute_molecule.py | 7 ++++--- scripts/molecule_all.sh | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/distribute_molecule.py b/scripts/distribute_molecule.py index 570073a..c95a682 100644 --- a/scripts/distribute_molecule.py +++ b/scripts/distribute_molecule.py @@ -31,10 +31,11 @@ MOLECULE_ROOT = Path("ansible/roles/gitea-runner/molecule") #: Supported OS platform matrix. #: Each entry maps a short name to (image, command). +#: The command must be systemd since rootless Docker requires loginctl/systemctl --user. PLATFORMS: list[dict[str, str]] = [ - {"name": "ubuntu-2204", "image": "geerlingguy/docker-ubuntu2204-ansible:latest", "command": ""}, - {"name": "ubuntu-2404", "image": "geerlingguy/docker-ubuntu2404-ansible:latest", "command": ""}, - {"name": "debian-12", "image": "geerlingguy/docker-debian12-ansible:latest", "command": ""}, + {"name": "ubuntu-2204", "image": "geerlingguy/docker-ubuntu2204-ansible:latest", "command": "/lib/systemd/systemd"}, + {"name": "ubuntu-2404", "image": "geerlingguy/docker-ubuntu2404-ansible:latest", "command": "/lib/systemd/systemd"}, + {"name": "debian-12", "image": "geerlingguy/docker-debian12-ansible:latest", "command": "/lib/systemd/systemd"}, {"name": "archlinux", "image": "marcstraube/archlinux-ansible:latest", "command": "/usr/lib/systemd/systemd"}, ] diff --git a/scripts/molecule_all.sh b/scripts/molecule_all.sh index 051a594..0942502 100755 --- a/scripts/molecule_all.sh +++ b/scripts/molecule_all.sh @@ -7,9 +7,9 @@ MOLECULE_BIN="$(realpath "${BIN:-.venv/bin}/molecule")" ROLE_DIR="$(cd "$(dirname "$0")/.." && pwd)/ansible/roles/gitea-runner" for p in \ - ubuntu-2204:geerlingguy/docker-ubuntu2204-ansible:latest: \ - ubuntu-2404:geerlingguy/docker-ubuntu2404-ansible:latest: \ - debian-12:geerlingguy/docker-debian12-ansible:latest: \ + ubuntu-2204:geerlingguy/docker-ubuntu2204-ansible:latest:/lib/systemd/systemd \ + ubuntu-2404:geerlingguy/docker-ubuntu2404-ansible:latest:/lib/systemd/systemd \ + debian-12:geerlingguy/docker-debian12-ansible:latest:/lib/systemd/systemd \ archlinux:marcstraube/archlinux-ansible:latest:/usr/lib/systemd/systemd do IFS=":" read -r name image command <<< "$p"