mirror of
https://github.com/saltstack-formulas/users-formula.git
synced 2024-11-28 02:57:55 +01:00
Merge pull request #186 from M2Mobi/gitconfig_absent
Add possibility to remove user's git config keys
This commit is contained in:
commit
d3635f2ccb
@ -115,6 +115,10 @@ users:
|
|||||||
user.email: buser@example.com
|
user.email: buser@example.com
|
||||||
"url.https://.insteadOf": "git://"
|
"url.https://.insteadOf": "git://"
|
||||||
|
|
||||||
|
gitconfig.absent:
|
||||||
|
- push.default
|
||||||
|
- color\..+
|
||||||
|
|
||||||
google_2fa: True
|
google_2fa: True
|
||||||
google_auth:
|
google_auth:
|
||||||
ssh: |
|
ssh: |
|
||||||
|
@ -491,8 +491,9 @@ users_googleauth-{{ svc }}-{{ name }}:
|
|||||||
# - require_in:
|
# - require_in:
|
||||||
# - sls: users
|
# - sls: users
|
||||||
#
|
#
|
||||||
{% if 'gitconfig' in user %}
|
|
||||||
{% if salt['cmd.has_exec']('git') %}
|
{% if salt['cmd.has_exec']('git') %}
|
||||||
|
|
||||||
|
{% if 'gitconfig' in user %}
|
||||||
{% for key, value in user['gitconfig'].items() %}
|
{% for key, value in user['gitconfig'].items() %}
|
||||||
users_{{ name }}_user_gitconfig_{{ loop.index0 }}:
|
users_{{ name }}_user_gitconfig_{{ loop.index0 }}:
|
||||||
{% if grains['saltversioninfo'] >= [2015, 8, 0, 0] %}
|
{% if grains['saltversioninfo'] >= [2015, 8, 0, 0] %}
|
||||||
@ -510,6 +511,18 @@ users_{{ name }}_user_gitconfig_{{ loop.index0 }}:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if 'gitconfig.absent' in user and grains['saltversioninfo'] >= [2015, 8, 0, 0] %}
|
||||||
|
{% for key in user.get('gitconfig.absent') %}
|
||||||
|
users_{{ name }}_user_gitconfig_absent_{{ key }}:
|
||||||
|
git.config_unset:
|
||||||
|
- name: '{{ key }}'
|
||||||
|
- user: {{ name }}
|
||||||
|
- global: True
|
||||||
|
- all: True
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user