# Regarding get\_url issue in ansible

**URL:** <https://forum.ansible.com/t/regarding-get-url-issue-in-ansible/36541>\
**Category:** Ansible Project\
**Created:** [April 19, 2022, 11:42am UTC](https://forum.ansible.com/t/regarding-get-url-issue-in-ansible/36541 "2022-04-19T11:42:28Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashok-2017](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ashok-2017/32/659_2.png) [@Ashok-2017](https://forum.ansible.com/u/Ashok-2017)\
**Post date:** [April 19, 2022, 11:42am UTC](https://forum.ansible.com/t/regarding-get-url-issue-in-ansible/36541/1 "2022-04-19T11:42:28Z")

</div>

- name: Download dms ear file to local  
get\_url:  
url: “[https://artifactory.sicpa.com/artifactory/](https://artifactory.sicpa.com/artifactory/){{ artifactory\_folder }}/com/sicpa/gssd/tt040\_my/server/dms/tt040\_my-dms-ear/{{ dms\_release\_version }}/tt040\_my-dms-ear-{{ dms\_release\_version }}.ear”  
dest: /tmp  
url\_username: “{{ v\_artifactory\_user }}”  
url\_password: “{{ v\_artifactory\_passwd }}”  
force\_basic\_auth: yes  
delegate\_to: localhost  
#run\_once: true  
tags: deploy\_dms

error:

TASK [Download dms ear file to local] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* e[0;31mfatal: [[dmsdb.tt040int.dev.sicpa.io](http://dmsdb.tt040int.dev.sicpa.io) → localhost]: FAILED! =\> {“changed”: false, “dest”: “/tmp”, “elapsed”: 0, “gid”: 0, “group”: “root”, “mode”: “01777”, “msg”: “Request failed”, “owner”: “root”, “response”: “HTTP Error 409: Conflict”, “size”: 196, “state”: “directory”, “status\_code”: 409, “uid”: 0, “url”: “[https://artifactory.sicpa.com/artifactory/gssd-dev-snapshots-local/com/sicpa/gssd/tt040\_my/server/dms/tt040\_my-dms-ear/2.6.0/tt040\_my-dms-ear-2.6.0.ear](https://artifactory.sicpa.com/artifactory/gssd-dev-snapshots-local/com/sicpa/gssd/tt040_my/server/dms/tt040_my-dms-ear/2.6.0/tt040_my-dms-ear-2.6.0.ear)”}e[0m

---

<div class="post-metadata">

**Author:** ![dulhaver](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dulhaver/32/1061_2.png) [@dulhaver](https://forum.ansible.com/u/dulhaver)\
**Post date:** [April 19, 2022, 4:02pm UTC](https://forum.ansible.com/t/regarding-get-url-issue-in-ansible/36541/2 "2022-04-19T16:02:59Z")

</div>

I was under the impression that delegate\_to comes prior the TASK’s details, like

- name: Download dms ear file to local  
delegate\_to: localhost  
get\_url:  
url: [“https://artifactory.sicpa.com/artifactory/{{ artifactory\_folder }}/com/sicpa/gssd/tt040\_my/server/dms/tt040\_my-dms-ear/{{ dms\_release\_version }}/tt040\_my-dms-ear-{{ dms\_release\_version }}.ear”](https://artifactory.sicpa.com/artifactory/%7B%7Bartifactory_folder%7D%7D/com/sicpa/gssd/tt040_my/server/dms/tt040_my-dms-ear/%7B%7Bdms_release_version%7D%7D/tt040_my-dms-ear-%7B%7Bdms_release_version%7D%7D.ear)  
dest: /tmp  
url\_username: “{{ v\_artifactory\_user }}”  
url\_password: “{{ v\_artifactory\_passwd }}”  
force\_basic\_auth: yes  
#run\_once: true  
tags: deploy\_dms

that aside the error messages makes me think to investigate [what HTTP Error 409 is](https://www.ecosia.org/search?q=%22HTTP+Error+409%22&addon=opensearch) and go further down that road

---

<div class="post-metadata">

**Author:** ![Ashok-2017](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ashok-2017/32/659_2.png) [@Ashok-2017](https://forum.ansible.com/u/Ashok-2017)\
**Post date:** [April 21, 2022, 5:13am UTC](https://forum.ansible.com/t/regarding-get-url-issue-in-ansible/36541/3 "2022-04-21T05:13:35Z")

</div>

Yes I agree with you I have tried to narrow down the issue based on the https status error 409 but could n’t be able to figure out.  
Let me try once . Thanks for all your help.

---

<div class="post-metadata">

**Author:** ![Ashok-2017](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ashok-2017/32/659_2.png) [@Ashok-2017](https://forum.ansible.com/u/Ashok-2017)\
**Post date:** [April 26, 2022, 11:25am UTC](https://forum.ansible.com/t/regarding-get-url-issue-in-ansible/36541/4 "2022-04-26T11:25:56Z")

</div>

Hi ,

Can some one help me the issue?

I could n’t be able to figure it out .

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [April 26, 2022, 4:12pm UTC](https://forum.ansible.com/t/regarding-get-url-issue-in-ansible/36541/5 "2022-04-26T16:12:34Z")

</div>

The error you're getting is from the API at [https://artifactory.sicpa.com](https://artifactory.sicpa.com), and has nothing to do with the ansible get\_url module that is used to interact with it.

get\_url is merely a conveyor belt that is used to send your (incorrect) data.

You should find out how that API is supposed to be used.

---

<div class="post-metadata">

**Author:** ![Ashok-2017](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ashok-2017/32/659_2.png) [@Ashok-2017](https://forum.ansible.com/u/Ashok-2017)\
**Post date:** [May 5, 2022, 2:40am UTC](https://forum.ansible.com/t/regarding-get-url-issue-in-ansible/36541/6 "2022-05-05T02:40:13Z")

</div>

Thanks for your input, but not sure how to verify jfrog API?  
Can you please help me, meanwhile I can try to figure it?

Note: r u suggesting me to check jfrog API or else?

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [May 5, 2022, 3:02am UTC](https://forum.ansible.com/t/regarding-get-url-issue-in-ansible/36541/7 "2022-05-05T03:02:55Z")

</div>

I don’t know what ‘jfrog’ is and what that has to do with this. Either way you should consult the docs for the api you’re trying to use, which (from your playbook and errors) is at

[https://artifactory.sicpa.com/](https://artifactory.sicpa.com/).

That should give you the information you need, to avoid errors like you got.

---

<div class="post-metadata">

**Author:** ![skratbag](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/skratbag/32/4836_2.png) [@skratbag](https://forum.ansible.com/u/skratbag)\
**Post date:** [May 5, 2022, 3:44am UTC](https://forum.ansible.com/t/regarding-get-url-issue-in-ansible/36541/8 "2022-05-05T03:44:46Z")

</div>

Hi Ashok,

It does appear as though the task has done its work well, there is an article here [https://jfrog.com/knowledge-base/how-to-resolve-the-replication-error-conflict-409/](https://jfrog.com/knowledge-base/how-to-resolve-the-replication-error-conflict-409/) that should be able to give you an indicator as to what has gone wrong. The actual api is documented here [https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API](https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API)

Regards

---

<div class="post-metadata">

**Author:** ![Ashok-2017](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ashok-2017/32/659_2.png) [@Ashok-2017](https://forum.ansible.com/u/Ashok-2017)\
**Post date:** [May 5, 2022, 10:00am UTC](https://forum.ansible.com/t/regarding-get-url-issue-in-ansible/36541/9 "2022-05-05T10:00:50Z")

</div>

Ok got it let me try.

I have written some code in ansible.  
Can you please let me know, whether it is syntax wise correct or not?

ansible-playbook --extra-vars “artifactory\_folder=gssd-dev-snapshots-local” playbooks/deploy.yml

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [May 5, 2022, 12:02pm UTC](https://forum.ansible.com/t/regarding-get-url-issue-in-ansible/36541/10 "2022-05-05T12:02:57Z")

</div>

That syntax is OK, but your problem isn't about the syntax.  
It's about the content that you post to the API.

I will tell you one more time: your problem is NOT with ansible.  
Ansible is irrelevant in this case.

Your problem is with the data you post to the API.

Find a solution for that, phone up the admins of your API, read the docs, or do something else.

Dick
