Ansible uri 模块被代理重定向到 "url not safe, if you are sure click proceed" 站点

Ansible uri module being redirected to a "url not safe, if you are sure click proceed" site by proxy

我正在使用来自 ansible-galaxy 的这个角色来安装 solr。 - role: geerlingguy.solr

这是我的任务。

 hosts: all
  roles:
   - role: geerlingguy.solr
     solr_version: "5.5.4"
     solr_connect_host: localhost
  environment:
    "{{proxy_env}}" 

在安装过程中,运行是一个任务

"TASK [geerlingguy.solr : Check current list of Solr cores.] "

它使用 "uri" 模块来检查 solr 是否 运行ning。但是,由于我在 "uri" 向 http://localhost:8983/solr/admin/cores 发出请求时使用代理,uri 返回 403 重定向到

"Caution this site is not verified and can expose you to malware, viruses, and data loss, if you are sure you want to continue, click "proceed"".

如果我 运行 wget http://localhost:8983/solr/admin/cores 我没有得到重定向。

在我的 ansible 任务中,如果我使用 FQDN "solr_connect_host: MyServersHostname.example.com",则 uri 模块所做的检查会顺利通过。

我似乎无法用 wget/curl 重现 "caution please proceed" 页面问题。但是,我假设代理是导致问题的原因,因为使用 FQDN 有效,必须有某种类型的白名单允许。

我该如何解决这个问题?

确保在您的环境 proxy_env 中有一个包含 localhostno_proxy,否则代理将用于 localhost。