debops / ansible-fail2ban

Install and configure fail2ban service
GNU General Public License v3.0
38 stars 15 forks source link

Can we include multiple custom jail configuration files #17

Open jlerbsc opened 7 years ago

jlerbsc commented 7 years ago

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"
drybjed commented 7 years ago

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.

jlerbsc commented 7 years ago

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