首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >不可用的get_url模块:无法找到文件的校验和

不可用的get_url模块:无法找到文件的校验和
EN

Stack Overflow用户
提问于 2020-11-11 16:30:59
回答 1查看 1.5K关注 0票数 1

我试图使用以下方法获取ActiveMQ Artemis:

代码语言:javascript
复制
- name: Download the ActiveMQ Artemis artifact
  get_url:
    url: "https://www.apache.org/dyn/closer.cgi?filename=activemq/activemq-artemis/{{ artemis_version }}/apache-artemis-{{ artemis_version }}-bin.tar.gz&action=download"
    dest: "/tmp/apache-artemis-{{ artemis_version }}-bin.tar.gz"
    #with fixed checksumm it works but breaks the idea of the version to be a variable.
    #checksum: "sha512:4990a6b742b08bff6a4c7b310d2610565b08a2a02e1a7aec065460d16f8a6fe3d4fe91a8040839f93d7c2eab09fd6a79848fb130f9820559ee3e81dcf8d51ead"
    #Getting "Unable to find a checksum for file 'closer.cgi' in 'https://downloads.apache.org/activemq/activemq-artemis/2.16.0/apache-artemis-2.16.0-bin.tar.gz.sha512'"
    checksum: "sha512:https://downloads.apache.org/activemq/activemq-artemis/{{ artemis_version }}/apache-artemis-{{ artemis_version }}-bin.tar.gz.sha512"
    #Also getting: fatal: [dev-broker-01]: FAILED! => {"changed": false, "dest": "/tmp/apache-artemis-2.16.0-bin.tar.gz", "elapsed": 0, "msg": "Request failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)>", "url": "https://www.apache.org/dyn/closer.cgi?filename=activemq/activemq-artemis/2.16.0/apache-artemis-2.16.0-bin.tar.gz&action=download"}
    validate_certs: no

获取:“无法在'closer.cgi‘中找到文件’https://downloads.apache.org/activemq/activemq-artemis/2.16.0/apache-artemis-2.16.0-bin.tar.gz.sha512'‘的校验和--它没有从dest中提取文件名:”/tmp/apache-artemis-{ artemis_version }}-bin.tar.gz“

也有一些问题验证证书。

有什么办法解决这两个问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-11-11 17:24:17

这个错误似乎表明它是在寻找文件closer.cgi的校验和,而不是实际的tar.gz文件。校验和URL中的文件名是:apache-artemis-2.16.0-bin.tar.gz

另一种指定校验和的方法是只提供校验和字符串(没有文件名)。尽管为此,我们需要在得到它之前提出几个任务。

如下所示:

代码语言:javascript
复制
- uri:
    url: "https://downloads.apache.org/activemq/activemq-artemis/{{ artemis_version }}/apache-artemis-{{ artemis_version }}-bin.tar.gz.sha512"
    return_content: true
  register: url_sha512
- set_fact:
    artemis_checksum: "{{ url_sha512.content.split('  ')[0] }}"      # there are 2 spaces
- get_url:
    url: "https://www.apache.org/dyn/closer.cgi?filename=activemq/activemq-artemis/{{ artemis_version }}/apache-artemis-{{ artemis_version }}-bin.tar.gz&action=download"
    dest: "/tmp/apache-artemis-{{ artemis_version }}-bin.tar.gz"
    checksum: "sha512:{{ artemis_checksum }}"
    # I was able to download without having below parameter
    # validate_certs: no

更新:

当无法浏览站点目录,并且必须从镜像URL获取文件时,这种方法可能很有用。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64790351

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档