Add Molecule tests for systemd unit
This commit is contained in:
parent
68c5d4e9f7
commit
4267dd455e
|
@ -26,7 +26,7 @@
|
||||||
that:
|
that:
|
||||||
- p.stat.exists
|
- p.stat.exists
|
||||||
|
|
||||||
- name: check for nftables.conf
|
- name: check for filter-input.nft
|
||||||
stat:
|
stat:
|
||||||
path: /etc/nftables.d/filter-input.nft
|
path: /etc/nftables.d/filter-input.nft
|
||||||
register: p
|
register: p
|
||||||
|
@ -53,6 +53,26 @@
|
||||||
- '"type filter hook input" in nft.stdout'
|
- '"type filter hook input" in nft.stdout'
|
||||||
- '"type filter hook output" in nft.stdout'
|
- '"type filter hook output" in nft.stdout'
|
||||||
|
|
||||||
|
- name: check for fail2ban systemd custom dir
|
||||||
|
stat:
|
||||||
|
path: /etc/systemd/system/fail2ban.service.d
|
||||||
|
register: f2b_systemd_dir
|
||||||
|
|
||||||
|
- name: check fail2ban systemd custom dir
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- f2b_systemd_dir.stat.exists and f2b_systemd_dir.stat.isdir
|
||||||
|
|
||||||
|
- name: check for fail2ban systemd override
|
||||||
|
stat:
|
||||||
|
path: /etc/systemd/system/fail2ban.service.d/override.conf
|
||||||
|
register: f2b_systemd_override
|
||||||
|
|
||||||
|
- name: check fail2ban systemd override
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- f2b_systemd_override.stat.exists
|
||||||
|
|
||||||
- name: service status - active
|
- name: service status - active
|
||||||
command: systemctl is-active nftables.service
|
command: systemctl is-active nftables.service
|
||||||
register: status
|
register: status
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
that:
|
that:
|
||||||
- p.stat.exists
|
- p.stat.exists
|
||||||
|
|
||||||
- name: check for nftables.conf
|
- name: check for filter-input.nft
|
||||||
stat:
|
stat:
|
||||||
path: /etc/nftables.d/filter-input.nft
|
path: /etc/nftables.d/filter-input.nft
|
||||||
register: p
|
register: p
|
||||||
|
@ -53,6 +53,26 @@
|
||||||
- '"type filter hook input" in nft.stdout'
|
- '"type filter hook input" in nft.stdout'
|
||||||
- '"type filter hook output" in nft.stdout'
|
- '"type filter hook output" in nft.stdout'
|
||||||
|
|
||||||
|
- name: check for fail2ban systemd custom dir
|
||||||
|
stat:
|
||||||
|
path: /etc/systemd/system/fail2ban.service.d
|
||||||
|
register: f2b_systemd_dir
|
||||||
|
|
||||||
|
- name: check fail2ban systemd custom dir
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- f2b_systemd_dir.stat.exists and f2b_systemd_dir.stat.isdir
|
||||||
|
|
||||||
|
- name: check for fail2ban systemd override
|
||||||
|
stat:
|
||||||
|
path: /etc/systemd/system/fail2ban.service.d/override.conf
|
||||||
|
register: f2b_systemd_override
|
||||||
|
|
||||||
|
- name: check fail2ban systemd override
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- f2b_systemd_override.stat.exists
|
||||||
|
|
||||||
- name: service status - active
|
- name: service status - active
|
||||||
command: systemctl is-active nftables.service
|
command: systemctl is-active nftables.service
|
||||||
register: status
|
register: status
|
||||||
|
|
Loading…
Reference in New Issue