Browse Source

groups: support `absent` like for users.

Also remove warning for passing unknown arguments on group.absent
tags/v0.45.0
Adrien "ze" Urban 5 years ago
parent
commit
7845013a39
1 changed files with 9 additions and 5 deletions
  1. +9
    -5
      users/init.sls

+ 9
- 5
users/init.sls View File

{% set used_user_files = [] %} {% set used_user_files = [] %}


{% for group, setting in salt['pillar.get']('groups', {}).items() %} {% for group, setting in salt['pillar.get']('groups', {}).items() %}
users_group_{{ setting.get('state', "present") }}_{{ group }}:
group.{{ setting.get('state', "present") }}:
{% if setting.absent is defined and setting.absent or setting.get('state', "present") == 'absent' %}
users_group_absent_{{ group }}:
group.absent:
- name: {{ group }} - name: {{ group }}
{%- if setting.get('gid') %}
- gid: {{setting.get('gid') }}
{%- endif %}
{% else %}
users_group_present_{{ group }}:
group.present:
- name: {{ group }}
- gid: {{ setting.get('gid') }}
- system: {{ setting.get('system',"False") }} - system: {{ setting.get('system',"False") }}
{% endif %}
{% endfor %} {% endfor %}


{%- for name, user in pillar.get('users', {}).items() {%- for name, user in pillar.get('users', {}).items()

Loading…
Cancel
Save