Giter Club home page Giter Club logo

Comments (1)

roumano avatar roumano commented on May 30, 2024

I confirm i get similar issue.

I don't think it's possible to fix this issue with the actual module (ini_file)

I've remove the actual ini_file tasks

- name: Configure jail.local
  community.general.ini_file:
  ...

and replace by a template tasks :

- name: Configure jail.local
  ansible.builtin.template:
    src: jail.local.j2
    dest: /etc/fail2ban/jail.local
    mode: "0640"
  notify:
    - Restart fail2ban

Of course, it's need to create the template file templates/jail.local.j2 :

{# Template to create the jail #}
{% for i in fail2ban_jail_configuration %}
[{{ i.name }}]
{% for k in i if k != 'name' %}
{{ k }} = {{ i[k] }}
{% endfor %}
{% endfor %}

And the configuration change also, please found a exemple :

fail2ban_jail_configuration:
  - name: DEFAULT
    ignoreself: 'true'
    destemail: [email protected]
    sender: root@{{ inventory_hostname }}.YYY.ZZ
  - name: guacamole
    enabled: 'true'
    port: 8080
    logpath: /var/log/tomcat9/catalina.out
    filter: guacamole_XXXX
    banaction: iptables-multiport
    maxretry: 2
    bantime: 1m
    findtime: 60m
    action: |
      iptables-guacamole[name="guacamole", port="8080", protocol="tcp"]
               smtp.py[host="smtp.XXX.YY:25", sender="[email protected]", dest="[email protected],[email protected]"]

i removed the tasks assert | Test fail2ban_jail_configuration (in assert.yml ) as the fail2ban_jail_configuration changed but ideally, it's should also be rewriten.

If you think it's the good way for fixing the issue, i can create a PR with these change.

from ansible-role-fail2ban.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.