diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a79d87..be2fff7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -149,6 +149,7 @@ jobs: matrix: scenario: - default + - systemd_enabled steps: - id: harden-runner name: Harden the runner diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9ea185a..efe389b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -111,7 +111,7 @@ repos: hooks: - id: bandit # Bandit complains about the use of assert() in tests - exclude: molecule/default/tests + exclude: molecule/(default|systemd_enabled)/tests args: - --config=.bandit.yml - repo: https://github.com/psf/black-pre-commit-mirror diff --git a/molecule/systemd_enabled/INSTALL.rst b/molecule/systemd_enabled/INSTALL.rst new file mode 120000 index 0000000..42b71d5 --- /dev/null +++ b/molecule/systemd_enabled/INSTALL.rst @@ -0,0 +1 @@ +../default/INSTALL.rst \ No newline at end of file diff --git a/molecule/systemd_enabled/converge.yml b/molecule/systemd_enabled/converge.yml new file mode 120000 index 0000000..73cb8da --- /dev/null +++ b/molecule/systemd_enabled/converge.yml @@ -0,0 +1 @@ +../default/converge.yml \ No newline at end of file diff --git a/molecule/systemd_enabled/molecule-no-systemd.yml b/molecule/systemd_enabled/molecule-no-systemd.yml new file mode 120000 index 0000000..6b254f5 --- /dev/null +++ b/molecule/systemd_enabled/molecule-no-systemd.yml @@ -0,0 +1 @@ +../default/molecule-no-systemd.yml \ No newline at end of file diff --git a/molecule/systemd_enabled/molecule-with-systemd.yml b/molecule/systemd_enabled/molecule-with-systemd.yml new file mode 120000 index 0000000..29dc0fa --- /dev/null +++ b/molecule/systemd_enabled/molecule-with-systemd.yml @@ -0,0 +1 @@ +../default/molecule-with-systemd.yml \ No newline at end of file diff --git a/molecule/systemd_enabled/molecule.yml b/molecule/systemd_enabled/molecule.yml new file mode 100644 index 0000000..46056c2 --- /dev/null +++ b/molecule/systemd_enabled/molecule.yml @@ -0,0 +1,97 @@ +--- +# This molecule configuration file is suitable for testing Ansible +# roles that _do_ require SystemD. If your Ansible role _does not_ +# require SystemD then you should use molecule-no-systemd.yml instead. +# +# Note that the molecule configuration file that is symlinked to +# molecule.yml is the one that will be used. +dependency: + name: galaxy +driver: + name: docker +platforms: + - cgroupns_mode: host + command: /lib/systemd/systemd + image: geerlingguy/docker-amazonlinux2023-ansible:latest + name: amazonlinux2023-systemd + platform: amd64 + pre_build_image: yes + privileged: yes + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + - cgroupns_mode: host + command: /lib/systemd/systemd + image: geerlingguy/docker-debian10-ansible:latest + name: debian10-systemd + platform: amd64 + pre_build_image: yes + privileged: yes + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + - cgroupns_mode: host + command: /lib/systemd/systemd + image: geerlingguy/docker-debian11-ansible:latest + name: debian11-systemd + platform: amd64 + pre_build_image: yes + privileged: yes + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + - cgroupns_mode: host + command: /lib/systemd/systemd + image: cisagov/docker-debian12-ansible:latest + name: debian12-systemd + platform: amd64 + pre_build_image: yes + privileged: yes + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + - cgroupns_mode: host + command: /lib/systemd/systemd + image: cisagov/docker-kali-ansible:latest + name: kali-systemd + platform: amd64 + pre_build_image: yes + privileged: yes + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + - cgroupns_mode: host + command: /lib/systemd/systemd + image: geerlingguy/docker-fedora37-ansible:latest + name: fedora37-systemd + platform: amd64 + pre_build_image: yes + privileged: yes + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + - cgroupns_mode: host + command: /lib/systemd/systemd + image: geerlingguy/docker-fedora38-ansible:latest + name: fedora38-systemd + platform: amd64 + pre_build_image: yes + privileged: yes + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + - cgroupns_mode: host + command: /lib/systemd/systemd + image: geerlingguy/docker-ubuntu2004-ansible:latest + name: ubuntu-20-systemd + platform: amd64 + pre_build_image: yes + privileged: yes + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + - cgroupns_mode: host + command: /lib/systemd/systemd + image: geerlingguy/docker-ubuntu2204-ansible:latest + name: ubuntu-22-systemd + platform: amd64 + pre_build_image: yes + privileged: yes + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw +scenario: + name: systemd_enabled +verifier: + name: testinfra diff --git a/molecule/systemd_enabled/prepare.yml b/molecule/systemd_enabled/prepare.yml new file mode 120000 index 0000000..1c017d9 --- /dev/null +++ b/molecule/systemd_enabled/prepare.yml @@ -0,0 +1 @@ +../default/prepare.yml \ No newline at end of file diff --git a/molecule/systemd_enabled/requirements.yml b/molecule/systemd_enabled/requirements.yml new file mode 120000 index 0000000..b6f4a01 --- /dev/null +++ b/molecule/systemd_enabled/requirements.yml @@ -0,0 +1 @@ +../default/requirements.yml \ No newline at end of file diff --git a/molecule/systemd_enabled/tests/test_default.py b/molecule/systemd_enabled/tests/test_default.py new file mode 120000 index 0000000..bc5a562 --- /dev/null +++ b/molecule/systemd_enabled/tests/test_default.py @@ -0,0 +1 @@ +../../default/tests/test_default.py \ No newline at end of file diff --git a/molecule/systemd_enabled/upgrade.yml b/molecule/systemd_enabled/upgrade.yml new file mode 120000 index 0000000..47a9638 --- /dev/null +++ b/molecule/systemd_enabled/upgrade.yml @@ -0,0 +1 @@ +../default/upgrade.yml \ No newline at end of file