Skip to content

Commit

Permalink
Merge pull request #12 from alexnuttinck/feature/add-filters
Browse files Browse the repository at this point in the history
PR: copy filterd
  • Loading branch information
robertdebock authored Sep 8, 2021
2 parents de6d43a + 39f25df commit ecca178
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ fail2ban_jail_configuration: []
# - option: ignoreself
# value: "true"
# section: DEFAULT
# Path to directory containing filters to copy in filter.d
# fail2ban_filterd_path:
```

## [Requirements](#requirements)
Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ fail2ban_jail_configuration: []
# - option: ignoreself
# value: "true"
# section: DEFAULT

# Path to directory containing filters to copy in filter.d
# fail2ban_filterd_path:
11 changes: 11 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@
name: "{{ fail2ban_packages }}"
state: present

- name: copy filters in filter.d
ansible.builtin.copy:
src: "{{ fail2ban_filterd_path }}"
dest: /etc/fail2ban/filter.d/
owner: root
group: root
mode: "0640"
when: fail2ban_filterd_path is defined
notify:
- restart fail2ban

- name: configure fail2ban.local
community.general.ini_file:
path: /etc/fail2ban/fail2ban.local
Expand Down

0 comments on commit ecca178

Please sign in to comment.