Curl 如何使用ansible模块将文件上载到nexus?

Curl 如何使用ansible模块将文件上载到nexus?,curl,ansible,nexus,Curl,Ansible,Nexus,我们能够使用ansible的URI模块将文件上传到nexus而不是使用 curl——将文件作为shell任务上载?由于ansible 2.7,模块有一个src参数,应该可以完成这项任务 这样的任务(为了适应/完成NexusAPI的行为): -name:将jar推送到nexus uri: url:“{nexus\u url}}/nexus/content/repositories/{{path\u repository}}/{{artifact\u name}” 方法:将 src:{{local_

我们能够使用ansible的URI模块将文件上传到nexus而不是使用 curl——将文件作为shell任务上载?

由于ansible 2.7,模块有一个
src
参数,应该可以完成这项任务

这样的任务(为了适应/完成NexusAPI的行为):

-name:将jar推送到nexus
uri:
url:“{nexus\u url}}/nexus/content/repositories/{{path\u repository}}/{{artifact\u name}”
方法:将
src:{{local_file_path}}
用户:{{user}}
密码:{{password}}
强制基本授权:是
#标题:
#内容类型:application/octet stream#避免自动“application/x-www-form-urlencoded”
状态代码:
- 201

我尝试过它的url:“{nexus\u url}/{repository\u path}”并且它没有工作状态代码是403尝试添加
force\u basic\u auth:yes
这是curl查询:curl-v-u用户:password--上载文件file.json nexus\u url/nexus/content/repositories/path\u repository要获取它正在工作的文件,但要上载它,它看起来不应该是一个
PUT
,而不是
POST