use openssl instead of deprecated crypt module
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user