From 694fd0de6ddbc5dee0b688f15c0d1d1d0c15c178 Mon Sep 17 00:00:00 2001 From: Arthur Date: Tue, 18 Apr 2017 19:57:18 +0200 Subject: [PATCH 1/2] added feature to create groups and set their gid --- users/init.sls | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/users/init.sls b/users/init.sls index a4f6cba..6bd2c1c 100644 --- a/users/init.sls +++ b/users/init.sls @@ -4,6 +4,16 @@ {% set used_googleauth = [] %} {% set used_user_files = [] %} +{% for group, setting in salt['pillar.get']('groups', {}).iteritems() %} +users_group_{{ setting.get('state', "present") }}_{{ group }}: + group.{{ setting.get('state', "present") }}: + - name: {{ group }} + {%- if setting.get('gid') %} + - gid: {{setting.get('gid') }} + {%- endif %} + - system: {{ setting.get('system',"False") }} +{% endfor %} + {%- for name, user in pillar.get('users', {}).items() if user.absent is not defined or not user.absent %} {%- if user == None -%} From e4860322834a5f21cadf470a1ebafa3991a6cc17 Mon Sep 17 00:00:00 2001 From: Arthur Date: Tue, 25 Apr 2017 19:29:00 +0200 Subject: [PATCH 2/2] not more need for homedir, if not needed --- users/init.sls | 2 ++ 1 file changed, 2 insertions(+) diff --git a/users/init.sls b/users/init.sls index 6bd2c1c..c8e5136 100644 --- a/users/init.sls +++ b/users/init.sls @@ -89,7 +89,9 @@ users_{{ name }}_user: {% endif %} user.present: - name: {{ name }} + {% if user.get('createhome', True) -%} - home: {{ home }} + {% endif -%} - shell: {{ user.get('shell', current.get('shell', users.get('shell', '/bin/bash'))) }} {% if 'uid' in user -%} - uid: {{ user['uid'] }}