{"id":26414218,"url":"https://github.com/borisskert/ansible-fail2ban","last_synced_at":"2026-04-13T23:33:20.317Z","repository":{"id":104037053,"uuid":"263678747","full_name":"borisskert/ansible-fail2ban","owner":"borisskert","description":"Setup role to install and configure fail2ban","archived":false,"fork":false,"pushed_at":"2024-12-19T10:46:54.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T23:58:13.389Z","etag":null,"topics":["ansible","ansible-role","fail2ban","molecule","ubuntu"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/borisskert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-05-13T16:04:38.000Z","updated_at":"2024-12-19T10:46:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"c3827987-4141-4813-80cd-f0904df584f1","html_url":"https://github.com/borisskert/ansible-fail2ban","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/borisskert/ansible-fail2ban","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borisskert%2Fansible-fail2ban","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borisskert%2Fansible-fail2ban/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borisskert%2Fansible-fail2ban/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borisskert%2Fansible-fail2ban/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/borisskert","download_url":"https://codeload.github.com/borisskert/ansible-fail2ban/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borisskert%2Fansible-fail2ban/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31775888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T20:17:16.280Z","status":"ssl_error","status_checked_at":"2026-04-13T20:17:08.216Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-role","fail2ban","molecule","ubuntu"],"created_at":"2025-03-17T23:58:15.363Z","updated_at":"2026-04-13T23:33:20.275Z","avatar_url":"https://github.com/borisskert.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# ansible-fail2ban\n\nSetup role to install and configure fail2ban.\n\n## Requirements\n\n### For development and testing\n\n* python 3\n* yamllint\n* ansible\n* ansible-lint (pip package)\n* molecule (pip package)\n* molecule-vagrant (pip package)\n* Vagrant\n* VirtualBox\n\n### On server\n\n* Ubuntu\n  * 24.04\n  * 22.04\n  * 20.04\n* Debian\n  * 12\n  * 11\n\n## Role Variables\n\n| Variable name       | Type                 | Mandatory? | Default value | Description                                 |\n|---------------------|----------------------|------------|---------------|---------------------------------------------|\n| fail2ban_jail_local | text                 | no         |               | Place the content of your `jail.local` here |\n| fail2ban_jail_d     | array of `text_file` | no         | []            | Your local jail.d configuration files       |\n| fail2ban_action_d   | array of `text_file` | no         | []            | Your local action.d configuration files     |\n| fail2ban_filter_d   | array of `text_file` | no         | []            | Your local filter.d configuration files     |\n\n### Definition `text_file`\n\n| Variable name | Type     | Mandatory? | Default value | Description              |\n|---------------|----------|------------|---------------|--------------------------|\n| name          | filename | yes        |               | name of the file         |\n| content       | text     | yes        |               | content of the text file |\n\n## Dependencies\n\nNone so far.\n\n## Usage\n\n### Add to `requirements.yml`\n\n```yaml\n- name: setup-fail2ban\n  src: https://github.com/borisskert/ansible-fail2ban.git\n  scm: git\n```\n\n### Minimal `playbook.yml`\n\n```yaml\n- name: Minimal\n  hosts: all\n\n  roles:\n    - role: setup-fail2ban\n```\n\n### Typical `playbook.yml`\n\n```yaml\n---\n- name: Typical\n  hosts: all\n  become: true\n\n  roles:\n    - role: setup-fail2ban\n      fail2ban_jail_local: |\n        [DEFAULT]\n        ignoreip = 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16\n        bantime = 86400\n        banaction = route\n      fail2ban_action_d:\n        - name: route.local\n          content: |\n            [Definition]\n            actionban   = ip route add \u003cblocktype\u003e \u003cip\u003e\n            actionunban = ip route del \u003cblocktype\u003e \u003cip\u003e\n\n            [Init]\n            blocktype = unreachable\n      fail2ban_jail_d:\n        - name: ssh.local\n          content: |\n            [sshd]\n            enabled = true\n            filter = sshd\n      fail2ban_filter_d:\n        - name: sshd.local\n          content: |\n            [INCLUDES]\n            before = common.conf\n```\n\n## Linting\n\n`molecule` is checking the code style of this project, but you can\n check the concrete errors with the following commands: \n\n### Yamllint\n\n```shell script\nyamllint . --strict\n```\n\n### Ansible-lint\n\n```shell script\nansible-lint\n```\n\n## Testing\n\nRequirements:\n\n* [Vagrant](https://www.vagrantup.com/)\n* [libvirt](https://libvirt.org/)\n* [Ansible](https://docs.ansible.com/)\n* [Molecule](https://molecule.readthedocs.io/en/latest/index.html)\n* [yamllint](https://yamllint.readthedocs.io/en/stable/#)\n* [ansible-lint](https://docs.ansible.com/ansible-lint/)\n* [Docker](https://docs.docker.com/)\n\n### Run within docker\n\n```shell script\nmolecule test\n```\n\n### Run within Vagrant\n\n```shell script\n molecule test --scenario-name vagrant --parallel\n```\n\nI recommend to use [pyenv](https://github.com/pyenv/pyenv) for local testing.\nWithin the GitHub Actions pipeline I use [my own molecule action](https://github.com/borisskert/molecule-action).\n\n## License\n\nMIT\n\n## Author Information\n\n* [borisskert](https://github.com/borisskert)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborisskert%2Fansible-fail2ban","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborisskert%2Fansible-fail2ban","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborisskert%2Fansible-fail2ban/lists"}