Oefenweb / ansible-fail2ban

Ansible role to set up fail2ban in Debian-like systems
MIT License
117 stars 55 forks source link

Installed role / Role not found #78

Closed MalteKiefer closed 1 year ago

MalteKiefer commented 1 year ago

I have installed the role with this command:

ansible-galaxy install oefenweb.fail2ban

I try to build a playbook like this:

---
- hosts: all
  roles:
    - fail2ban
  vars:
    fail2ban_banaction: 'ufw'
    fail2ban_services:
      - name: sshd
        maxretry: 5
        bantime: -1

This is my error that I get:

 ~/E/ansible  ansible-playbook -i inventory/host.yml playbooks/deploy_fail2ban.yml                                                                                                                                                                    2119ms  Do  4 Mai 11:24:37 2023
ERROR! the role 'fail2ban' was not found in /Users/xxx/Entwicklung/ansible/playbooks/roles:/Users/xxx/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/Users/xxx/Entwicklung/ansible/playbooks

The error appears to be in '/Users/xxx/Entwicklung/ansible/playbooks/deploy_fail2ban.yml': line 4, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  roles:
    - fail2ban
      ^ here
tersmitten commented 1 year ago

If you install it from galaxy (using ansible-galaxy install oefenweb.fail2ban) you should "use" it like this:

  roles:
    - oefenweb.fail2ban
MalteKiefer commented 1 year ago

Thanks, that was my issue