Merge pull request #59 from FEI-Lithicon/master
Add support for 'expire' and stop managing home directory if createhome is set to False
This commit is contained in:
commit
a57f81a378
|
@ -9,6 +9,7 @@ users:
|
||||||
password: $6$w.............
|
password: $6$w.............
|
||||||
home: /custom/buser
|
home: /custom/buser
|
||||||
createhome: True
|
createhome: True
|
||||||
|
expire: 16426
|
||||||
sudouser: True
|
sudouser: True
|
||||||
sudo_rules:
|
sudo_rules:
|
||||||
- ALL=(root) /usr/bin/find
|
- ALL=(root) /usr/bin/find
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{{ name }}_user:
|
{{ name }}_user:
|
||||||
|
{% if user.get('createhome', True) %}
|
||||||
file.directory:
|
file.directory:
|
||||||
- name: {{ home }}
|
- name: {{ home }}
|
||||||
- user: {{ name }}
|
- user: {{ name }}
|
||||||
|
@ -30,6 +31,7 @@
|
||||||
- require:
|
- require:
|
||||||
- user: {{ name }}
|
- user: {{ name }}
|
||||||
- group: {{ user_group }}
|
- group: {{ user_group }}
|
||||||
|
{%- endif %}
|
||||||
group.present:
|
group.present:
|
||||||
- name: {{ user_group }}
|
- name: {{ user_group }}
|
||||||
{%- if 'prime_group' in user and 'gid' in user['prime_group'] %}
|
{%- if 'prime_group' in user and 'gid' in user['prime_group'] %}
|
||||||
|
@ -58,6 +60,9 @@
|
||||||
{% if not user.get('createhome', True) %}
|
{% if not user.get('createhome', True) %}
|
||||||
- createhome: False
|
- createhome: False
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if 'expire' in user -%}
|
||||||
|
- expire: {{ user['expire'] }}
|
||||||
|
{% endif -%}
|
||||||
- remove_groups: {{ user.get('remove_groups', 'False') }}
|
- remove_groups: {{ user.get('remove_groups', 'False') }}
|
||||||
- groups:
|
- groups:
|
||||||
- {{ user_group }}
|
- {{ user_group }}
|
||||||
|
|
Loading…
Reference in New Issue