add fail2ban role
This commit is contained in:
19
roles/fail2ban/tasks/main.yml
Normal file
19
roles/fail2ban/tasks/main.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
- name: install fail2ban package
|
||||
apt:
|
||||
name: fail2ban
|
||||
state: present
|
||||
update_cache: yes
|
||||
when: ansible_distribution=='Debian' or ansible_distribution=='Ubuntu'
|
||||
become: yes
|
||||
tags: fail2ban
|
||||
- name: copy fail2ban local config
|
||||
copy:
|
||||
src: "{{ role_path }}/files/jail.local"
|
||||
dest: /etc/fail2ban/jail.local
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
become: yes
|
||||
tags: fail2ban
|
||||
|
||||
Reference in New Issue
Block a user