Ansible get_url 超时

Mar*_*ous 3 centos ansible

我在使用 Ansible 从 CentOs7 实例上的 Artifactory 下载 jar 文件时遇到问题。这是我第一次在 Linux 实例上这样做。

我在每个 Windows 实例上使用 win_get_url 模块并且它工作正常

   - name: download artifacts
     win_get_url:
       url: '{{ some_url }}'
       username: '{{ jfrog_username }}'
       password: '{{ jfrog_password }}'
       dest: '{{ some_dest }}'
       force: no
       proxy_url: {{ some_proxy }}
Run Code Online (Sandbox Code Playgroud)

当我使用 get_url 模块时,它超时了。我注意到 Linux 模块不支持参数“proxy_url”。所以我尝试使用其他一些参数来运行任务,例如

   - name: download artifacts
     get_url:
       url: '{{ some_url }}'
       username: '{{ jfrog_username }}'
       password: '{{ jfrog_password }}'
       dest: '{{ some_dest }}'
       force: no
       use_proxy: yes
       http_agent"{{ proxy }}
       checksum: {{ checksum }}
Run Code Online (Sandbox Code Playgroud)

但它总是给我这个错误:

  "status": -1,
  "url": "https://some_url/installer.jar",
  "msg": "Failed to connect to www.jfrog.io at port 443: [Errno 110] Connection timed out",
  "invocation": {
Run Code Online (Sandbox Code Playgroud)

我已检查防火墙设置,并且 https 已从/进入此服务器打开。

任何帮助,将不胜感激。

更新:

如果我使用curl,根据Zeitounator提到的提示,它可以工作!我可以通过以下方式下载文件:

     curl -O -u --user user:password 'https://some_url/installer.jar' 
Run Code Online (Sandbox Code Playgroud)

我没有使用代理密码。当curl询问代理密码时,我只需按回车键,curl就下载了文件,没有任何问题。

但使用 Ansible 仍然没有运气。

San*_*ole 6

如果配置了代理 @Zeitounator 回答正确。

但仍然可以尝试添加以下内容:

- name: download artifacts
 get_url:
   url: '{{ some_url }}'
   username: '{{ jfrog_username }}'
   password: '{{ jfrog_password }}'
   dest: '{{ some_dest }}'
   force: no
   use_proxy: yes
   http_agent"{{ proxy }}
   checksum: {{ checksum }}
   timeout: 30
Run Code Online (Sandbox Code Playgroud)

get_url 模块的默认超时为 10 秒