Browse Source

Fix, group members

Change-Id: I71c2dd4b1970b39427beda6465b7a4726b12897b
pull/118/head
Petr Michalec 7 years ago
parent
commit
a17ea5ae63
No account linked to committer's email address
2 changed files with 9 additions and 0 deletions
  1. +8
    -0
      linux/system/group.sls
  2. +1
    -0
      tests/pillar/system.sls

+ 8
- 0
linux/system/group.sls View File



{%- if group.enabled %} {%- if group.enabled %}


{%- set requires = [] %}
{%- for user in group.get('addusers', []) %}
{%- if user in system.get('user', {}).keys() %}
{%- do requires.append({'user': 'system_user_'+user}) %}
{%- endif %}
{%- endfor %}

system_group_{{ group_name }}: system_group_{{ group_name }}:
group.present: group.present:
- name: {{ group.get('name', group_name) }} - name: {{ group.get('name', group_name) }}
{%- if group.gid is defined and group.gid %} {%- if group.gid is defined and group.gid %}
- gid: {{ group.gid }} - gid: {{ group.gid }}
{%- endif %} {%- endif %}
- require: {{ requires|yaml }}
{{ set_p('addusers', group)|indent(2, True) }} {{ set_p('addusers', group)|indent(2, True) }}
{{ set_p('delusers', group)|indent(2, True) }} {{ set_p('delusers', group)|indent(2, True) }}



+ 1
- 0
tests/pillar/system.sls View File

enabled: true enabled: true
delusers: delusers:
- salt_user1 - salt_user1
- dontexistatall
salt-ops: salt-ops:
enabled: true enabled: true
name: salt-ops name: salt-ops

Loading…
Cancel
Save