我的要求是从Nexus 3.x存储库下载安装工件或jar文件,然后使用Ansible剧本将其复制到远程主机。
我可以从Ansible ping通远程主机。下面是剧本代码。
- hosts: 10.0.3.22
tasks:
- maven_artifact:
group_id: com.setup
artifact_id: customerfile
repository_url: 'http://10.0.3.11:8081/repository/maven-releases/'
username: uname
password: pass
dest: /tmp/customerfile.jar
获取错误-致命:[10.0.3.22]:失败! => {“更改”:false,“ msg”:“必须设置group_id”}
答案 0 :(得分:1)
缩进错误:
- maven_artifact:
group_id: com.setup
artifact_id: customerfile
repository_url: 'http://10.0.3.11:8081/repository/maven-releases/'
username: uname
password: pass
dest: /tmp/customerfile.jar