ansible-fail2ban
ansible-fail2ban copied to clipboard
Can we include multiple custom jail configuration files
I would like to specify custom jail by server type. Is it possible to use this jails declaration to promote reuse?
with fail2ban-default.yml that contains specific rules for ssh jails and fail2ban-nginx.yml that contains specific rules for nginx jails
vars_files:
- "{{inventory_dir}}/vars/fail2ban-nginx.yml"
- "{{inventory_dir}}/vars/fail2ban-default.yml"
That depends on what Ansible does with the inventory variables - I imagine that if you use the same variable name in both files, the latter file will override the earlier one. So, not at the moment, but perhaps it will be easier to do in the future - I'm exploring a solution for this.
Thanks for the response. These files contains fail2ban_jails and fail2ban_filters declarations which are, sometimes, specific for each component.