use openssl instead of deprecated crypt module

This commit is contained in:
2023-07-17 17:01:42 +02:00
parent 543b3f6d96
commit 5e05973046

View File

@@ -32,7 +32,7 @@
salt: "{{ ((username + inventory_hostname) | hash('sha512'))[:16] }}"
- name: Encrypt password for user {{ username }}
shell: python3 -c 'import crypt; print(crypt.crypt("{{ password }}", "$6${{ salt }}"))'
ansible.builtin.command: openssl passwd -6 -salt "{{ salt }}" "{{ password }}"
register: username_shadowpw
changed_when: false