Merge pull request #188 from noelmcloughlin/allow_gid_change

Allow state to update the gid
This commit is contained in:
Niels Abspoel 2018-10-18 23:25:06 +02:00 committed by GitHub
commit adf2f81a4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View File

@ -9,6 +9,7 @@ users:
fullname: A User fullname: A User
## Full list of pillar values ## Full list of pillar values
allow_gid_change: False
buser: buser:
fullname: B User fullname: B User
password: $6$w............. password: $6$w.............
@ -27,6 +28,7 @@ users:
workphone: "(555) 555-5555" workphone: "(555) 555-5555"
homephone: "(555) 555-5551" homephone: "(555) 555-5551"
manage_vimrc: False manage_vimrc: False
allow_gid_change: True
manage_bashrc: False manage_bashrc: False
manage_profile: False manage_profile: False
expire: 16426 expire: 16426

View File

@ -4,3 +4,6 @@
users-formula: users-formula:
use_vim_formula: False use_vim_formula: False
users:
allow_gid_change: True

View File

@ -151,6 +151,9 @@ users_{{ name }}_user:
{% if not user.get('unique', True) %} {% if not user.get('unique', True) %}
- unique: False - unique: False
{% endif %} {% endif %}
{%- if grains['saltversioninfo'] >= [2018, 3, 1] %}
- allow_gid_change: {{ users.allow_gid_change if 'allow_gid_change' not in user else user['allow_gid_change'] }}
{%- endif %}
{% if 'expire' in user -%} {% if 'expire' in user -%}
{% if grains['kernel'].endswith('BSD') and {% if grains['kernel'].endswith('BSD') and
user['expire'] < 157766400 %} user['expire'] < 157766400 %}