##### CONFIGURATION <!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes --> ``` Empty ```
##### OS / ENVIRONMENT Ubuntu 18.04 venv python3.8
##### STEPS TO REPRODUCE
A part of my playbook: ``` username_auth: admin user_password: hello #user_combinehash: "admin:{SHA}qvTGHdzF6KLavt4PO0gs2a6pQ00=" #user_combinehash: "admin:$$apr1$$2mYRX92I$$udcUHex5PBj4vMOVHRWiD." user_combinehash: "{{ username_auth }}:{{ user_password | hash('md5') }}"
```
A part of my role task: ``` labels: - "traefik.http.routers.dashboard.rule=(PathPrefix(`/api`) || PathPrefix(`/dashboard`))" - "traefik.http.routers.dashboard.service=api@internal" - "traefik.http.routers.dashboard.middlewares=auth" - "traefik.http.middlewares.auth.basicauth.users={{ user_combinehash }}" ```
##### EXPECTED RESULTS BasicAuth module of Traefik accept my hash password
##### ACTUAL RESULTS Playbook works, but When I tried to access to traefik Dashboard, access denied, password unrecongnized.
When I use variable: `user_combinehash: "admin:{SHA}qvTGHdzF6KLavt4PO0gs2a6pQ00="` It's works
all others did not work. But I need to have hash filter instead.
I tried with filter SHA1 and MD5
I already install python3-passlib
I'm sorry to don't understand where is the problem, Thanks
Dick Visser
unread,
Sep 13, 2020, 8:10:43 AM9/13/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
Hi
It looks like someone told you "it needs to be hashed" and then you
applied the 'hash' filter with ansible.
But there are many subtleties when it comes to hashing, even more so
with password hashing, and yet more because applications may expect
something specific/dialect.
I have no idea what "Traefik" is - you should look at their docs,
those should tell you exactly what its expects.
However, given that you mentioned that the {SHA} style password works,
and you also mentioned "basicauth", it might be the "standard" LDAP
SHA1, so try that: