我的Nexus存储库中存在不同版本的war文件。
下面是我的验证码
---
- hosts: localhost
become: True
tasks:
- name: Download war file
maven_artifact:
group_id: in.flex
artifact_id: halosys
repository_url: 'http://34.239.122.5:8081/repository/halosys-release/'
username: admin
password: xxxxx
dest: /tmp/
请让我知道下载特定版本的战争文件的语法,例如Ansible中的 halosys-1.0.war,halosys-5.0.war
答案 0 :(得分:1)
- name: "Download war file"
maven_artifact:
group_id: in.flex
artifact_id: halosys
extension: war
version: 5.0
repository_url: "http://34.239.122.5:8081/repository/halosys-release/"
username: admin
password: xxxxx
dest: "/tmp/ROOT.war"
mode: '0644'
源:https://docs.ansible.com/ansible/latest/modules/maven_artifact_module.html#examples
最好有vars文件并使用jinja
例如
...
version: "{{ versions.halosys }}"
...