geerlingguy / docker-centos8-ansible

CentOS 8 Docker container for Ansible playbook and role testing.
https://hub.docker.com/r/geerlingguy/docker-centos8-ansible/
MIT License
60 stars 40 forks source link

dbus missing/not started #15

Closed Aryess closed 3 years ago

Aryess commented 3 years ago

Hi @geerlingguy

Firstly thanks for your hard work, I've been using this image and a few of your ansible roles for a while now, really saved me a lot of time.

I am using this image as part of my molecule testing, and I had it running without issues in the past. I've left the project aside for a month or two, and now returning to it I am getting the following error when running molecule:

TASK [geerlingguy.docker : Ensure Docker is started and enabled at boot.] ******
fatal: [instance]: FAILED! => {"changed": false, "cmd": "/usr/bin/systemctl", "msg": "Failed to connect to bus: No such file or directory", "rc": 1, "stderr": "Failed to connect to bus: No such file or directory\n", "stderr_lines": ["Failed to connect to bus: No such file or directory"], "stdout": "", "stdout_lines": []}

Now, this could be an issue with https://github.com/geerlingguy/ansible-role-docker, but I think it's probably more with the image itself, as I can reproduce it as so:

~|⇒ docker run --name instance -d -v /sys/fs/cgroup:/sys/fs/cgroup:ro --privileged=true geerlingguy/docker-centos8-ansible
3482a4fbf0ce8aa262e3c0a2a1efc1cebae4b4fb04511ee9879c956676e8c50e
~|⇒ docker exec -it instance bash
[root@3482a4fbf0ce /]# systemctl
Failed to connect to bus: No such file or directory

As I mentioned above this was working before, so I am not even sure it's an issue with this image, since last time I have upgraded my system (to Fedora 34) and reinstalled python/ansible/molecule, but at this point I am completely out of ideas to fix this one, and help/pointers would be welcome

dmlb2000 commented 3 years ago

I'm wondering if this is a compatibility issue between the host systemd and the one in CentOS 8?

Aryess commented 3 years ago

I'm wondering if this is a compatibility issue between the host systemd and the one in CentOS 8?

I hope not but after trying some more (to no avail), that's probably what it is. I guess it's time to take the leap and retire CentOS...

Aryess commented 3 years ago

I did a bit more testing, on a fresh (but up to date) Fedora 29 install in a VM the example above is working correctly, but on a similarly fresh/up to date fedora 34 VM, it does not, while using the same container.

I'm still not quite sure what's going on, but the one thing I'm now sure of is that it has nothing to do with this image, so I'll close the issue. I'll keep testing and will update this reply in case someone encounters the same thing.


edit: F29 uses the same version of systemd (239) as this container (which is the latest available in centos), while F34 uses version 248. I'm going to assume this is the reason for it and move on