iamarunk
iamarunk

Reputation: 145

How to download specific version of war file from nexus using Ansible

I have different version of war file present in my Nexus repository.

enter image description here

Below is my ansible code

---
- 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/

Please let me know the syntax to download specific version of war file like halosys-1.0.war, halosys-5.0.war in Ansible

Upvotes: 0

Views: 1341

Answers (1)

Derioss
Derioss

Reputation: 101

- 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'

source : https://docs.ansible.com/ansible/latest/modules/maven_artifact_module.html#examples

it's better to have vars file and use jinja

exemple

...
version: "{{ versions.halosys }}"
...

Upvotes: 1

Related Questions