Closed SeglaSamaty closed 3 years ago
device1:
hostname: 192.168.1.1
username: cisco
password: cisco
platform: ios
connection_options:
napalm:
extras:
optional_args:
argument1: value1
Let me know if that was not what you were looking for? But yes, just pass the SSH config file argument in via optional_args using the above structure.
Regards, Kirk
Hi @ktbyers and thx for your reply, I added the connection option to my host file but I'm still failing to connect my router.
%host file
device01: connection_options: napalm: extras: optional_args: ssh_config_file: ~/.ssh/config hostname: 10.10.10.10 password: mypwd platform: ios port: 22 username: username
%my ssh config file (~/.ssh/config)
host jumpserver IdentityFile ~/.ssh/id_rsa IdentitiesOnly yes user username hostname 10.100.100.100
host * !jumpserver ProxyCommand ssh arthur nc %h %p
%nornir.log
2021-04-27 09:03:40,065 - nornir.core - INFO - run() - Running task 'napalm_cli' with args {'commands': ['[tool.poetry]', '# ...', 'packages = [', ' { include = "../conn_cisco" },', ']'], 'optional_args': {'ssh_config_file': '~/.ssh/config'}} on 1 hosts 2021-04-27 09:03:40,066 - nornir.core.task - ERROR - start() - Host 'device01': task 'napalm_cli' failed with traceback: Traceback (most recent call last): File "/home/abcd/.cache/pypoetry/virtualenvs/conn-cisco-oRCRU1FG-py3.8/lib/python3.8/site-packages/nornir/core/task.py", line 99, in start r = self.task(self, **self.params) TypeError: napalm_cli() got an unexpected keyword argument 'optional_args'
Why am I having the optional_args unrecognized in the log?
Best regards.
Hi @ktbyers I managed to make the conf above work. I just reinstalled everything with poetry. But I still don’t know what was the issue.
Best Regards, Segla.
For everyone trying this proxy-ssh over nornir/netmiko/napalm here's what you need to do:
Host * ! jumpserver
ProxyJump jumpserver
User
NOTE: I managed to get this working on linux only, for windows the proxyjump simply does not work.
Hope this helps!
Hi everyone, I'm trying to connect to my ios net devices using Nornir_napalm plugin, Nornir and napalm with linux jump server in the middle. I know that I need the "optional_args" dict to be passed to Napalm so as to set the ssh config for the underlying Netmiko lib.
Since I'm not using Napalm directly, how do I pass the "optional_args" to the Napalm via the plugin nornir_napalm ?