summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-12-16 15:25:11 +0200
committerLars Wirzenius <liw@liw.fi>2017-12-16 15:25:11 +0200
commite7afc13285b725faf0bdcadbb3cc4888e1f81b64 (patch)
treedd64532b490dd572204e98ef87d32eff260f2343 /roles
parent7f3a53e8bd1c54ce54d6acee3a4310cbeb9b9ea6 (diff)
downloaddebian-ansible-e7afc13285b725faf0bdcadbb3cc4888e1f81b64.tar.gz
Fix: only set password if one is given
Previously this would set the encrypted password to xxx which means authn never works. I'm so stupid that the only reason I breathe is because my body doesn't let me have a vote in the matter.
Diffstat (limited to 'roles')
-rw-r--r--roles/unix_users/tasks/main.yml8
1 files changed, 7 insertions, 1 deletions
diff --git a/roles/unix_users/tasks/main.yml b/roles/unix_users/tasks/main.yml
index adcb90e..19f0dac 100644
--- a/roles/unix_users/tasks/main.yml
+++ b/roles/unix_users/tasks/main.yml
@@ -5,7 +5,13 @@
comment: "{{ item.comment|default('unnamed user') }}"
shell: "{{ item.shell|default('/bin/bash') }}"
system: "{{ item.system|default('no') }}"
- password: "{{ item.password|default('xxx') }}"
+
+- name: set password for users
+ with_items: "{{ unix_users }}"
+ when: item.password is defined
+ user:
+ name: "{{ item.username }}"
+ password: "{{ item.password }}"
- name: create ~/.ssh for each user
with_items: "{{ unix_users }}"