cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1903
Views
5
Helpful
2
Replies

Defining same credentials for al elements in pyATS testbed.yaml file

oslopez
Level 1
Level 1

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.

1 Accepted Solution

Accepted Solutions

oslopez
Level 1
Level 1

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.

View solution in original post

2 Replies 2

oslopez
Level 1
Level 1

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.

sacks
Cisco Employee
Cisco Employee

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.