将某些文件从 Ansible Tower 上传到 Artifactory 时出错

问题描述

我每次都会收到此错误,但仅在尝试从 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","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>"

}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)