From 5e8a7ac51e486044c8d14694e5f51173dd63f628 Mon Sep 17 00:00:00 2001 From: B Stack Date: Fri, 23 Sep 2016 10:27:15 -0400 Subject: Initial file upload --- roles/fail2ban/defaults/main.yml | 3 +++ roles/fail2ban/files | 1 + roles/fail2ban/handlers/main.yml | 3 +++ roles/fail2ban/main.yml | 6 ++++++ roles/fail2ban/tasks/main.yml | 20 ++++++++++++++++++++ 5 files changed, 33 insertions(+) create mode 100644 roles/fail2ban/defaults/main.yml create mode 120000 roles/fail2ban/files create mode 100644 roles/fail2ban/handlers/main.yml create mode 100644 roles/fail2ban/main.yml create mode 100644 roles/fail2ban/tasks/main.yml (limited to 'roles/fail2ban') 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 -- cgit