mirror of
https://github.com/KevinMidboe/playbooks-retailor.git
synced 2026-01-09 10:55:46 +00:00
ansible playbooks for retailor.io infrastructure
This commit is contained in:
18
roles/fail2ban/tasks/fail2ban.yaml
Normal file
18
roles/fail2ban/tasks/fail2ban.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
- name: install fail2ban
|
||||
apt: pkg=fail2ban state=latest
|
||||
|
||||
- name: /etc/fail2ban/jail.conf
|
||||
template: src=fail2ban/jail.conf.j2 dest=/etc/fail2ban/jail.conf owner=root group=root mode=644
|
||||
notify: restart fail2ban
|
||||
|
||||
- name: /etc/fail2ban/fail2ban.conf
|
||||
template: src=fail2ban/fail2ban.conf.j2 dest=/etc/fail2ban/fail2ban.conf owner=root group=root mode=644
|
||||
notify: restart fail2ban
|
||||
|
||||
- name: Enable and start the fail2ban service
|
||||
systemd:
|
||||
name: fail2ban
|
||||
state: started
|
||||
enabled: yes
|
||||
|
||||
4
roles/fail2ban/tasks/main.yaml
Normal file
4
roles/fail2ban/tasks/main.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
- include_tasks: fail2ban.yaml
|
||||
when: ansible_os_family == "Debian"
|
||||
|
||||
Reference in New Issue
Block a user