2021-06-11 15:01:45 +02:00
|
|
|
---
|
2023-05-25 13:48:38 +02:00
|
|
|
- name: install fail2ban and configure sshd
|
2024-02-23 12:19:48 +01:00
|
|
|
hosts: "{{ my_hosts | d([]) }}"
|
2021-06-11 15:01:45 +02:00
|
|
|
become: yes
|
|
|
|
tasks:
|
|
|
|
- name: install fail2ban
|
2024-02-24 11:56:25 +01:00
|
|
|
ansible.builtin.apt:
|
2021-06-11 15:01:45 +02:00
|
|
|
name:
|
|
|
|
- fail2ban
|
|
|
|
update_cache: yes
|
|
|
|
- name: copy fail2ban configfiles
|
2024-02-24 11:56:25 +01:00
|
|
|
ansible.builtin.copy:
|
2021-06-11 15:01:45 +02:00
|
|
|
src: configfiles/debian-sshd-default.conf
|
|
|
|
dest: /etc/fail2ban/jail.d/debian-sshd-default.conf
|
|
|
|
- name: restart fail2ban
|
2024-02-24 11:56:25 +01:00
|
|
|
ansible.builtin.systemd_service:
|
2021-06-11 15:01:45 +02:00
|
|
|
state: restarted
|
|
|
|
daemon_reload: yes
|
2024-02-22 19:01:59 +01:00
|
|
|
name: fail2ban
|