From 7c92645c5c576efba337579b3860c3d3f9116e06 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Wed, 19 Jul 2017 11:24:53 +0200 Subject: [PATCH] admin users: fix uidisbusy for proper rc check because of "failed_when: False", the register would never fail so we check the return code of "getent passwd" --- admin-users/tasks/adduser_debian.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin-users/tasks/adduser_debian.yml b/admin-users/tasks/adduser_debian.yml index 42816d41..9fca4725 100644 --- a/admin-users/tasks/adduser_debian.yml +++ b/admin-users/tasks/adduser_debian.yml @@ -16,7 +16,7 @@ shell: /bin/bash password: '{{ user.password_hash }}' update_password: on_create - when: uidisbusy | failed + when: uidisbusy.rc == 0 - name: "Add Unix account with random uid for '{{ user.name }}'" user: @@ -26,7 +26,7 @@ shell: /bin/bash password: '{{ user.password_hash }}' update_password: on_create - when: uidisbusy | success + when: uidisbusy.rc != 0 - name: "Fix perms on homedirectory for '{{ user.name }}'" file: