Browse Source

added creation of default group to user without gid defined

Change-Id: I55ebc405f4534c02c3637bf45100031ea51c81de
pull/148/merge
Ondrej Smola 6 years ago
parent
commit
7f5087d5d1
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      linux/system/user.sls

+ 10
- 2
linux/system/user.sls View File

@@ -15,6 +15,14 @@ include:
{%- endif %}
{%- endfor %}

{%- if user.gid is not defined %}
system_group_{{ name }}:
group.present:
- name: {{ name }}
- require_in:
- user: system_user_{{ name }}
{%- endif %}

system_user_{{ name }}:
user.present:
- name: {{ name }}
@@ -29,7 +37,7 @@ system_user_{{ name }}:
- password: {{ user.password }}
- hash_password: {{ user.get('hash_password', False) }}
{% endif %}
- gid_from_name: false
- gid_from_name: true
{%- if user.groups is defined %}
- groups: {{ user.groups }}
{%- endif %}
@@ -71,7 +79,7 @@ system_user_home_{{ user.home }}:

/etc/sudoers.d/90-salt-user-{{ name|replace('.', '-') }}:
file.absent
{%- endif %}

{%- else %}

Loading…
Cancel
Save