From e8469ae75248c7020372985041eb5eeedb1ae22e Mon Sep 17 00:00:00 2001
From: Emil Renner Berthing <esmil@labitat.dk>
Date: Sun, 13 Jan 2019 22:12:16 +0100
Subject: users: optionally set user password

---
 roles/users/tasks/main.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/roles/users/tasks/main.yml b/roles/users/tasks/main.yml
index 23a4945..db38667 100644
--- a/roles/users/tasks/main.yml
+++ b/roles/users/tasks/main.yml
@@ -11,6 +11,7 @@
     comment: '{{ userdata[item].name }}'
     shell: "{{ ('shell' in userdata[item])|ternary(userdata[item].shell,'/bin/bash') }}"
     uid: '{{ userdata[item].uid }}'
+    password: "{{ ('password' in userdata[item])|ternary(userdata[item].password,omit) }}"
     group: users
     groups: "{{ (users[item] == 'sudo')|ternary([sudo_group],[]) }}"
   with_items: '{{ users|dictsort()|selectattr(1)|map(attribute=0)|list }}'
-- 
cgit v1.2.1