Closed artis3n closed 1 year ago
Hey @artis3n
I managed to fix this by including command: /usr/sbin/init
in my molecule.yml
:
---
dependency:
name: galaxy
driver:
name: podman
platforms:
- name: instance
image: docker.io/geerlingguy/docker-ubuntu2204-ansible:latest
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
command: /usr/sbin/init
privileged: true
pre_build_image: true
provisioner:
name: ansible
(sandbox) ➜ sandbox molecule login
INFO Running default > login
root@instance:/# systemctl status
● instance
State: degraded
PLAY [Converge] ****************************************************************
TASK [Gathering Facts] *********************************************************
ok: [instance]
TASK [:(] **********************************************************************
ok: [instance]
PLAY RECAP *********************************************************************
instance : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Hope this helps 😄 👍🏻
Of course! Thanks. Since this post I broke out what images now use /usr/sbin/init
vs. other commands. I will close it. There are a few distros I continue to have issue with, but :shrug: I'll leave them on an ubuntu-20.04 runner. https://github.com/artis3n/ansible-role-tailscale/blob/e217453d8c04c4a0ff1d2528c240f76d135a91d1/.github/workflows/pull_request_target.yml#L57
Helped me as well, thanks
platforms:
- name: ubuntu-2404
image: docker.io/geerlingguy/docker-ubuntu2404-ansible
command: /usr/sbin/init
pre_build_image: true
cgroupns_mode: host
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
- /var/lib/containerd
It has been some time, and this is close to #6 , but given I am not receiving that error I opted for a new issue. I cannot get Molecule working with cgroupsv2 and this container (or most others since the cgroup change, admittedly). This container works fine when executed directly, mirroring the commands in the README, but fails under Molecule during any execution of a systemd task with:
This occurs locally on OSX and on an ubuntu 22.04 GitHub Actions runner.
My
molecule.yml
is:A minimally reproducible
converge.yml
is:Running
molecule test
will result in the above error both locally and on the Ubuntu 22.04 runner.Given the molecule PR introducing
cgroupns_mode
is merged and I don't see issues about this from others in the molecule and molecule-plugins repos, I am assuming I'm missing something dumb in themolecule.yml
. Any thoughts as to what I should be doing to resolve this error?