From 7845013a39ce3620dd639bb3af1da3d05d562a15 Mon Sep 17 00:00:00 2001 From: "Adrien \"ze\" Urban" Date: Thu, 7 Mar 2019 11:53:59 +0100 Subject: [PATCH] groups: support `absent` like for users. Also remove warning for passing unknown arguments on group.absent --- users/init.sls | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/users/init.sls b/users/init.sls index 696ccbd..8804b6c 100644 --- a/users/init.sls +++ b/users/init.sls @@ -5,13 +5,17 @@ {% set used_user_files = [] %} {% for group, setting in salt['pillar.get']('groups', {}).items() %} -users_group_{{ setting.get('state', "present") }}_{{ group }}: - group.{{ setting.get('state', "present") }}: +{% if setting.absent is defined and setting.absent or setting.get('state', "present") == 'absent' %} +users_group_absent_{{ group }}: + group.absent: - name: {{ group }} - {%- if setting.get('gid') %} - - gid: {{setting.get('gid') }} - {%- endif %} +{% else %} +users_group_present_{{ group }}: + group.present: + - name: {{ group }} + - gid: {{ setting.get('gid') }} - system: {{ setting.get('system',"False") }} +{% endif %} {% endfor %} {%- for name, user in pillar.get('users', {}).items()