Prototype a role for installing fail2ban on RHEL 9+
This commit is contained in:
17
roles/fail2ban_rhel/molecule/default/verify.yml
Normal file
17
roles/fail2ban_rhel/molecule/default/verify.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
- name: Verify
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
any_errors_fatal: true
|
||||
|
||||
tasks:
|
||||
- name: "Check that the fail2ban service is active"
|
||||
register: sshd_rhel_fail2ban_service
|
||||
ansible.builtin.systemd:
|
||||
name: fail2ban
|
||||
|
||||
- name: "Assert fail2ban is running"
|
||||
ansible.builtin.assert:
|
||||
that: sshd_rhel_fail2ban_service.status.ActiveState == "active"
|
||||
success_msg: "fail2ban service is running"
|
||||
fail_msg: "fail2ban service is not active"
|
||||
Reference in New Issue
Block a user