I am unable to push playbook tasks to our Juniper switch. If I just create a simple playbook for gathering the facts, I am getting below error “[Errno -2] Name or service not known”. and this error is same for every module.
Connectivity is fine as I am able to ssh the Juniper switch from the Ansible server.
I am pasting the playbook below as well as the error with -vvvv.
Please find my Playbook.
Playbook:
- hosts: juniperswitch
gather_facts: no
vars:
ansible_command_timeout: 1800
tasks:
- name: get the facts
junipernetworks.junos.junos_facts:
register: value1
- name: Print in screen
debug:
var: value1
error after adding -vvvv.
The full traceback is:
File "/root/.ansible/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/network.py", line 215, in get_capabilities
capabilities = Connection(module._socket_path).get_capabilities()
File "/usr/local/lib/python3.8/site-packages/ansible/module_utils/connection.py", line 200, in __rpc__
raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code)
fatal: [57.4.62.33]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"available_network_resources": false,
"config_format": "text",
"gather_network_resources": null,
"gather_subset": [
"min"
]
}
},
"msg": "[Errno -2] Name or service not known"
}
PLAY RECAP **************************************************************************************************************************************************
57.4.62.33 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0