Sfoglia il codice sorgente

Resolve `git.config` error where minion does not have Git installed #115

tags/v0.45.0
Imran Iqbal 8 anni fa
parent
commit
846634bfd7
2 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. +3
    -0
      pillar.example
  2. +6
    -0
      users/init.sls

+ 3
- 0
pillar.example Vedi File

options: options:
- "StrictHostKeyChecking yes" - "StrictHostKeyChecking yes"


# Using gitconfig without Git installed will result in an error
# https://docs.saltstack.com/en/latest/ref/states/all/salt.states.git.html:
# This state module now requires git 1.6.5 (released 10 October 2009) or newer.
gitconfig: gitconfig:
user.name: B User user.name: B User
user.email: buser@example.com user.email: buser@example.com

+ 6
- 0
users/init.sls Vedi File

{%- endif %} {%- endif %}


{% if 'gitconfig' in user %} {% if 'gitconfig' in user %}
{% if not salt['cmd.has_exec']('git') %}
skip_{{ name }}_gitconfig_since_git_not_installed:
test.fail_without_changes:
- name: "Git configuration for user {{ name }} has been skipped because Git is not installed."
{% else %}
{% 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) %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% endif %}


{% endfor %} {% endfor %}



Loading…
Annulla
Salva