ansible 2.3.2 中的错误- 不支持的代理方案:https

Error in ansible 2.3.2- Unsupported proxy scheme: https

我遇到错误:

 Unsupported proxy scheme: https. Currently ansible only supports HTTP proxies

虽然 运行 ansible v2.3.2 上的 ansible playbook 但同样是 运行 ansible v1.9.4:

environment:
  http_proxy: "http://{{ address }}:{{ port }}"
  https_proxy: "https://{{ address }}:{{ port }}"

ansible 模块是否有任何变化或如何解决这个问题?

我排除了故障,发现如果我们设置 HTTPS_PROXY 代替 http_proxy,很奇怪,但它的工作和软件包正在安装。

 HTTPS_PROXY: "https://{{ address }}:{{ port }}"

此问题也出现在 ansible 2.7.1

要避免此问题,您可以设置 validate_certs: false

这里有一个例子:

environment:
  http_proxy: http://IP:PORT
  https_proxy: https://IP:PORT

并在您的 get_url 或 apt 任务中添加 validate_certs: false

get_url:
      url: url
      dest: "{{ dest }}"
      validate_certs: false

我确认添加 validate_certs: false 可以解决问题:

get_url:
  url: url
  dest: "{{ dest }}"
  validate_certs: false

以下行不通:HTTPS_PROXY: "https://{{ address }}:{{ port }}"