ultimos cambios

This commit is contained in:
Antonio Torres Míguez
2021-01-11 11:19:10 +01:00
parent a6930a52e0
commit 8456ae9c2a
10577 changed files with 2639327 additions and 0 deletions

0
m02_files/__init__.py Normal file
View File

0
m02_files/csv_example.py Normal file
View File

View File

@ -0,0 +1 @@
[{"name": "devnet-csr-always-on-sandbox", "ssh-info": {"hostname": "ios-xe-mgmt-latest.cisco.com", "port": 8181, "credentials": {"username": "developer", "password": "C1sco12345"}, "device_type": "cisco_ios"}, "netconf-info": {"port": 10000}, "restconf-info": {"port": 9443}}, {"name": "devnet-csr-always-on-sandbox", "ssh-info": {"hostname": "sbx-nxos-mgmt.cisco.com", "port": 8181, "credentials": {"username": "admin", "password": "Admin_1234!"}, "device_type": "cisco_nxos"}}]

View File

@ -0,0 +1,30 @@
inventory = [
{
"name": "devnet-csr-always-on-sandbox",
"ssh-info": {
"hostname": "ios-xe-mgmt-latest.cisco.com",
"port": 8181,
"credentials": {"username": "developer", "password": "C1sco12345"},
"device_type": "cisco_ios",
},
"netconf-info": {
"port": 10000
},
"restconf-info": {
"port": 9443
}
},
{
"name": "devnet-csr-always-on-sandbox",
"ssh-info": {
"hostname": "sbx-nxos-mgmt.cisco.com",
"port": 8181,
"credentials": {"username": "admin", "password": "Admin_1234!"},
"device_type": "cisco_nxos"
}
},
]
def get_inventory():
return inventory

View File

@ -0,0 +1,20 @@
- name: devnet-csr-always-on-sandbox
netconf-info:
port: 10000
restconf-info:
port: 9443
ssh-info:
credentials:
password: C1sco12345
username: developer
device_type: cisco_ios
hostname: ios-xe-mgmt-latest.cisco.com
port: 8181
- name: devnet-csr-always-on-sandbox
ssh-info:
credentials:
password: Admin_1234!
username: admin
device_type: cisco_nxos
hostname: sbx-nxos-mgmt.cisco.com
port: 8181

View File

@ -0,0 +1,13 @@
from l_00_inventory import inventory
import json
with open("l_00_inventory.json", "w") as json_out:
json_out.write(json.dumps(inventory))
with open("l_00_inventory.json", "r") as json_in:
json_inventory = json_in.read()
print("l_00_inventory.json file:", json_inventory)
print("\njson pretty version:")
print(json.dumps(json.loads(json_inventory), indent=4))

View File

@ -0,0 +1,13 @@
from l_00_inventory import inventory
import yaml
with open("l_00_inventory.yaml", "w") as yaml_out:
yaml_out.write(yaml.dump(inventory))
with open("l_00_inventory.yaml", "r") as yaml_in:
yaml_inventory = yaml_in.read()
print("l_00_inventory.yaml file:\n", yaml_inventory)
print("\nyaml pretty version:")
print(yaml.dump(yaml.safe_load(yaml_inventory), indent=4))

0
m02_files/xml_example.py Normal file
View File