2018-10-29 21:53:46 +01:00
|
|
|
---
|
2019-01-09 16:44:16 +01:00
|
|
|
|
2020-06-19 10:33:25 +02:00
|
|
|
- name: "Define the whitelist from variables"
|
|
|
|
set_fact:
|
2019-01-09 16:44:16 +01:00
|
|
|
fail2ban_ignore_ips: "{{ ['127.0.0.1/8'] | union(fail2ban_default_ignore_ips) | union(fail2ban_additional_ignore_ips) | unique }}"
|
|
|
|
|
2018-10-29 21:53:46 +01:00
|
|
|
- name: Update ignoreips lists
|
|
|
|
ini_file:
|
|
|
|
dest: /etc/fail2ban/jail.local
|
2019-01-09 16:44:16 +01:00
|
|
|
section: "DEFAULT"
|
|
|
|
option: "ignoreip"
|
2018-10-29 21:53:46 +01:00
|
|
|
value: "{{ fail2ban_ignore_ips | join(' ') }}"
|
|
|
|
notify: restart fail2ban
|
|
|
|
tags:
|
|
|
|
- fail2ban
|
2020-06-19 10:33:25 +02:00
|
|
|
- ips
|