Pārlūkot izejas kodu

system.repo call curl with proxy env.

Change-Id: If5a8d56cc950ad0730ac728da20875a5c92bc194
fix-curl-behind-proxy2-proper-withcurlproxy
Petr Michalec pirms 6 gadiem
vecāks
revīzija
c6b091150e
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
1 mainītis faili ar 3 papildinājumiem un 2 dzēšanām
  1. +3
    -2
      linux/system/repo.sls

+ 3
- 2
linux/system/repo.sls Parādīt failu

@@ -112,13 +112,14 @@ linux_repo_{{ name }}_key:
#}
{%- elif repo.key_url|default(False) and grains['saltversioninfo'] < [2017, 7] and not repo.key_url.startswith('salt://') %}

{% set _export_proxy = "export no_proxy=${no_proxy:-" + system.proxy.get('noproxy', []) |join(',') + "} http_proxy=${http_proxy:-" + system.proxy.get('http', '') + "} https_proxy=${https_proxy:-" + system.proxy.get('https', '') +"}; " %}

linux_repo_{{ name }}_key:
cmd.run:
- name: "curl -sL {{ repo.key_url }} | apt-key add -"
- name: "{{ _export_proxy }} curl -sL {{ repo.key_url }} | apt-key add -"
{%- if not grains.get('kitchen-test') %}
{# omitted from tests, as behaves inconsistently across CI/platforms #}
- unless: "apt-key finger --with-colons | grep -qF $(curl -sL {{ repo.key_url }} | gpg --with-fingerprint --with-colons | grep -E '^fpr')"
- unless: "apt-key finger --with-colons | grep -qF $({{ _export_proxy }} curl -sL {{ repo.key_url }} | gpg --with-fingerprint --with-colons | grep -E '^fpr')"
{%- endif %}
- require_in:
{%- if repo.get('default', False) %}

Notiek ielāde…
Atcelt
Saglabāt