gpt4 book ai didi

Ansible get_url 超时

转载 作者:行者123 更新时间:2023-12-04 19:30:14 30 4
gpt4 key购买 nike

我在使用 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 }}

当我使用 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 }}

但它总是给我这个错误:
  "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": {

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

任何帮助,将不胜感激。

更新:

如果我使用 curl,根据 Zeitounator 提到的提示,它可以工作!我可以下载文件:
     curl -O -u --user user:password 'https://some_url/installer.jar' 

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

但是使用 Ansible 仍然没有运气。

最佳答案

如果配置了代理 @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

因为 get_url 模块的默认超时时间是 10 秒

关于Ansible get_url 超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60230191/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com