Kalyan
Kalyan

Reputation: 29

How to download an artifact from nexus to a remote machine using Ansible playbook

My requirement is to download an installation artifact OR jar file from Nexus 3.x repository and copy it to remote host using Ansible playbook.

I can able to ping the remote host from Ansible. Below is the playbook code.

- 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

Getting error- fatal: [10.0.3.22]: FAILED! => {"changed": false, "msg": "group_id must be set"}

Upvotes: 1

Views: 16034

Answers (1)

sebthebert
sebthebert

Reputation: 12507

Bad indentation issue:

- 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

Upvotes: 4

Related Questions