Files
ansible_role_mail/templates/dovecot-users.j2
Luciano Giacchetta e350a39a29 refactor(dovecot): replace template hashing with openssl command
- Add `openssl` to the list of installed packages to ensure CLI availability.
- Introduce a new task to generate user password hashes using `openssl passwd -6` on the target host instead of relying on the Jinja2 `password_hash` filter.
- Update `dovecot-users.j2` template to utilize the registered output from the new OpenSSL task.
- This ensures consistent SHA512-CRYPT hash generation independent of the controller's Python environment or hashing libraries.
2026-02-10 18:10:01 -03:00

8 lines
301 B
Django/Jinja

# Dovecot users file
# Ansible managed: {{ ansible_managed }}
# user:{scheme}hash:uid:gid:gecos:home:shell:extra_fields
{% if dovecot_user_hashes.results is defined %}
{% for res in dovecot_user_hashes.results %}
{{ res.item.name }}:{SHA512-CRYPT}{{ res.stdout | trim }}::::::
{% endfor %}
{% endif %}