-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpypuller.yaml
More file actions
executable file
·122 lines (115 loc) · 4.22 KB
/
pypuller.yaml
File metadata and controls
executable file
·122 lines (115 loc) · 4.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
--- # script parameters {{{1}}}
user : 'labroot' # -u
password : 'lab123' # -p
router_file : './router-lists.txt' # -R
cli_file : './cli-lists.txt' # -C
log_dir : '~/pypuller_logs' # -l
commit : False # -g
protocol : netconf # -P
normalize : True
package : '/var/tmp/junos-install-mx-x86-64-15.1F2-S13.tgz'
iteration_max : 2
attempt_max : 2
--- # individual host {{{1}}}
hosts : ['172.19.161.123', '172.19.164.5', 'matrix-re0.ultralab.juniper.net']
clies : &clies
['show chassis hardware', 'show system core', 'show system uptime']
Router1:
- hostname : 172.19.161.123
re0 : 172.19.161.124
re1 : 172.19.161.125
access :
user : labroot
passwd : lab123
su : Juniper1
protocol: netconf
port: 830
- clies:
- "show version"
- "show interface terse lo0"
Router2:
- hostname : 172.19.164.5
re0 : 172.19.164.6
re1 : 172.19.164.7
access : {user: 923768, passwd: 356669, su: Juniper1}
- clies : *clies
server1:
- hostname : 10.85.4.54
access : {user: ping, passwd: ping1234}
- clies :
- "ifconfig"
- "uptime"
# this does not work
# <<: *clies
#
# ipdb> pp(options) # {{{1}}}
# {
# 'user': 'labroot',
# 'password': 'lab123',
# 'log_dir': '/home/pings/pypuller_logs',
# 'debug': True,
# 'router_file': './router-lists.txt',
# 'cli_file': './cli-lists.txt',
# 'commit': False,
# 'attempt': 0,
# 'attempt_max': 2,
# 'iteration': 0,
# 'iteration_max': 2,
# 'normalize': True,
# 'package': '/var/tmp/junos-install-mx-x86-64-15.1F2-S13.tgz',
# 'yaml_file': './pypuller.yaml'
# 'cli_list': ['show version',
# 'show interface lo0 terse',
# 'show system uptime'],
# 'host_list': ['172.19.161.123',
# '172.19.164.5',
# 'matrix-re0.ultralab.juniper.net'],
# }
# 'host': {'Router1': [{'access': {'login': 'labroot',
# 'passwd': 'lab123',
# 'su': 'Juniper1'},
# 'hostname': '172.19.161.123',
# 're0': '172.19.161.124',
# 're1': '172.19.161.125'},
# {'clies': ['show version',
# 'show interface terse lo0']}],
# 'Router2': [{'access': {'login': 923768,
# 'passwd': 356669,
# 'su': 'Juniper1'},
# 'hostname': '172.19.164.5',
# 're0': '172.19.164.6',
# 're1': '172.19.164.7'},
# {'clies': ['show version',
# 'show interface lo0 terse',
# 'show system uptime']}]},
#
# ipdb> pp(pyaml_list) # {{{1}}}
# [
# {'clies': ['show version', 'show interface lo0 terse', 'show system uptime'],
# 'hosts': ['172.19.161.123 172.19.164.5 matrix-re0.ultralab.juniper.net']},
#
#
# {'Router1':
# [
# {'access':
# {'login': 'labroot', 'passwd': 'lab123'},
# 'hostname': '172.19.161.123',
# 're0': '172.19.161.124',
# 're1': '172.19.161.125'
# },
# {'clies': ['show version', 'show interface terse lo0'],
# 'type': 'mx960'}
# ],
# 'Router2':
# [
# {'access':
# {'login': 923768, 'passwd': 356669},
# 'hostname': '172.19.164.5',
# 're0': '172.19.164.6',
# 're1': '172.19.164.7'
# },
# {'clies': ['show version', 'show system uptime'],
# 'type': 'mx480'}
# ]
# }
# ]