From 5e0597304699d34eaed4c9d896406d758b2551d7 Mon Sep 17 00:00:00 2001 From: Max Mehl Date: Mon, 17 Jul 2023 17:01:42 +0200 Subject: [PATCH] use openssl instead of deprecated crypt module --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 9913ea7..4980935 100755 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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