Add possibility to manage the user's global git configuration.

This commit is contained in:
Heinz Wiesinger 2015-09-11 10:40:14 +02:00
parent 9dd98d57e7
commit 452b8ee8cf
2 changed files with 24 additions and 0 deletions

View File

@ -75,6 +75,11 @@ users:
options: options:
- "StrictHostKeyChecking yes" - "StrictHostKeyChecking yes"
gitconfig:
user.name: B User
user.email: buser@example.com
url."https://".insteadOf: "git://"
google_2fa: True google_2fa: True
google_auth: google_auth:
ssh: | ssh: |

View File

@ -381,6 +381,25 @@ users_googleauth-{{ svc }}-{{ name }}:
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}
{% if 'gitconfig' in user %}
{% for key, value in user['gitconfig'].items() %}
users_{{ name }}_user_gitconfig_{{ loop.index0 }}:
{% if grains['saltversioninfo'] >= (2015, 8, 0, 0) %}
git.config_set:
{% else %}
git.config:
{% endif %}
- name: {{ key }}
- value: "{{ value }}"
- user: {{ name }}
{% if grains['saltversioninfo'] >= (2015, 8, 0, 0) %}
- global: True
{% else %}
- is_global: True
{% endif %}
{% endfor %}
{% endif %}
{% endfor %} {% endfor %}