mirror of
https://github.com/ChristianLempa/boilerplates.git
synced 2024-11-28 19:23:22 +01:00
20 lines
544 B
YAML
20 lines
544 B
YAML
---
|
|
- name: install fail2ban and configure sshd
|
|
hosts: "{{ my_hosts | d([]) }}"
|
|
become: true
|
|
tasks:
|
|
- name: install fail2ban
|
|
ansible.builtin.apt:
|
|
name:
|
|
- fail2ban
|
|
update_cache: true
|
|
- name: copy fail2ban configfiles
|
|
ansible.builtin.copy:
|
|
src: configfiles/debian-sshd-default.conf
|
|
dest: /etc/fail2ban/jail.d/debian-sshd-default.conf
|
|
- name: restart fail2ban
|
|
ansible.builtin.systemd_service:
|
|
state: restarted
|
|
daemon_reload: true
|
|
name: fail2ban
|