Skip to content

Commit

Permalink
Add fail2ban_actiond_path and fail2ban_jaild_path
Browse files Browse the repository at this point in the history
  • Loading branch information
j4m3s committed May 27, 2016
1 parent 03c9757 commit 2bc124d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
28 changes: 28 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2bc124d

Please sign in to comment.