Using Get_Url Module

--- # Installing Appdyamic Agent
- hosts: localhost
user: root
sudo: yes
connection: ssh
gather_facts: yes
tasks:

- name: Download foo.conf
get_url: url=https://artifactory.xx.org:8443/artifactory/AdCanProcessor.war dest=/home/john/AdCanProcessor.zip mode=0440 force_basic_auth=yes
I am trying to pull a war file from artifactory but below is error that i am getting
fatal: [localhost]: FAILED! => {"changed": false, "dest": "/home/john/AdCanProcessor.war", "msg": "Request failed", "response": "HTTP Error 401: ", "state": "absent", "status_code": 401, "url": "https://artifactory.xx.org:8443/artifactory/AdCanProcessor.zip"}
What i am trying to do is pull zip file from artifactory and trying to upload it on the server. To log into Artifactory it requires username/password. Can someone help?



  • post-author-pic
    Piotr N
    12-19-2018

    I think that you must use url_password and url_username attribute.

  • post-author-pic
    Stosh O
    12-19-2018

    Using the additional parameters Piotr noted should address your issue.

Looking For Team Training?

Learn More