diff --git a/templates/users.htpasswd.j2 b/templates/users.htpasswd.j2 index fb9dec3..ac78fa7 100644 --- a/templates/users.htpasswd.j2 +++ b/templates/users.htpasswd.j2 @@ -1,5 +1,9 @@ # {{ ansible_managed }} {% for user in radicale_users %} +{% if user.password is match('^\$(apr1|2[abxy]?|argon2(i|d|id)|5|6)\$') %} {{ user.name }}:{{ user.password }} +{% else %} +{{ user.name }}:{{ user.password | password_hash('sha512', ((user.name ~ '@' ~ inventory_hostname) | hash('sha256'))[:16]) }} +{% endif %} {% endfor %}