# Host Unreachable.

**URL:** <https://forum.ansible.com/t/host-unreachable/31236>\
**Category:** Ansible Project\
**Created:** [September 9, 2019, 1:32pm UTC](https://forum.ansible.com/t/host-unreachable/31236 "2019-09-09T13:32:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Naeem\_Khan](https://avatars.discourse-cdn.com/v4/letter/n/3da27b/32.png) [@Naeem\_Khan](https://forum.ansible.com/u/Naeem_Khan)\
**Post date:** [September 9, 2019, 1:32pm UTC](https://forum.ansible.com/t/host-unreachable/31236/1 "2019-09-09T13:32:31Z")

</div>

Hi Everyone,  
I am getting the Connection issue with the given host using ansible, but direct ssh is working fine with the host 172.19.54.163.  
can some one guide me where do i have to look the issue.

on running the command **ansible all -m ping** the result is below.

ansible\_host=172.19.54.163 | UNREACHABLE! =\> {  
“changed”: false,  
“msg”: “Failed to connect to the host via ssh: ssh: Could not resolve hostname ansible\_host=172.19.54.163: Name or service not known”,  
“unreachable”: true  
}

**Ansible.cfg**

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [September 9, 2019, 1:39pm UTC](https://forum.ansible.com/t/host-unreachable/31236/2 "2019-09-09T13:39:30Z")

</div>

> Hi Everyone,  
> I am getting the Connection issue with the given host using ansible, but direct ssh is working fine with the host  
> 172.19.54.163.  
> can some one guide me where do i have to look the issue.
> 
> on running the command \*ansible all -m ping \* the result is below.
> 
> ansible\_host=172.19.54.163 | UNREACHABLE! =\> {  
> "changed": false,  
> "msg": "Failed to connect to the host via ssh: ssh: Could not resolve hostname ansible\_host=172.19.54.163: Name or  
> service not known",  
> "unreachable": true  
> }

Hello Naheem,

your entry in hosts is wrong:

ansible\_host=172.19.54.163 ansible\_port=22 ansible\_connection=ssh ansible\_user=root ansible\_pass=abc123

This line needs to start with the hostname (or IP).

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![Naeem\_Khan](https://avatars.discourse-cdn.com/v4/letter/n/3da27b/32.png) [@Naeem\_Khan](https://forum.ansible.com/u/Naeem_Khan)\
**Post date:** [September 11, 2019, 9:03am UTC](https://forum.ansible.com/t/host-unreachable/31236/3 "2019-09-11T09:03:54Z")

</div>

Thanks! for reply.

---

<div class="post-metadata">

**Author:** ![Naeem\_Khan](https://avatars.discourse-cdn.com/v4/letter/n/3da27b/32.png) [@Naeem\_Khan](https://forum.ansible.com/u/Naeem_Khan)\
**Post date:** [September 11, 2019, 9:17am UTC](https://forum.ansible.com/t/host-unreachable/31236/4 "2019-09-11T09:17:22Z")

</div>

Hi Everyone,  
I am facing issue in executing roles using some shell script.  
the task is

1. create one directory on remote host /installer/NAM
2. copy the installable from ftp (ip:172.19.54.10 username:-admin password abc123 ).
3. copy the installable at /installer/NAM
4. untar the installable
5. remove the installable file  
6.execute the install.sh  
below is the YAML please let me what is wrong in it i am unable to download file and subsequent steps.  
Kindly reply ASAP or if some one have any sample YAML to download from FTP please share with me.

–YAML Begin–

---

<div class="post-metadata">

**Author:** ![Naeem\_Khan](https://avatars.discourse-cdn.com/v4/letter/n/3da27b/32.png) [@Naeem\_Khan](https://forum.ansible.com/u/Naeem_Khan)\
**Post date:** [September 11, 2019, 9:21am UTC](https://forum.ansible.com/t/host-unreachable/31236/5 "2019-09-11T09:21:00Z")

</div>

Error Test is as Follows:-

ansible-playbook 2.8.4  
config file = /etc/ansible/ansible.cfg  
configured module search path = [u’/root/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python2.7/site-packages/ansible  
executable location = /usr/bin/ansible-playbook  
python version = 2.7.5 (default, Aug 2 2016, 04:20:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]  
Using /etc/ansible/ansible.cfg as config file  
setting up inventory plugins  
host\_list declined parsing /etc/ansible/hosts as it did not pass it’s verify\_file() method  
script declined parsing /etc/ansible/hosts as it did not pass it’s verify\_file() method  
auto declined parsing /etc/ansible/hosts as it did not pass it’s verify\_file() method  
Parsed /etc/ansible/hosts inventory source with ini plugin  
ERROR! Syntax Error while loading YAML.  
mapping values are not allowed in this context

The error appears to be in ‘/tmp/auto\_install/ansible\_install\_script/roles/ac.install/tasks/main.yml’: line 8, column 12, but may  
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: Download File From FTP  
get\_url:  
^ here

---

<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:** [September 11, 2019, 9:33am UTC](https://forum.ansible.com/t/host-unreachable/31236/6 "2019-09-11T09:33:38Z")

</div>

Please start a new thread if you have a new question. This  
pollutes/confuses things.
