Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move custom configurations management to dedicated tasksets #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tasks/copy_actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- name: copy actions
ansible.builtin.copy:
src: "{{ fail2ban_actiond_path }}"
dest: /etc/fail2ban/action.d/
owner: root
group: root
mode: '0644'
notify: restart fail2ban
tags:
- configuration
- fail2ban
- fail2ban-actions
11 changes: 11 additions & 0 deletions tasks/copy_custom_configurations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- name: copy filters
ansible.builtin.import_tasks: copy_filters.yml
when: fail2ban_filterd_path is defined

- name: copy actions
ansible.builtin.import_tasks: copy_actions.yml
when: fail2ban_actiond_path is defined

- name: copy jails
ansible.builtin.import_tasks: copy_jails.yml
when: fail2ban_jaild_path is defined
12 changes: 12 additions & 0 deletions tasks/copy_filters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- name: copy filters
ansible.builtin.copy:
src: "{{ fail2ban_filterd_path }}"
dest: /etc/fail2ban/filter.d/
owner: root
group: root
mode: '0644'
notify: restart fail2ban
tags:
- configuration
- fail2ban
- fail2ban-filters
12 changes: 12 additions & 0 deletions tasks/copy_jails.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- name: copy jails
ansible.builtin.copy:
src: "{{ fail2ban_jaild_path }}"
dest: /etc/fail2ban/jail.d/
owner: root
group: root
mode: '0644'
notify: restart fail2ban
tags:
- configuration
- fail2ban
- fail2ban-jails
43 changes: 2 additions & 41 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,47 +71,8 @@
- fail2ban-configuration
- fail2ban-configuration-update

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

- name: copy actions
ansible.builtin.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
ansible.builtin.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: copy custom configurations
ansible.builtin.import_tasks: copy_custom_configurations.yml

- name: start and enable service
ansible.builtin.service:
Expand Down