Fixes #531: systemd with molecule Docker containers requires cgroupns set to host and rw.

This commit is contained in:
Jeff Geerling
2023-06-17 21:57:54 -05:00
parent eeb73d7a43
commit a4b7cfb5fb
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -12,7 +12,8 @@ platforms:
image: "geerlingguy/docker-${MOLECULE_DISTRO:-rockylinux8}-ansible:latest" image: "geerlingguy/docker-${MOLECULE_DISTRO:-rockylinux8}-ansible:latest"
command: "" command: ""
volumes: volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro - /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true privileged: true
pre_build_image: true pre_build_image: true
provisioner: provisioner:
+2 -2
View File
@@ -9,11 +9,11 @@ pip3 install ansible
cd orchestration/scripts cd orchestration/scripts
# Test Django app installation. # Test Django app installation.
docker run -d --name app -p 80:80 --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro geerlingguy/docker-rockylinux8-ansible docker run -d --name app -p 80:80 --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:rw --cgroupns=host geerlingguy/docker-rockylinux8-ansible
./app.sh ./app.sh
# Test Django db installation. # Test Django db installation.
docker run -d --name db -p 3360:3360 --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro geerlingguy/docker-rockylinux8-ansible docker run -d --name db -p 3360:3360 --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:rw --cgroupns=host geerlingguy/docker-rockylinux8-ansible
./db.sh ./db.sh
# Other tests from the book. # Other tests from the book.