Skip to content

Commit 1666745

Browse files
authored
Merge pull request #158 from cisagov/improvement/systemd-enabled
Add SystemD-enabled molecule scenario
2 parents ca157c9 + a6e2949 commit 1666745

File tree

11 files changed

+107
-1
lines changed

11 files changed

+107
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ jobs:
149149
matrix:
150150
scenario:
151151
- default
152+
- systemd_enabled
152153
steps:
153154
- id: harden-runner
154155
name: Harden the runner

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ repos:
111111
hooks:
112112
- id: bandit
113113
# Bandit complains about the use of assert() in tests
114-
exclude: molecule/default/tests
114+
exclude: molecule/(default|systemd_enabled)/tests
115115
args:
116116
- --config=.bandit.yml
117117
- repo: https://github.com/psf/black-pre-commit-mirror

molecule/systemd_enabled/INSTALL.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../default/INSTALL.rst

molecule/systemd_enabled/converge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../default/converge.yml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../default/molecule-no-systemd.yml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../default/molecule-with-systemd.yml

molecule/systemd_enabled/molecule.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
# This molecule configuration file is suitable for testing Ansible
3+
# roles that _do_ require SystemD. If your Ansible role _does not_
4+
# require SystemD then you should use molecule-no-systemd.yml instead.
5+
#
6+
# Note that the molecule configuration file that is symlinked to
7+
# molecule.yml is the one that will be used.
8+
dependency:
9+
name: galaxy
10+
driver:
11+
name: docker
12+
platforms:
13+
- cgroupns_mode: host
14+
command: /lib/systemd/systemd
15+
image: geerlingguy/docker-amazonlinux2023-ansible:latest
16+
name: amazonlinux2023-systemd
17+
platform: amd64
18+
pre_build_image: yes
19+
privileged: yes
20+
volumes:
21+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
22+
- cgroupns_mode: host
23+
command: /lib/systemd/systemd
24+
image: geerlingguy/docker-debian10-ansible:latest
25+
name: debian10-systemd
26+
platform: amd64
27+
pre_build_image: yes
28+
privileged: yes
29+
volumes:
30+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
31+
- cgroupns_mode: host
32+
command: /lib/systemd/systemd
33+
image: geerlingguy/docker-debian11-ansible:latest
34+
name: debian11-systemd
35+
platform: amd64
36+
pre_build_image: yes
37+
privileged: yes
38+
volumes:
39+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
40+
- cgroupns_mode: host
41+
command: /lib/systemd/systemd
42+
image: cisagov/docker-debian12-ansible:latest
43+
name: debian12-systemd
44+
platform: amd64
45+
pre_build_image: yes
46+
privileged: yes
47+
volumes:
48+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
49+
- cgroupns_mode: host
50+
command: /lib/systemd/systemd
51+
image: cisagov/docker-kali-ansible:latest
52+
name: kali-systemd
53+
platform: amd64
54+
pre_build_image: yes
55+
privileged: yes
56+
volumes:
57+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
58+
- cgroupns_mode: host
59+
command: /lib/systemd/systemd
60+
image: geerlingguy/docker-fedora37-ansible:latest
61+
name: fedora37-systemd
62+
platform: amd64
63+
pre_build_image: yes
64+
privileged: yes
65+
volumes:
66+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
67+
- cgroupns_mode: host
68+
command: /lib/systemd/systemd
69+
image: geerlingguy/docker-fedora38-ansible:latest
70+
name: fedora38-systemd
71+
platform: amd64
72+
pre_build_image: yes
73+
privileged: yes
74+
volumes:
75+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
76+
- cgroupns_mode: host
77+
command: /lib/systemd/systemd
78+
image: geerlingguy/docker-ubuntu2004-ansible:latest
79+
name: ubuntu-20-systemd
80+
platform: amd64
81+
pre_build_image: yes
82+
privileged: yes
83+
volumes:
84+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
85+
- cgroupns_mode: host
86+
command: /lib/systemd/systemd
87+
image: geerlingguy/docker-ubuntu2204-ansible:latest
88+
name: ubuntu-22-systemd
89+
platform: amd64
90+
pre_build_image: yes
91+
privileged: yes
92+
volumes:
93+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
94+
scenario:
95+
name: systemd_enabled
96+
verifier:
97+
name: testinfra

molecule/systemd_enabled/prepare.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../default/prepare.yml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../default/requirements.yml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../default/tests/test_default.py

0 commit comments

Comments
 (0)