summaryrefslogtreecommitdiff
path: root/ansible_tools/roles/set-fail2ban/tasks/main.yml
blob: 778a8b0d1aa976b2db3ec852679ac65550061cc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
---
- name: Installing Fail2ban
  ansible.builtin.apt:
    update_cache: yes
    name: fail2ban

- name: Copy {{ item.src }} config
  ansible.builtin.template:
    src: "{{ item.src }}"
    dest: "{{ item.dest }}"
    owner: root
    group: root
    mode: 0644
    backup: yes
  loop:
    - { src: 'jail.conf.ubuntu.j2', dest: '/etc/fail2ban/jail.conf' }
    - { src: 'zimbra.conf.ubuntu.j2', dest: '/etc/fail2ban/filter.d/zimbra.conf' }
    - { src: 'zimbra-postfix.conf.ubuntu.j2', dest: '/etc/fail2ban/filter.d/zimbra-postfix.conf' }
    - { src: 'sendmail.conf.ubuntu.j2', dest: '/etc/fail2ban/action.d/sendmail.conf' }
    - { src: 'sendmail-common.conf.ubuntu.j2', dest: '/etc/fail2ban/action.d/sendmail-common.conf' }
  #notify: Reload fail2ban