Copied from the environment repository's roles/fail2ban and scrubbed for the Collection: galaxy namespace mortis, the molecule scenario calls the role by its FQCN (and takes its paths from the workflow, like docker's), README examples use mortis.kamino.fail2ban, repository-local issue references are dropped. mock_roles in .ansible-lint lists the new FQCN. Not verified locally: the molecule scenario (runs on the kamino-molecule runner in CI) and ansible-test sanity. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
18 lines
530 B
YAML
18 lines
530 B
YAML
---
|
|
- name: Restart Fail2Ban
|
|
become: true
|
|
ansible.builtin.service:
|
|
name: fail2ban
|
|
state: restarted
|
|
|
|
# Service jails only add a jail.d file, so reload instead of restarting the
|
|
# daemon (a restart drops the in-memory ban list). state=reloaded starts the
|
|
# service if it is not running. The config test runs as a task in
|
|
# service_jail.yml, so a broken file fails every run instead of only the one
|
|
# that wrote it.
|
|
- name: Reload Fail2Ban
|
|
become: true
|
|
ansible.builtin.systemd:
|
|
name: fail2ban
|
|
state: reloaded
|