docker-debian12-ansible icon indicating copy to clipboard operation
docker-debian12-ansible copied to clipboard

systemd/dbus issue with molecule

Open wookietreiber opened this issue 1 year ago • 1 comments

I've been trying the image with molecule (from molecule/default/molecule.yml):

platforms: 
  - name: debian-12
    image: geerlingguy/docker-debian12-ansible
    command: ${MOLECULE_DOCKER_COMMAND:-""}
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:rw
    cgroupns_mode: host
    privileged: yes
    pre_build_image: yes

With molecule verification, a command like localectl status fails, this is the task in molecule/default/verify.yml:

- name: verify
  hosts: all
  tasks:
    - name: check if localectl status works
      ansible.builtin.command: localectl status
      changed_when: no

... and I'm getting this error:

fatal: [debian-12]: FAILED! => {"changed": false, "cmd": ["localectl", "status"], "delta": "0:00:00.007084", "end": "2023-08-23 11:00:20.692010", "msg": "non-zero return code", "rc": 1, "start": "2023-08-23 11:00:20.684926", "stderr": "Failed to connect to bus: No such file or directory", "stderr_lines": ["Failed to connect to bus: No such file or directory"], "stdout": "", "stdout_lines": []}

I'm suspecting there is an issue with systemd/dbus in the image, potentially there is just a dbus package missing to fully test systemd/dbus-related commands/services.


Note: I'm using these images with molecule (btw thanks for providing them :wink:):

geerlingguy/docker-centos8-ansible
geerlingguy/docker-debian10-ansible
geerlingguy/docker-debian11-ansible
geerlingguy/docker-debian12-ansible
geerlingguy/docker-rockylinux8-ansible
geerlingguy/docker-rockylinux9-ansible
geerlingguy/docker-ubuntu2004-ansible
geerlingguy/docker-ubuntu2204-ansible

It occurs with the three debian ones, the others are fine.

wookietreiber avatar Aug 24 '23 08:08 wookietreiber

I also hade the same problem. I fixed it by creating my own image based on this one and installed dbus into it.

p3l1 avatar Oct 23 '23 14:10 p3l1