| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- ---
- - name: Install fail2ban
- ansible.builtin.dnf:
- name: fail2ban
- state: present
- - name: Deploy nginx-4xx filter
- ansible.builtin.template:
- src: nginx-4xx.conf.j2
- dest: /etc/fail2ban/filter.d/nginx-4xx.conf
- owner: root
- group: root
- mode: '0644'
- backup: yes
- notify: restart fail2ban
- - name: Deploy nginx-auth filter
- ansible.builtin.template:
- src: nginx-auth.conf.j2
- dest: /etc/fail2ban/filter.d/nginx-auth.conf
- owner: root
- group: root
- mode: '0644'
- backup: yes
- notify: restart fail2ban
- - name: Deploy jail.local configuration
- ansible.builtin.template:
- src: jail.local.j2
- dest: /etc/fail2ban/jail.local
- owner: root
- group: root
- mode: '0644'
- backup: yes
- notify: restart fail2ban
- - name: Enable and start fail2ban service
- ansible.builtin.service:
- name: fail2ban
- state: started
- enabled: yes
|