aboutsummaryrefslogtreecommitdiff
path: root/roles/fail2ban
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2016-09-23 10:27:15 -0400
committerB Stack <bgstack15@gmail.com>2016-09-23 10:27:15 -0400
commit5e8a7ac51e486044c8d14694e5f51173dd63f628 (patch)
tree586bba6cab996f95a39f6a4620e457cf5924d770 /roles/fail2ban
parentInitial file upload (diff)
downloadansible01-5e8a7ac51e486044c8d14694e5f51173dd63f628.tar.gz
ansible01-5e8a7ac51e486044c8d14694e5f51173dd63f628.tar.bz2
ansible01-5e8a7ac51e486044c8d14694e5f51173dd63f628.zip
Initial file upload
Diffstat (limited to 'roles/fail2ban')
-rw-r--r--roles/fail2ban/defaults/main.yml3
l---------roles/fail2ban/files1
-rw-r--r--roles/fail2ban/handlers/main.yml3
-rw-r--r--roles/fail2ban/main.yml6
-rw-r--r--roles/fail2ban/tasks/main.yml20
5 files changed, 33 insertions, 0 deletions
diff --git a/roles/fail2ban/defaults/main.yml b/roles/fail2ban/defaults/main.yml
new file mode 100644
index 0000000..c3a16b1
--- /dev/null
+++ b/roles/fail2ban/defaults/main.yml
@@ -0,0 +1,3 @@
+---
+fail2ban_filterd_path: roles/fail2ban/files/filter.d/
+fail2ban_jaild_path: roles/fail2ban/files/jail.d/
diff --git a/roles/fail2ban/files b/roles/fail2ban/files
new file mode 120000
index 0000000..9e0759b
--- /dev/null
+++ b/roles/fail2ban/files
@@ -0,0 +1 @@
+../../company/fail2ban-files \ No newline at end of file
diff --git a/roles/fail2ban/handlers/main.yml b/roles/fail2ban/handlers/main.yml
new file mode 100644
index 0000000..420d8e8
--- /dev/null
+++ b/roles/fail2ban/handlers/main.yml
@@ -0,0 +1,3 @@
+---
+- name: fail2ban restart
+ service: name=fail2ban state=restarted
diff --git a/roles/fail2ban/main.yml b/roles/fail2ban/main.yml
new file mode 100644
index 0000000..703571e
--- /dev/null
+++ b/roles/fail2ban/main.yml
@@ -0,0 +1,6 @@
+---
+- hosts: all
+ tasks:
+ - include: tasks/main.yml
+ handlers:
+ - handlers/main.yml
diff --git a/roles/fail2ban/tasks/main.yml b/roles/fail2ban/tasks/main.yml
new file mode 100644
index 0000000..d60e427
--- /dev/null
+++ b/roles/fail2ban/tasks/main.yml
@@ -0,0 +1,20 @@
+---
+- name: fail2ban copy filter
+ copy:
+ src: "{{ fail2ban_filterd_path }}"
+ dest: /etc/fail2ban/filter.d/
+ owner: root
+ group: root
+ mode: 0644
+ when: fail2ban_filterd_path is defined
+ notify: fail2ban restart
+
+- name: fail2ban copy jails
+ copy:
+ src: "{{ fail2ban_jaild_path }}"
+ dest: /etc/fail2ban/jail.d/
+ owner: root
+ group: root
+ mode: 0644
+ when: fail2ban_jaild_path is defined
+ notify: fail2ban restart
bgstack15