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"
This commit is contained in:
Jérémy Lecour 2017-07-19 11:24:53 +02:00 committed by Jérémy Lecour
parent 0115a16675
commit 7c92645c5c

View file

@ -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: