From daa551e7ebf5422d265bd42577d5fcdf03056cab Mon Sep 17 00:00:00 2001 From: Francis Kayiwa Date: Thu, 31 Oct 2024 09:28:29 -0400 Subject: [PATCH] use systemd in our containers 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 --- roles/example/molecule/default/molecule.yml | 14 +++++++++++--- roles/passenger/molecule/default/molecule.yml | 6 +++++- roles/passenger/tasks/main.yml | 2 -- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/roles/example/molecule/default/molecule.yml b/roles/example/molecule/default/molecule.yml index fc1de4aea1..c4000fbd2c 100644 --- a/roles/example/molecule/default/molecule.yml +++ b/roles/example/molecule/default/molecule.yml @@ -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 diff --git a/roles/passenger/molecule/default/molecule.yml b/roles/passenger/molecule/default/molecule.yml index 5a85b6a112..c4000fbd2c 100644 --- a/roles/passenger/molecule/default/molecule.yml +++ b/roles/passenger/molecule/default/molecule.yml @@ -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 diff --git a/roles/passenger/tasks/main.yml b/roles/passenger/tasks/main.yml index 37eefa9850..4e2cb3a1de 100644 --- a/roles/passenger/tasks/main.yml +++ b/roles/passenger/tasks/main.yml @@ -78,7 +78,5 @@ src: 'systemd_override.conf' dest: /etc/systemd/system/nginx.service.d/override.conf tags: nginx - tags: - - notest notify: - reload systemd