瀏覽代碼

Merge pull request #59 from FEI-Lithicon/master

Add support for 'expire' and stop managing home directory if createhome is set to False
tags/v0.45.0
Nitin Madhok 10 年之前
父節點
當前提交
a57f81a378
共有 2 個文件被更改,包括 7 次插入1 次删除
  1. +2
    -1
      pillar.example
  2. +5
    -0
      users/init.sls

+ 2
- 1
pillar.example 查看文件

@@ -9,8 +9,9 @@ users:
password: $6$w.............
home: /custom/buser
createhome: True
expire: 16426
sudouser: True
sudo_rules:
sudo_rules:
- ALL=(root) /usr/bin/find
- ALL=(otheruser) /usr/bin/script.sh
shell: /bin/bash

+ 5
- 0
users/init.sls 查看文件

@@ -22,6 +22,7 @@
{% endfor %}

{{ name }}_user:
{% if user.get('createhome', True) %}
file.directory:
- name: {{ home }}
- user: {{ name }}
@@ -30,6 +31,7 @@
- require:
- user: {{ name }}
- group: {{ user_group }}
{%- endif %}
group.present:
- name: {{ user_group }}
{%- if 'prime_group' in user and 'gid' in user['prime_group'] %}
@@ -58,6 +60,9 @@
{% if not user.get('createhome', True) %}
- createhome: False
{% endif %}
{% if 'expire' in user -%}
- expire: {{ user['expire'] }}
{% endif -%}
- remove_groups: {{ user.get('remove_groups', 'False') }}
- groups:
- {{ user_group }}

Loading…
取消
儲存