homelab-automation/Ansible/fail2ban.yml
2024-01-28 14:28:22 -05:00

19 lines
402 B
YAML

- hosts: linux
remote_user: bhays
become: true
become_user: root
tasks:
- name: Update/install Fail2Ban
apt:
name: fail2ban
state: latest
update_cache: yes
- name: Copy Secure Configuration File
copy:
src: ../Configs/jail.local
dest: /etc/fail2ban/jail.local
- name: Restart Fail2Ban
systemd_service:
name: fail2ban
state: restarted