From 2bc124d04f886132588b364a23ccee3f235eb3b4 Mon Sep 17 00:00:00 2001 From: James Fellows Date: Fri, 27 May 2016 21:44:43 +0100 Subject: [PATCH] Add fail2ban_actiond_path and fail2ban_jaild_path --- README.md | 2 ++ tasks/main.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/README.md b/README.md index cc1ba40..1e30014 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,8 @@ None - `fail2ban_action`: [default: `action_`]: Default action - `fail2ban_filterd_path`: [optional]: Path to directory containing filters to copy (**note the trailing slash**) +- `fail2ban_actiond_path`: [optional]: Path to directory containing actions to copy (**note the trailing slash**) +- `fail2ban_jaild_path`: [optional]: Path to directory containing jails to copy (**note the trailing slash**) For each of the services you wish to protect/put a jail or ban up for, you need to add it to the `fail2ban_services` list of hashes: diff --git a/tasks/main.yml b/tasks/main.yml index 3e8a4be..c9e3f66 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -52,6 +52,34 @@ - fail2ban - fail2ban-filters +- name: copy actions + copy: + src: "{{ fail2ban_actiond_path }}" + dest: /etc/fail2ban/action.d/ + owner: root + group: root + mode: 0644 + when: fail2ban_actiond_path is defined + notify: restart fail2ban + tags: + - configuration + - fail2ban + - fail2ban-actions + +- name: 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: restart fail2ban + tags: + - configuration + - fail2ban + - fail2ban-jails + - name: start and enable service service: name: fail2ban