From 4012a014ce21b8b4dbf7c2f044ab21e5175680db Mon Sep 17 00:00:00 2001 From: Jeremy Dubois Date: Thu, 22 Oct 2020 11:52:54 +0200 Subject: [PATCH] =?UTF-8?q?Add=20user=20with=20legacy=20hash=20($2a?= =?UTF-8?q?=E2=80=A6)=20instead=20of=20current=20hash=20($2b=E2=80=A6)=20f?= =?UTF-8?q?or=20OpenBSD=20versions=20older=20than=205.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- roles/accounts/tasks/user.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/roles/accounts/tasks/user.yml b/roles/accounts/tasks/user.yml index b0965f9..8964b0f 100644 --- a/roles/accounts/tasks/user.yml +++ b/roles/accounts/tasks/user.yml @@ -5,6 +5,20 @@ name: "{{ user.name }}" gid: "{{ user.uid }}" +- name: "User '{{ user.name }}' is present with legacy hash" + user: + state: present + name: '{{ user.name }}' + uid: '{{ user.uid }}' + password: "{{ user.password_hash_openbsd_legacy }}" + group: "{{ user.name }}" + groups: wheel + shell: /bin/ksh + append: true + when: ansible_distribution_version is version_compare("5.7",'<') + tags: + - admin + - name: "User '{{ user.name }}' is present" user: state: present @@ -15,6 +29,7 @@ groups: wheel shell: /bin/ksh append: true + when: ansible_distribution_version is version_compare("5.7",'>=') tags: - admin