将某些文件从Ansible Tower上传到ArtiFactory时出错 [英] Error uploading certain files from Ansible Tower to Artifactory
本文介绍了将某些文件从Ansible Tower上传到ArtiFactory时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我每次都收到这个错误,但只在尝试从Ansible Tower上传到ArtiFactory时的特定文件上。这些文件都是由Oracle_Collection_Tool在库存主机上创建的,然后在上载到ArtiFactory之前提取到Tower节点。文件在运行收集工具的主机上看起来都很正常,并且都已成功回迁。所有文件都会出现";值FALSE(类型为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 Tower实际上并不将文件获取到自身,而只是将它们复制到远程服务器上的临时目录(我在任何文档中都没有看到这一点),因此在上载到ArtiFactory时,它尝试从远程主机获取文件,因此我需要更多防火墙规则。
这篇关于将某些文件从Ansible Tower上传到ArtiFactory时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文