Merge pull request #194 from ze42/groups_members

Groups members
This commit is contained in:
Niels Abspoel 2019-05-03 23:23:07 +02:00 committed by GitHub
commit d4f8cf955d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 5 deletions

View File

@ -176,3 +176,17 @@ users:
absent_users: absent_users:
- donald - donald
- bad_guy - bad_guy
groups:
badguys:
absent: True
niceguys:
gid: 4242
system: False
addusers: root
delusers: toor
ssl-cert:
system: True
members:
- www-data
- openldap

View File

@ -5,13 +5,20 @@
{% 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 }}: {% if setting.absent is defined and setting.absent or setting.get('state', "present") == 'absent' %}
group.{{ setting.get('state', "present") }}: users_group_absent_{{ group }}:
group.absent:
- name: {{ group }} - name: {{ group }}
{%- if setting.get('gid') %} {% else %}
- gid: {{setting.get('gid') }} users_group_present_{{ group }}:
{%- endif %} group.present:
- name: {{ group }}
- gid: {{ setting.get('gid', "null") }}
- system: {{ setting.get('system',"False") }} - system: {{ setting.get('system',"False") }}
- members: {{ setting.get('members')|json }}
- addusers: {{ setting.get('addusers')|json }}
- delusers: {{ setting.get('delusers')|json }}
{% endif %}
{% endfor %} {% endfor %}
{%- for name, user in pillar.get('users', {}).items() {%- for name, user in pillar.get('users', {}).items()