# Cannot reach device using ansible

**URL:** <https://forum.ansible.com/t/cannot-reach-device-using-ansible/45320>\
**Category:** Get Help\
**Tags:** cisco, ansible\
**Created:** [February 11, 2026, 2:30pm UTC](https://forum.ansible.com/t/cannot-reach-device-using-ansible/45320 "2026-02-11T14:30:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guillaume](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@Guillaume](https://forum.ansible.com/u/Guillaume)\
**Post date:** [February 11, 2026, 2:30pm UTC](https://forum.ansible.com/t/cannot-reach-device-using-ansible/45320/1 "2026-02-11T14:30:56Z")

</div>

**Cannot reach device using ansible**

Hello,

I have been trying to use dev environment recently for an internal project unsuccessfully.

Looks like despite my ansible.cfg and inventory file, I’ve still got the same result with the following message :

```auto
[Errno -2] Name or service not known

```

From a specific device, I am using the following command :

```auto
ansible-playbook playbooks/business.yml -i inventories/dev -t telemetry -l switch-mpls-1-tco --check --diff

```

and getting the following output :

```auto
fatal: [switch-mpls-1-tco]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"ansible.legacy.nxos_facts": {"failed": true, "invocation": {"module_args": {"available_network_resources": false, "gather_network_resources": null, "gather_subset": ["min"]}}, "msg": "[Errno -2] Name or service not known"}}, "msg": "The following modules failed to execute: ansible.legacy.nxos_facts\n"}

```

However, from the same device, I succeed to connect to device using ssh

```auto
ssh switch-mpls-preprod-1-tco
switch-mpls-preprod-1-tco#

```

In my inventory file, I have an alias for switch-mpls-1-tco

```auto
[switches]
switch-mpls-1-tco ansible_host=switch-mpls-preprod-1-tco

```

and in my playbook, I activated gather\_facts to check if connection failed before any other thing

```auto
- name: TELEMETRY
  hosts: mpls
  gather_facts: true
  roles:
    - role: telemetry
  tags:
    - telemetry

```

In my environment, I use following version :

- ansible [core 2.18.6]
- python 3.11 (pipenv)

and I have a ssh/config file with User and ProxyJump for my host, works fine for a classic ssh connection.

Any ideas ? How can I troubleshoot this ?  
Thanks in advance,

EDIT :  
After update /etc/resolv.conf, switch-mpls-preprod-1-tco is resolved on the same device I use to deploy configuration via ansible. And output changed, now I’ve got :

```auto
Could not open socket to switch-mpls-preprod-1-tco:830

```

Netconf is already enabled on switch-mpls-preprod-1-tco using command `feature netconf`, so port 830 should be open. SSH access on port 830 works :

```auto
ssh gsicard@switch-mpls-preprod-1-tco -p 830 netconf

```

EDIT 2 :  
Turns out it was a ssh config issue. Using a proxyjump, Cisco NXOS module (netconf here) needs to open a socket on port 830 : this request/command was not forward in the ssh connection via ansible. Below the line I add in my ssh config :

```auto
proxycommand ssh -W %h:%p root@my-jump-server

```

**issue solved**

---

<div class="post-metadata">

**Author:** ![gundalow](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gundalow/32/99_2.png) [@gundalow](https://forum.ansible.com/u/gundalow)\
**Post date:** [February 12, 2026, 10:07pm UTC](https://forum.ansible.com/t/cannot-reach-device-using-ansible/45320/2 "2026-02-12T22:07:00Z")

</div>

@Guillaume Welcome to the Ansible Forum

I’m glad you got it solved. If you have any further issues with Network devices, this guide is good

> **[Network Debug and Troubleshooting Guide — Ansible Community Documentation](https://docs.ansible.com/projects/ansible/latest/network/user_guide/network_debug_troubleshooting.html)**

> [@Guillaume](#):
>
> EDIT 2 :  
> Turns out it was a ssh config issue. Using a proxyjump, Cisco NXOS module (netconf here) needs to open a socket on port 830 : this request/command was not forward in the ssh connection via ansible. Below the line I add in my ssh config :
> 
> ```auto
> proxycommand ssh -W %h:%p root@my-jump-server
> 
> ```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [March 14, 2026, 10:07pm UTC](https://forum.ansible.com/t/cannot-reach-device-using-ansible/45320/3 "2026-03-14T22:07:38Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
