瀏覽代碼

system.repo call curl with proxy env.

Change-Id: If5a8d56cc950ad0730ac728da20875a5c92bc194
fix-curl-behind-proxy2-proper-withcurlproxy
Petr Michalec 6 年之前
父節點
當前提交
c6b091150e
No account linked to committer's email address
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. +3
    -2
      linux/system/repo.sls

+ 3
- 2
linux/system/repo.sls 查看文件

@@ -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) %}

Loading…
取消
儲存