浏览代码

added creation of default group to user without gid defined

Change-Id: I55ebc405f4534c02c3637bf45100031ea51c81de
pull/148/merge
Ondrej Smola 6 年前
父节点
当前提交
7f5087d5d1
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. +10
    -2
      linux/system/user.sls

+ 10
- 2
linux/system/user.sls 查看文件

@@ -15,6 +15,14 @@ include:
{%- endif %}
{%- endfor %}

{%- if user.gid is not defined %}
system_group_{{ name }}:
group.present:
- name: {{ name }}
- require_in:
- user: system_user_{{ name }}
{%- endif %}

system_user_{{ name }}:
user.present:
- name: {{ name }}
@@ -29,7 +37,7 @@ system_user_{{ name }}:
- password: {{ user.password }}
- hash_password: {{ user.get('hash_password', False) }}
{% endif %}
- gid_from_name: false
- gid_from_name: true
{%- if user.groups is defined %}
- groups: {{ user.groups }}
{%- endif %}
@@ -71,7 +79,7 @@ system_user_home_{{ user.home }}:

/etc/sudoers.d/90-salt-user-{{ name|replace('.', '-') }}:
file.absent
{%- endif %}

{%- else %}

正在加载...
取消
保存