08-09-2021 10:13 AM
Hi,
I have a network where all the network elements have the same login credentials, therefore my testbed.yaml file looks like this (excerpt):
---
testbed:
name: Lab_Devices
devices:
NX7k_01:
connections:
cli:
ip: 10.1.8.40
protocol: ssh
port: 22
credentials:
default:
username: cisco
password: "%ENC{w5jDrsOGw6HDlMOCwpzCmw==}"
type: Nexus9000v
os: nxos
ASR_1001_01:
connections:
cli:
ip: 10.1.8.10
protocol: telnet
port: 23
credentials:
default:
username: cisco
password: "%ENC{w5jDrsOGw6HDlMOCwpzCmw==}"
type: ASR1001-X I would like to know if there is a way to define the credentials section only once for all the elements so that I don't have to define them over and over again. What would be the syntax for that?
Thanks.
Solved! Go to Solution.
08-10-2021 01:33 PM
Ok just had a look at pyATS documentation and it was just a matter of moving the credentials section above devices section so that the credentials apply to all devices. That solved the problem.
08-10-2021 01:33 PM
Ok just had a look at pyATS documentation and it was just a matter of moving the credentials section above devices section so that the credentials apply to all devices. That solved the problem.
04-17-2022 08:56 PM
Just curios, is it possible to pass multiple strings to password field ? Incase login with one password fails, we can try with next set of passwords. Need this logic for a specific usecase.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide