Replies: 4 comments 5 replies
-
You are running your task on
You probably need to show more of your code to understand what is going on, but my guess is you are not actually setting the hostname properly. |
Beta Was this translation helpful? Give feedback.
-
Looks a bit like your AWS resolver is failing (possibly).
Have you tried to just hard-code this as a test?
i.e. set this to something like:
In other words, take your |
Beta Was this translation helpful? Give feedback.
-
Thanks Kirk, I suspect that Netmiko has a problem, with IP's, which are updated in the code, because It still does not work, even with manual IP. I have created the simples code, wich you can also test:
Here is the Inventory File, where set manually the public IP on Europe-Cisco-Site1, but on Europe-Cisco-Site2 not:
And this is the output. Here you can see that Europe-Cisco-Site1 will succeed, but Europe-Cisco-Site2 not!
I can clearly see that IP has been set correctly but it is still not used by Netmiko, only if you hardcode it in the host inventory file, as I have did for Europe-Cisco-Site1 |
Beta Was this translation helpful? Give feedback.
-
You are not setting the hostname correctly. You should read the tutorial about the inventory to understand how it works but the tldr is that you have to set the hotname with |
Beta Was this translation helpful? Give feedback.
-
I have a basic question. I use Nornir to trigger Netmiko to configure a Cisco router. It only works, when I hardcode the IP address in the host inventory (hostname).
In my case, I have to get the public IP from AWS and then assign the hostname variable dynamiclly:
This is only a test script to validate, if the public IP is assigned on the hostname:
Question:
Why does Netmiko don't use the hostname, which has been assigned during the play? It always takes the hostname which has not been defined in the host inventory file?
One bad solution would be to update the host inventory file with the public IP but this is really a bad solution and I can’t imagine that this should be done!?
Beta Was this translation helpful? Give feedback.
All reactions