christianlempa-boilerplates/ansible/configuration/fail2ban/config-f2b-protect-sshd.yaml
2023-05-25 13:48:38 +02:00

19 lines
445 B
YAML

---
- name: install fail2ban and configure sshd
hosts: "{{ hosts }}"
become: yes
tasks:
- name: install fail2ban
apt:
name:
- fail2ban
update_cache: yes
- name: copy fail2ban configfiles
copy:
src: configfiles/debian-sshd-default.conf
dest: /etc/fail2ban/jail.d/debian-sshd-default.conf
- name: restart fail2ban
systemd:
state: restarted
daemon_reload: yes
name: fail2ban