# Download artifacts from artifactory into server location

**URL:** <https://forum.ansible.com/t/download-artifacts-from-artifactory-into-server-location/37304>\
**Category:** Ansible Project\
**Created:** [November 4, 2022, 7:33am UTC](https://forum.ansible.com/t/download-artifacts-from-artifactory-into-server-location/37304 "2022-11-04T07:33:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![neha0021997](https://avatars.discourse-cdn.com/v4/letter/n/34f0e0/32.png) [@neha0021997](https://forum.ansible.com/u/neha0021997)\
**Post date:** [November 4, 2022, 7:33am UTC](https://forum.ansible.com/t/download-artifacts-from-artifactory-into-server-location/37304/1 "2022-11-04T07:33:20Z")

</div>

Hi Team,

I was trying to download the maven artifact from required location (in artifactory) to server. But I a, getting some error for the same. Firstfall, please find my code below:

**- hosts: 10.115.109.195**  
**gather\_facts: yes**

**tasks:**  
**- maven\_artifact:**  
**group\_id: commons-lang**  
**artifact\_id: commons-lang**  
**version: 2.4**  
**repository\_url: ‘[https://q1artifactory-dev.secintel.intranet.ibm.com/ext-release-local-zeus-gradle](https://q1artifactory-dev.secintel.intranet.ibm.com/ext-release-local-zeus-gradle)’**  
**username: XXXX**  
**password: XXXXX**  
**dest: /home**

Below is the error I am getting while running the code:

**fatal: [10.115.109.195]: FAILED! =\> {“changed”: false, “msg”: “Failed to download artifact commons-lang:commons-lang:2.4 because of Request failed: \<urlopen error [Errno -5] No address associated with hostname\>for URL [https://q1artifactory-dev.secintel.intranet.ibm.com/ext-release-local-zeus-gradle/commons-lang/commons-lang/2.4/commons-lang-2.4.jar](https://q1artifactory-dev.secintel.intranet.ibm.com/ext-release-local-zeus-gradle/commons-lang/commons-lang/2.4/commons-lang-2.4.jar)”}**

Meanwhile, I have also performed ssh to required host (10.115.109.195) and tried to ping the artifactory URL from there. I got the below response, maybe this URL is not able to resolved into that host.  
**[root@10.115.109.195 ~]# ping [https://q1artifactory-dev.secintel.intranet.ibm.com/](https://q1artifactory-dev.secintel.intranet.ibm.com/)**  
**ping: [https://q1artifactory-dev.secintel.intranet.ibm.com/:](https://q1artifactory-dev.secintel.intranet.ibm.com/:) Name or service not known**

Do let me know what I can do to resolve this issue and download the artifact into a specified location in host.

Thanks & Regards  
Neha Singh

---

<div class="post-metadata">

**Author:** ![Snehal\_Patel](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@Snehal\_Patel](https://forum.ansible.com/u/Snehal_Patel)\
**Post date:** [November 4, 2022, 8:06am UTC](https://forum.ansible.com/t/download-artifacts-from-artifactory-into-server-location/37304/2 "2022-11-04T08:06:45Z")

</div>

Have you checked if the URL is working or not? It seems that the server or URL is not working.

---

<div class="post-metadata">

**Author:** ![neha0021997](https://avatars.discourse-cdn.com/v4/letter/n/34f0e0/32.png) [@neha0021997](https://forum.ansible.com/u/neha0021997)\
**Post date:** [November 4, 2022, 9:18am UTC](https://forum.ansible.com/t/download-artifacts-from-artifactory-into-server-location/37304/3 "2022-11-04T09:18:29Z")

</div>

Yes, the URL is working.

The URL which is mentioned in the error (**[https://q1artifactory-dev.secintel.intranet.ibm.com/ext-release-local-zeus-gradle/commons-lang/commons-lang/2.4/commons-lang-2.4.jar](https://q1artifactory-dev.secintel.intranet.ibm.com/ext-release-local-zeus-gradle/commons-lang/commons-lang/2.4/commons-lang-2.4.jar)),** when I tried to access the same, it tries to download the jar file.  
One more thing, this URL is specific to domain…I mean it cannot be accessed globally.

Please guide with the resolution here.

Thanks  
Neha

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [November 4, 2022, 9:47am UTC](https://forum.ansible.com/t/download-artifacts-from-artifactory-into-server-location/37304/4 "2022-11-04T09:47:26Z")

</div>

The URL needs to be reachable from the host that you are deploying to.  
Sounds like that host cannot resolve the domain name, so that task fails.  
Either fix the DNS resolution on that host (recommended).  
Or work around that by fetching the file first to the controller, and  
then copying it to the node (not recommended).  
What to choose depends on your situation.

---

<div class="post-metadata">

**Author:** ![Snehal\_Patel](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@Snehal\_Patel](https://forum.ansible.com/u/Snehal_Patel)\
**Post date:** [November 4, 2022, 10:36am UTC](https://forum.ansible.com/t/download-artifacts-from-artifactory-into-server-location/37304/5 "2022-11-04T10:36:36Z")

</div>

I think you need to look into permissions or trusted domain name servers or the host.

DNS.conf or Try without http or https Or (resolv.cfg remove. Before removing, copy it somewhere and create new dns.conf.) Or NetworkManager restart
