geerlingguy / ansible-role-docker

Ansible Role - Docker
https://galaxy.ansible.com/geerlingguy/docker/
MIT License
1.81k stars 853 forks source link

Molecule support in GitLab CI #414

Closed haydenseitz closed 9 months ago

haydenseitz commented 1 year ago

Hi, this is not an issue with the role itself, but a question on how your molecule config works (I dont see a place to add discussions in this repo).

I noticed here that a change was needed to fix your CI jobs when testing docker against an Ubuntu 22 image: https://github.com/geerlingguy/ansible-role-docker/commit/32dfe4c00e59273aec2e8fa82e691c507979a0f1

I am facing what I believe to be a similar issue with GitLab CI. I use this role in many playbooks against different hosts, and now that my org is starting to update to Ubuntu 22, I am having issues running molecule against Ubuntu 22 images. Here is an example project I set up to illustrate the issue: https://gitlab.com/haydenseitz/ansible-docker-ubuntu22

You can see in the Ubuntu 22 job that it fails when starting the docker service, but it is working in the Ubuntu 20 job.

Would you be able to share any insight you have about the change you made and why it was needed? It seems that the cgroup or systemd implementation has changed from Ubuntu 20 to 22 but I have not been able to narrow down what those changes are.

haydenseitz commented 1 year ago

Following up: after working with Gitlab Support, it was found that switching iptables to legacy mode (update-alternatives --set iptables /usr/sbin/iptables-legacy) allows docker to start in the Ubuntu 22 container. I am unsure why nftables does not work on Gitlab CI shared runners, but Gitlab Support confirm there are certain "network restrictions" on the shared runners, and they advised running a private runner. Hopefully this is helpful to others!

github-actions[bot] commented 12 months ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

github-actions[bot] commented 9 months ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.