瀏覽代碼

Merge pull request #92 from M2Mobi/master

Add possibility to manage the user's global git configuration.
tags/v0.45.0
Forrest 9 年之前
父節點
當前提交
3d2a32432f
共有 2 個文件被更改,包括 24 次插入0 次删除
  1. +5
    -0
      pillar.example
  2. +19
    -0
      users/init.sls

+ 5
- 0
pillar.example 查看文件

@@ -75,6 +75,11 @@ users:
options:
- "StrictHostKeyChecking yes"

gitconfig:
user.name: B User
user.email: buser@example.com
url."https://".insteadOf: "git://"

google_2fa: True
google_auth:
ssh: |

+ 19
- 0
users/init.sls 查看文件

@@ -381,6 +381,25 @@ users_googleauth-{{ svc }}-{{ name }}:
{%- endfor %}
{%- 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 %}



Loading…
取消
儲存