infrastructure/ansible/roles/base/tasks/fail2ban.yml
Jake Howard d5a7a61171
All checks were successful
/ terraform (push) Successful in 38s
/ ansible (push) Successful in 1m30s
Remove unnecessary use of become from some roles
This should make execution much faster
2024-09-09 17:09:03 +01:00

21 lines
386 B
YAML

- name: Install fail2ban
package:
name: fail2ban
- name: Enable fail2ban
service:
name: fail2ban
enabled: true
- name: fail2ban SSH jail
template:
src: files/ssh-jail.conf
dest: /etc/fail2ban/jail.d/ssh.conf
mode: "0600"
register: fail2ban_jail
- name: Restart fail2ban
service:
name: fail2ban
state: restarted
when: fail2ban_jail.changed