summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 }}"