ansible-fail2ban icon indicating copy to clipboard operation
ansible-fail2ban copied to clipboard

Can we include multiple custom jail configuration files

Open jlerbsc opened this issue 8 years ago • 2 comments

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"

jlerbsc avatar Jan 09 '17 07:01 jlerbsc

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.

drybjed avatar Jan 09 '17 12:01 drybjed

Thanks for the response. These files contains fail2ban_jails and fail2ban_filters declarations which are, sometimes, specific for each component.

jlerbsc avatar Jan 09 '17 12:01 jlerbsc