From be3e1a07ee5d0992f2c3d03f22a4f3755a7343df Mon Sep 17 00:00:00 2001 From: Faustin Lammler Date: Wed, 29 Sep 2021 13:00:46 +0200 Subject: [PATCH] Run molecule test in rootless mode See: - https://github.com/actions/virtual-environments/issues/3536 - https://github.com/ansible-community/molecule/discussions/3155 --- .github/workflows/molecule.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/molecule.yml b/.github/workflows/molecule.yml index 539fc53..f76e360 100644 --- a/.github/workflows/molecule.yml +++ b/.github/workflows/molecule.yml @@ -35,17 +35,20 @@ jobs: playbook: converge.yml steps: - # see https://github.com/actions/virtual-environments/issues/3536#issuecomment-858433636) - # - name: Set rights for podman - # run: sudo chmod o+rwx -R /sys/fs/cgroup/systemd - uses: actions/checkout@v2 - name: Install requirements run: | - sudo python3 -m pip install --upgrade pip - sudo python3 -m pip install -r requirements.txt + python3 -m pip install --upgrade pip + python3 -m pip install -r requirements.txt + # This is necessary on GH Actions to allow running systemd in rootless containers + # see: https://github.com/actions/virtual-environments/issues/3536 + # see: https://github.com/ansible-community/molecule/discussions/3155 + - name: Start systemd user service + run: | + loginctl enable-linger $(whoami) + sleep 1 - name: Run molecule - # using sudo see https://github.com/actions/virtual-environments/issues/3536 - run: sudo molecule test + run: molecule test env: PY_COLORS: "1" ANSIBLE_FORCE_COLOR: "1"