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

{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}


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

system_user_{{ name }}: system_user_{{ name }}:
user.present: user.present:
- name: {{ name }} - name: {{ name }}
- password: {{ user.password }} - password: {{ user.password }}
- hash_password: {{ user.get('hash_password', False) }} - hash_password: {{ user.get('hash_password', False) }}
{% endif %} {% endif %}
- gid_from_name: false
- gid_from_name: true
{%- if user.groups is defined %} {%- if user.groups is defined %}
- groups: {{ user.groups }} - groups: {{ user.groups }}
{%- endif %} {%- endif %}


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


{%- else %} {%- else %}

Loading…
Cancel
Save