Download artifacts from artifactory into server location

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
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”}

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/
ping: 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

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

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), 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

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.

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