Explorar el Código

system.repo call curl with proxy env.

Change-Id: If5a8d56cc950ad0730ac728da20875a5c92bc194
fix-curl-behind-proxy2-proper-withcurlproxy
Petr Michalec hace 6 años
padre
commit
c6b091150e
Ninguna cuenta vinculada a la dirección de correo electrónico del committer
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. +3
    -2
      linux/system/repo.sls

+ 3
- 2
linux/system/repo.sls Ver fichero

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

Cargando…
Cancelar
Guardar