mirror of
https://github.com/saltstack-formulas/users-formula.git
synced 2024-11-27 22:38:34 +01:00
Only include users.sudo when a user with sudouser is declared.
This commit is contained in:
parent
76610eb63e
commit
8a07ab1332
@ -1,8 +1,6 @@
|
||||
# vim: sts=2 ts=2 sw=2 et ai
|
||||
{% from "users/map.jinja" import users with context %}
|
||||
|
||||
include:
|
||||
- users.sudo
|
||||
{% set used_sudo = False %}
|
||||
|
||||
{% for name, user in pillar.get('users', {}).items() if user.absent is not defined or not user.absent %}
|
||||
{%- if user == None -%}
|
||||
@ -127,6 +125,12 @@ ssh_auth_{{ name }}_{{ loop.index0 }}:
|
||||
|
||||
|
||||
{% if 'sudouser' in user and user['sudouser'] %}
|
||||
{% if not used_sudo %}
|
||||
{% set used_sudo = True %}
|
||||
include:
|
||||
- users.sudo
|
||||
{% endif %}
|
||||
|
||||
sudoer-{{ name }}:
|
||||
file.managed:
|
||||
- name: {{ users.sudoers_dir }}{{ name }}
|
||||
|
Loading…
Reference in New Issue
Block a user