Host Unreachable.

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

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
         Racke

Thanks! for reply.

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–

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

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