Need to download latest war file from Artifactory using get_url method in ansible.
- name: Download war file from artifactory
get_url:
url: http://localhost:5040/artifactory/webapp/#/artifacts/browse/tree/General/libs-snapshot-local/devops/ilp1/ILP/0.0.1-SNAPSHOT/ILP-0.0.1-20200408.072920-1.war
dest: /home/osgdev/devops_capstone/testnew/ILP_BookStoreWorkspace/roles/ansi
Below the code which i have tried.
name: Download war file from artifactory
get_url:
url: http://localhost:5040/artifactory/libs-snapshot-local/devops/ilp1/ILP/0.0.1-SNAPSHOT/latest.war
dest: /home/osgdev/devops_capstone/testnew/ILP_BookStoreWorkspace/roles/ansicode here
Getting the below message: TASK [ansi : Download war file from artifactory] *********************************************************************************************************************************************************** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ImportError: No module named lxml fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible_NrEV35/ansible_module_maven_artifact.py\", line 158, in \n from lxml import etree\nImportError: No module named lxml\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 0} to retry, use: --limit @/home/osgdev/devops_capstone/testnew/ILP_BookStoreWorkspace/roles/ansi/ansi.retry
PLAY RECAP ************************************************************************************************************************************************************************************************* localhost : ok=3 changed=0 unreachable=0 failed=1
I have 2 or more files is there, but i need to download the latest war file
ILP-0.0.1-20200408.072920-1.war ILP-0.0.1-20200410.071653-2.war
Please help on this.