forked from ANXS/fail2ban
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move custom configurations management to dedicated tasks list
This allows to use the `tasks_from` parameter of the `import_role` module. For instance, one could run something like : ``` - name: "Create Traefik fail2ban configuration." import_role: name: ansible-fail2ban tasks_from: copy_custom_configurations become: True vars: fail2ban_filterd_path: "{{ traefik_fail2ban_filterd_path }}" fail2ban_actiond_path: "{{ traefik_fail2ban_actiond_path }}" fail2ban_jaild_path: "{{ traefik_fail2ban_jaild_path }}" ``` from a Traefik playbook to just add Traefik specific Fail2ban configuration without reconfiguring everything.
- Loading branch information
Showing
5 changed files
with
49 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- name: copy actions | ||
copy: | ||
src: "{{ fail2ban_actiond_path }}" | ||
dest: /etc/fail2ban/action.d/ | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
notify: restart fail2ban | ||
tags: | ||
- configuration | ||
- fail2ban | ||
- fail2ban-actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
- name: copy filters | ||
import_tasks: copy_filters.yml | ||
when: fail2ban_filterd_path is defined | ||
|
||
- name: copy actions | ||
import_tasks: copy_actions.yml | ||
when: fail2ban_actiond_path is defined | ||
|
||
- name: copy jails | ||
import_tasks: copy_jails.yml | ||
when: fail2ban_jaild_path is defined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- name: copy filters | ||
copy: | ||
src: "{{ fail2ban_filterd_path }}" | ||
dest: /etc/fail2ban/filter.d/ | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
notify: restart fail2ban | ||
tags: | ||
- configuration | ||
- fail2ban | ||
- fail2ban-filters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- name: copy jails | ||
copy: | ||
src: "{{ fail2ban_jaild_path }}" | ||
dest: /etc/fail2ban/jail.d/ | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
notify: restart fail2ban | ||
tags: | ||
- configuration | ||
- fail2ban | ||
- fail2ban-jails |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters