【问题标题】:Error uploading certain files from Ansible Tower to Artifactory将某些文件从 Ansible Tower 上传到 Artifactory 时出错
【发布时间】:2021-03-03 09:38:39
【问题描述】:

我每次都收到此错误,但仅在尝试从 Ansible Tower 上传到 Artifactory 时出现在特定文件上。这些文件都是由 Oracle_Collection_Tool 在清单主机上创建的,然后在上传到 Artifactory 之前提取到 Tower 节点。这些文件在运行收集工具的主机上看起来都很正常,并且都被成功提取。所有文件都会出现“value False (type bool)”警告。 它不是 Artifactory 端的瓶颈,因为我尝试过限制它,并且只针对一个库存主机运行它。相同的文件每次都失败,而其他文件则成功。 剧本任务和错误输出如下。所有 URL/主机名/用户名等均已匿名。有人可以帮忙吗?

剧本任务:

    - name: Pushing bz2 file to artifactory
  uri:
    url: "{{ artifactory_url }}/{{ directory_str }}/{{ collection_file.stdout }}"
    user: "{{ artifactory_user }}"
    password: "{{ artifactory_password }}"
    force_basic_auth: yes
    method: PUT
    return_content: yes
    src: "/tmp/Oracle_Collection_Tool/output/{{ collection_file.stdout }}"
    headers:
       Content-Type: application/tar
       Accept: application/json
    status_code: 201
    remote_src: no

错误:

{
"status": -1,
"_ansible_no_log": false,
"warnings": [
    "The value False (type bool) in a string field was converted to u'False' (type string). If this does not look like what you expect, quote the entire value to ensure it does not change."
],
"url": "http://artifactory-host:8081/artifactory/linux-team-generic/Oracle_Audit/Collection-hostname_all.tar.bz2",
"changed": false,
"elapsed": 30,
"content": "",
"invocation": {
    "module_args": {
        "directory_mode": null,
        "force": false,
        "remote_src": "False",
        "status_code": [
            "201"
        ],
        "body_format": "raw",
        "owner": null,
        "follow": false,
        "client_key": null,
        "group": null,
        "use_proxy": true,
        "unix_socket": null,
        "unsafe_writes": null,
        "serole": null,
        "content": null,
        "setype": null,
        "follow_redirects": "safe",
        "return_content": true,
        "method": "PUT",
        "body": null,
        "timeout": 30,
        "url_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
        "dest": null,
        "selevel": null,
        "force_basic_auth": true,
        "removes": null,
        "http_agent": "ansible-httpget",
        "user": "linux_account",
        "regexp": null,
        "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
        "src": "/home/tower-username/.ansible/tmp/ansible-tmp-9999999999.99-999999999999999/Collection-hostname_all.tar.bz2",
        "url": "http://artifactory-host:8081/artifactory/linux-team-generic/Oracle_Audit/Collection-hostname_all.tar.bz2",
        "backup": null,
        "seuser": null,
        "client_cert": null,
        "creates": null,
        "headers": {
            "Content-Length": 12408,
            "Content-Type": "application/tar",
            "Accept": "application/json"
        },
        "delimiter": null,
        "mode": null,
        "url_username": "linux_account",
        "attributes": null,
        "validate_certs": true
    }
},
"redirected": false,
"msg": "Status code was -1 and not [201]: Request failed: <urlopen error timed out>"

}

【问题讨论】:

    标签: ansible artifactory ansible-tower


    【解决方案1】:

    事实证明,Ansible Tower 实际上并没有将文件提取到自己,而只是将它们复制到远程服务器上的临时目录(我在任何文档中都没有看到),所以当上传到 Artifactory 时,它正在尝试从远程主机执行此操作,因此我需要更多防火墙规则。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-11-29
      • 1970-01-01
      • 1970-01-01
      • 2021-11-30
      • 2016-11-09
      • 2017-07-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多