Skip to content

Commit

Permalink
Fixes #531: systemd with molecule Docker containers requires cgroupns…
Browse files Browse the repository at this point in the history
… set to host and rw.
  • Loading branch information
geerlingguy committed Jun 18, 2023
1 parent eeb73d7 commit a4b7cfb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion molecule/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ platforms:
image: "geerlingguy/docker-${MOLECULE_DISTRO:-rockylinux8}-ansible:latest"
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
pre_build_image: true
provisioner:
Expand Down
4 changes: 2 additions & 2 deletions tests/orchestration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ pip3 install ansible
cd orchestration/scripts

# 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

# 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

# Other tests from the book.
Expand Down

0 comments on commit a4b7cfb

Please sign in to comment.