Skip to content

Commit

Permalink
use systemd in our containers
Browse files Browse the repository at this point in the history
modify the molecule yaml file
the command tells the container that systemd should be run as PID1
the tmp directories ensure that systemd has writeable directories

remove the notest flag on the passenger role

closes #1926
  • Loading branch information
kayiwa committed Nov 1, 2024
1 parent 565f420 commit daa551e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
14 changes: 11 additions & 3 deletions roles/example/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,22 @@ lint: |
ansible-lint
platforms:
- name: instance
image: "ghcr.io/pulibrary/pul_containers:jammy_multi"
command: "sleep infinity"
image: "quay.io/pulibrary/jammy-ansible:latest"
command: "/lib/systemd/systemd"
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup:rw
tmpfs:
- /tmp
- /run
- /run/lock
cgroupns_mode: host
privileged: true
pre_build_image: true
provisioner:
name: ansible
config_options:
defaults:
remote_tmp: /tmp
log: true
verifier:
name: ansible
6 changes: 5 additions & 1 deletion roles/passenger/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ lint: |
platforms:
- name: instance
image: "quay.io/pulibrary/jammy-ansible:latest"
command: ""
command: "/lib/systemd/systemd"
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
tmpfs:
- /tmp
- /run
- /run/lock
cgroupns_mode: host
privileged: true
pre_build_image: true
Expand Down
2 changes: 0 additions & 2 deletions roles/passenger/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,5 @@
src: 'systemd_override.conf'
dest: /etc/systemd/system/nginx.service.d/override.conf
tags: nginx
tags:
- notest
notify:
- reload systemd

0 comments on commit daa551e

Please sign in to comment.