Browse Source

Merge branch 'master' of https://github.com/IMBArator/users-formula

tags/v0.45.0
Maximilian Zettler 6 years ago
parent
commit
83c9ad42c8
2 changed files with 9 additions and 4 deletions
  1. +8
    -2
      users/init.sls
  2. +1
    -2
      users/polkit.sls

+ 8
- 2
users/init.sls View File

{% set used_sudo = [] %} {% set used_sudo = [] %}
{% set used_googleauth = [] %} {% set used_googleauth = [] %}
{% set used_user_files = [] %} {% set used_user_files = [] %}
{% set used_polkit = False %}


{%- for name, user in pillar.get('users', {}).items() {%- for name, user in pillar.get('users', {}).items()
if user.absent is not defined or not user.absent %} if user.absent is not defined or not user.absent %}
{%- if salt['pillar.get']('users:' ~ name ~ ':user_files:enabled', False) %} {%- if salt['pillar.get']('users:' ~ name ~ ':user_files:enabled', False) %}
{%- do used_user_files.append(1) %} {%- do used_user_files.append(1) %}
{%- endif %} {%- endif %}
{%- if user.get('polkitadmin', False) == True %}
{%- set used_polkit = True %}
{%- endif %}
{%- endfor %} {%- endfor %}


{%- if used_sudo or used_googleauth or used_user_files %}
{%- if used_sudo or used_googleauth or used_user_files or used_polkit %}
include: include:
{%- if used_sudo %} {%- if used_sudo %}
- users.sudo - users.sudo
{%- if used_user_files %} {%- if used_user_files %}
- users.user_files - users.user_files
{%- endif %} {%- endif %}
{%- endif %}
{%- if used_polkit %}
- users.polkit - users.polkit
{%- endif %}
{%- endif %}


{% for name, user in pillar.get('users', {}).items() {% for name, user in pillar.get('users', {}).items()
if user.absent is not defined or not user.absent %} if user.absent is not defined or not user.absent %}

+ 1
- 2
users/polkit.sls View File

{% for name, user in pillar.get('users', {}).items() %} {% for name, user in pillar.get('users', {}).items() %}
{% if user.absent is not defined or not user.absent %} {% if user.absent is not defined or not user.absent %}
{% if 'polkitadmin' in user and user['polkitadmin'] %} {% if 'polkitadmin' in user and user['polkitadmin'] %}
{% if polkitusers.update({'value': polkitusers.value + 'unix-user:' + name + ';'}) %}
{% endif %}
{% do polkitusers.update({'value': polkitusers.value + 'unix-user:' + name + ';'}) %}
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}

Loading…
Cancel
Save