annet 0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of annet might be problematic. Click here for more details.

Files changed (113) hide show
  1. annet/__init__.py +61 -0
  2. annet/annet.py +25 -0
  3. annet/annlib/__init__.py +7 -0
  4. annet/annlib/command.py +49 -0
  5. annet/annlib/diff.py +158 -0
  6. annet/annlib/errors.py +8 -0
  7. annet/annlib/filter_acl.py +196 -0
  8. annet/annlib/jsontools.py +89 -0
  9. annet/annlib/lib.py +495 -0
  10. annet/annlib/netdev/__init__.py +0 -0
  11. annet/annlib/netdev/db.py +62 -0
  12. annet/annlib/netdev/devdb/__init__.py +28 -0
  13. annet/annlib/netdev/devdb/data/devdb.json +137 -0
  14. annet/annlib/netdev/views/__init__.py +0 -0
  15. annet/annlib/netdev/views/dump.py +121 -0
  16. annet/annlib/netdev/views/hardware.py +112 -0
  17. annet/annlib/output.py +246 -0
  18. annet/annlib/patching.py +533 -0
  19. annet/annlib/rbparser/__init__.py +0 -0
  20. annet/annlib/rbparser/acl.py +120 -0
  21. annet/annlib/rbparser/deploying.py +55 -0
  22. annet/annlib/rbparser/ordering.py +52 -0
  23. annet/annlib/rbparser/platform.py +51 -0
  24. annet/annlib/rbparser/syntax.py +115 -0
  25. annet/annlib/rulebook/__init__.py +0 -0
  26. annet/annlib/rulebook/common.py +350 -0
  27. annet/annlib/tabparser.py +648 -0
  28. annet/annlib/types.py +35 -0
  29. annet/api/__init__.py +807 -0
  30. annet/argparse.py +415 -0
  31. annet/cli.py +192 -0
  32. annet/cli_args.py +493 -0
  33. annet/configs/context.yml +18 -0
  34. annet/configs/logging.yaml +39 -0
  35. annet/connectors.py +64 -0
  36. annet/deploy.py +441 -0
  37. annet/diff.py +85 -0
  38. annet/executor.py +551 -0
  39. annet/filtering.py +40 -0
  40. annet/gen.py +828 -0
  41. annet/generators/__init__.py +987 -0
  42. annet/generators/common/__init__.py +0 -0
  43. annet/generators/common/initial.py +33 -0
  44. annet/hardware.py +45 -0
  45. annet/implicit.py +139 -0
  46. annet/lib.py +128 -0
  47. annet/output.py +170 -0
  48. annet/parallel.py +448 -0
  49. annet/patching.py +25 -0
  50. annet/reference.py +148 -0
  51. annet/rulebook/__init__.py +114 -0
  52. annet/rulebook/arista/__init__.py +0 -0
  53. annet/rulebook/arista/iface.py +16 -0
  54. annet/rulebook/aruba/__init__.py +16 -0
  55. annet/rulebook/aruba/ap_env.py +146 -0
  56. annet/rulebook/aruba/misc.py +8 -0
  57. annet/rulebook/cisco/__init__.py +0 -0
  58. annet/rulebook/cisco/iface.py +68 -0
  59. annet/rulebook/cisco/misc.py +57 -0
  60. annet/rulebook/cisco/vlandb.py +90 -0
  61. annet/rulebook/common.py +19 -0
  62. annet/rulebook/deploying.py +87 -0
  63. annet/rulebook/huawei/__init__.py +0 -0
  64. annet/rulebook/huawei/aaa.py +75 -0
  65. annet/rulebook/huawei/bgp.py +97 -0
  66. annet/rulebook/huawei/iface.py +33 -0
  67. annet/rulebook/huawei/misc.py +337 -0
  68. annet/rulebook/huawei/vlandb.py +115 -0
  69. annet/rulebook/juniper/__init__.py +107 -0
  70. annet/rulebook/nexus/__init__.py +0 -0
  71. annet/rulebook/nexus/iface.py +92 -0
  72. annet/rulebook/patching.py +143 -0
  73. annet/rulebook/ribbon/__init__.py +12 -0
  74. annet/rulebook/texts/arista.deploy +20 -0
  75. annet/rulebook/texts/arista.order +125 -0
  76. annet/rulebook/texts/arista.rul +59 -0
  77. annet/rulebook/texts/aruba.deploy +20 -0
  78. annet/rulebook/texts/aruba.order +83 -0
  79. annet/rulebook/texts/aruba.rul +87 -0
  80. annet/rulebook/texts/cisco.deploy +27 -0
  81. annet/rulebook/texts/cisco.order +82 -0
  82. annet/rulebook/texts/cisco.rul +105 -0
  83. annet/rulebook/texts/huawei.deploy +188 -0
  84. annet/rulebook/texts/huawei.order +388 -0
  85. annet/rulebook/texts/huawei.rul +471 -0
  86. annet/rulebook/texts/juniper.rul +120 -0
  87. annet/rulebook/texts/nexus.deploy +24 -0
  88. annet/rulebook/texts/nexus.order +85 -0
  89. annet/rulebook/texts/nexus.rul +83 -0
  90. annet/rulebook/texts/nokia.rul +31 -0
  91. annet/rulebook/texts/pc.order +5 -0
  92. annet/rulebook/texts/pc.rul +9 -0
  93. annet/rulebook/texts/ribbon.deploy +22 -0
  94. annet/rulebook/texts/ribbon.rul +77 -0
  95. annet/rulebook/texts/routeros.order +38 -0
  96. annet/rulebook/texts/routeros.rul +45 -0
  97. annet/storage.py +121 -0
  98. annet/tabparser.py +36 -0
  99. annet/text_term_format.py +95 -0
  100. annet/tracing.py +170 -0
  101. annet/types.py +223 -0
  102. annet-0.1.dist-info/AUTHORS +21 -0
  103. annet-0.1.dist-info/LICENSE +21 -0
  104. annet-0.1.dist-info/METADATA +24 -0
  105. annet-0.1.dist-info/RECORD +113 -0
  106. annet-0.1.dist-info/WHEEL +5 -0
  107. annet-0.1.dist-info/entry_points.txt +6 -0
  108. annet-0.1.dist-info/top_level.txt +3 -0
  109. annet_generators/__init__.py +0 -0
  110. annet_generators/example/__init__.py +12 -0
  111. annet_generators/example/lldp.py +52 -0
  112. annet_nbexport/__init__.py +220 -0
  113. annet_nbexport/main.py +46 -0
@@ -0,0 +1,471 @@
1
+ # Операторы:
2
+ # * Один аргумент в undo
3
+ # ~ Несколько аргументов (минимум один) в undo
4
+ #
5
+ # Параметры:
6
+ # %global Команда действует на любом уровне ниже
7
+ # %logic=... Кастомная функция обработки правила
8
+ # %diff_logic=... Кастомная функция построения диффа.
9
+ # данная функция работает для подблоков (в отличие от %logic)
10
+ # %comment=... Добавить коммент после строки который будет видно с опцией patch --add-comments
11
+ # Сделано в основном для того чтобы генерировать специальные команды для наливки
12
+ # -----
13
+
14
+ clock daylight-saving-time
15
+ clock timezone
16
+
17
+ header login
18
+ header shell
19
+ sysname
20
+
21
+ info-center filter-id bymodule-alias * *
22
+ info-center loghost source
23
+ info-center loghost ipv6 * vpn-instance *
24
+ info-center loghost ipv6 *
25
+ info-center loghost * vpn-instance *
26
+ info-center loghost *
27
+ info-center source * channel *
28
+ info-center * channel
29
+ info-center max-logfile-number
30
+ info-center * size
31
+ info-center timestamp log
32
+
33
+ rsa local-key-pair create
34
+
35
+ ecc local-key-pair create
36
+
37
+ port split mode mode3 slot 1
38
+ %if not hw.Huawei.NE:
39
+ port split dimension interface %logic=huawei.misc.port_split
40
+ port split refresh
41
+ %else:
42
+ port split dimension interface
43
+ %endif
44
+
45
+
46
+ assign forward ipv6 longer-mask resource *
47
+
48
+ port mode 200GE interface *
49
+
50
+ undo dhcp enable
51
+
52
+ dhcp enable
53
+ dhcp snooping enable
54
+ dhcp snooping user-bind http
55
+
56
+ ntp server disable
57
+ ntp ipv6 server disable
58
+ ntp ~
59
+ dns snooping ttl delay-time
60
+ dns ~
61
+
62
+ bfd *
63
+ ~
64
+
65
+ bfd
66
+ ~
67
+
68
+ observe-port *
69
+
70
+ qos local-precedence-queue-map *
71
+
72
+ qos group %logic=huawei.misc.undo_children
73
+ ~
74
+
75
+ diffserv domain *
76
+ 8021p-inbound *
77
+ ip-dscp-inbound *
78
+ ip-dscp-outbound * *
79
+ mpls-exp-inbound *
80
+ mpls-exp-outbound *
81
+
82
+ system tcam acl template * all
83
+ system tcam acl template *
84
+ ~ %global
85
+ system tcam acl
86
+
87
+ vlan reserved ~
88
+
89
+ vlan batch %diff_logic=huawei.vlandb.vlan_diff %logic=huawei.vlandb.multi
90
+
91
+ vlan */\d+/ %diff_logic=huawei.vlandb.vlan_diff
92
+ name
93
+
94
+ vlan pool *
95
+ vlan * %logic=huawei.vlandb.multi
96
+
97
+ stp mode
98
+ stp bpdu-protection
99
+ stp enable
100
+ stp region-configuration
101
+ region-name
102
+ instance * %logic=huawei.vlandb.single
103
+
104
+ acl port-pool *
105
+ ~ %global
106
+ acl ip-pool *
107
+ ~ %global
108
+ acl ipv6-pool *
109
+ ~ %global
110
+
111
+ acl name *
112
+ rule * %logic=huawei.misc.undo_redo
113
+ acl number *
114
+ rule * %logic=huawei.misc.undo_redo
115
+ acl ipv6 name *
116
+ rule * %logic=huawei.misc.undo_redo
117
+ acl ipv6 number *
118
+ rule * %logic=huawei.misc.undo_redo
119
+
120
+ */(ftp|FTP|ssh|telnet)/ server acl
121
+ */(ftp|FTP|ssh|telnet)/ ipv6 server acl
122
+ */(ftp|FTP)/ acl
123
+ */(ftp|FTP)/ ipv6 acl
124
+ */(ftp|FTP)/ server enable
125
+ */(ftp|FTP)/ server source all-interface
126
+ */(ftp|FTP)/ server-source
127
+ */(ftp|FTP)/ server
128
+ */(ftp|FTP)/ ipv6 server enable
129
+ */(ftp|FTP)/ ipv6 server source all-interface
130
+ */(ftp|FTP)/ ipv6 server-source
131
+ */(ftp|FTP)/ ipv6 server
132
+ ssh client key-exchange
133
+ ssh client hmac
134
+ ssh client cipher
135
+ ssh server key-exchange
136
+ ssh server dh-exchange
137
+ ssh server cipher
138
+ ssh server hmac
139
+
140
+ ftp client source %logic=huawei.misc.undo_redo
141
+
142
+ ip vpn-instance *
143
+ ipv6-family
144
+ route-distinguisher *
145
+ export route-policy
146
+
147
+ ip */(ip|ipv6)/-prefix * %logic=huawei.misc.prefix_list
148
+ ip as-path-filter * index *
149
+ ip community-filter * * index *
150
+ ip extcommunity-filter * * index *
151
+
152
+ mpls lsr-id
153
+ mpls ldp remote-peer *
154
+
155
+ explicit-path *
156
+ next hop * %ordered
157
+
158
+ traffic classifier * %logic=huawei.misc.classifier
159
+ if-match mpls-exp
160
+ if-match dscp
161
+ if-match ipv6 acl name *
162
+ if-match acl name *
163
+
164
+ traffic behavior *
165
+ remark 8021p
166
+ remark dscp
167
+ car *
168
+
169
+ traffic policy *
170
+
171
+ */[rd]sa/ peer-public-key * %multiline
172
+
173
+ aaa
174
+ undo local-user policy security-enhance
175
+ undo user-password complexity-check
176
+ task-group *
177
+ task *
178
+ local-user * privilege level %diff_logic=huawei.aaa.local_user_diff
179
+ local-user * level %diff_logic=huawei.aaa.local_user_diff
180
+ local-user * %diff_logic=huawei.aaa.local_user_diff %logic=huawei.aaa.user
181
+ */(accounting|authentication|authorization)/-scheme *
182
+ */(accounting|authentication|authorization)/-mode
183
+ domain *
184
+ */(accounting|authentication|authorization)/-scheme * %logic=huawei.aaa.domain
185
+ ~ %global
186
+
187
+ hwtacacs-server template *
188
+ hwtacacs-server shared-key
189
+
190
+ hwtacacs server template *
191
+ hwtacacs server shared-key
192
+
193
+ radius-server template *
194
+ radius-server accounting * *
195
+ radius-server authentication * *
196
+
197
+ ssh authentication-type default password
198
+
199
+ ssh server rsa-key min-length
200
+ undo ssh server rsa-key min-length
201
+ ssh user * authentication-type
202
+ ssh user * service-type
203
+ ssh user * assign *
204
+ ssh user *
205
+
206
+ %if hw.Huawei.Quidway:
207
+ */(ssh|telnet)/ server-source
208
+ */(ssh|telnet)/ ipv6 server-source
209
+ %else:
210
+ */(ssh|telnet)/ server-source ~
211
+ */(ssh|telnet)/ ipv6 server-source ~
212
+ %endif
213
+ snmp-agent protocol source-status all-interface
214
+ snmp-agent protocol ipv6 *
215
+
216
+ ipv6 icmp * send disable %logic=huawei.misc.clear_instead_undo
217
+
218
+ stelnet ~ %logic=huawei.misc.stelnet
219
+
220
+ # this is not a block
221
+ user-interface maximum-vty
222
+
223
+ user-interface ~
224
+ protocol inbound
225
+ idle-timeout
226
+ acl ~ %logic=huawei.misc.vty_acl_undo
227
+ screen-length
228
+ user privilege level
229
+ authentication-mode
230
+
231
+ tunnel-policy *
232
+ tunnel select-seq
233
+
234
+ sflow collector *
235
+
236
+ */(ip|ipv6)/ netstream timeout active
237
+ */(ip|ipv6)/ netstream timeout inactive
238
+ */(ip|ipv6)/ netstream export index-switch
239
+ */(ip|ipv6)/ netstream mpls-aware
240
+ */(ip|ipv6)/ netstream sampler ~ %logic=huawei.misc.netstream_undo
241
+ */(ip|ipv6)/ netstream export source ipv6
242
+ */(ip|ipv6)/ netstream export source
243
+ */(ip|ipv6)/ netstream export version
244
+ */(ip|ipv6)/ netstream export template timeout-rate
245
+ */(ip|ipv6)/ netstream export template option timeout-rate
246
+
247
+
248
+ !interface */(Vlanif1$|NULL)/
249
+ interface */Tunnel.+/
250
+ mpls te igp metric
251
+ ip address unnumbered
252
+ tunnel-protocol
253
+ destination
254
+ mpls te signalled tunnel-name
255
+ mpls te reserved-for-binding
256
+ mpls te path metric-type
257
+ mpls te path
258
+ mpls te tunnel-id
259
+
260
+ interface * %logic=huawei.iface.permanent
261
+ %if hw.Quidway:
262
+ mac-address trap notification
263
+ %else:
264
+ mac-address trap notification *
265
+ %endif
266
+ mtu %logic=huawei.misc.undo_redo
267
+ undo portswitch
268
+ ip binding ~ %diff_logic=huawei.iface.binding_change
269
+ ip ~ %diff_logic=huawei.iface.binding_change
270
+ jumboframe enable
271
+ stp bpdu-filter
272
+ %if hw.Huawei.CE or hw.Huawei.Quidway:
273
+ stp edged-port
274
+ %else: # На не CE-девайсах бывает аргумент default
275
+ stp edged-port *
276
+ %endif
277
+ port-isolate enable ~
278
+ port default vlan
279
+ ipv6 enable %diff_logic=huawei.iface.binding_change
280
+ ipv6 mtu %logic=huawei.misc.undo_redo %diff_logic=huawei.iface.binding_change
281
+ ipv6 nd ra prefix * %diff_logic=huawei.iface.binding_change
282
+ ipv6 nd ra min-interval %ignore_case %diff_logic=huawei.iface.binding_change
283
+ ipv6 nd ra max-interval %ignore_case %diff_logic=huawei.iface.binding_change
284
+ ipv6 nd ra router-lifetime %ignore_case %diff_logic=huawei.iface.binding_change
285
+ ipv6 neighbor * %diff_logic=huawei.iface.binding_change
286
+ ipv6 ~ %diff_logic=huawei.iface.binding_change
287
+ dhcpv6 ~
288
+ port link-type
289
+ port trunk pvid vlan
290
+ port trunk allow-pass vlan %logic=huawei.vlandb.multi_all
291
+ undo port trunk allow-pass ~
292
+ port hybrid pvid vlan
293
+ port hybrid tagged vlan %logic=huawei.vlandb.multi_all
294
+ port hybrid untagged vlan %logic=huawei.vlandb.multi_all
295
+ undo port hybrid vlan ~
296
+ port mode *
297
+ eth-trunk %logic=huawei.misc.undo_redo
298
+ mode
299
+ lldp admin-status
300
+ qos queue * drr weight
301
+ qos queue * drr wred
302
+ qos queue * wfq weight
303
+ qos queue * wred
304
+ qos queue * shaping
305
+ qos schedule-profile
306
+ port-queue ~ %logic=huawei.misc.port_queue
307
+ sflow sampling ~
308
+ damping time
309
+ isis enable
310
+ isis circuit-level
311
+ isis circuit-type
312
+ isis timer lsp-throttle
313
+ isis cost
314
+ ospf cost
315
+ ospf network-type
316
+ authentication-profile
317
+ set flow-stat interval
318
+ least active-linknumber
319
+ lacp timeout
320
+ storm-control enable ~
321
+ storm control enable ~
322
+ storm-control *
323
+ storm control *
324
+ mpls ldp transport-address
325
+ trust upstream
326
+ %if hw.Huawei.CE:
327
+ trust *
328
+ %else
329
+ trust
330
+ %endif
331
+ dhcp snooping check dhcp-rate enable
332
+ dhcp snooping check dhcp-rate
333
+ poe legacy enable
334
+ mac-address notification learning
335
+ mac-address
336
+
337
+
338
+ bridge-domain *
339
+ vxlan vni *
340
+
341
+ route-policy * (?:permit|deny) node * %logic=huawei.misc.rp_node
342
+ if-match cost
343
+ if-match protocol
344
+ apply community
345
+ apply as-path
346
+ apply as-path
347
+ apply cost
348
+ apply cost-type
349
+ apply local-preference
350
+ goto next-node
351
+
352
+ # xpl объекты можно только перезаписать полностью
353
+ xpl ~
354
+ ~ %rewrite %global
355
+
356
+ bgp path-attribute attr-set *
357
+ bgp path-attribute *
358
+
359
+ bgp %logic=huawei.bgp.undo_commit
360
+ private-4-byte-as
361
+ router-id
362
+
363
+ # эти команды могут быть как в top-level, так и внутри family
364
+ # здесь нужен copy-paste, т.к. %global почему-то не работает
365
+ group *
366
+
367
+ # Опции для пиров
368
+ peer * description
369
+ peer * tcp-mss
370
+ peer * bfd enable
371
+ peer * bfd %logic=huawei.bgp.bfd
372
+ # Правило 'peer *' должно быть в самом низу
373
+ # Чтобы не матчится на опции пира
374
+ # На порядок команд в патче это не влияет
375
+ # Только на логику. Порядок задается в huawei.order
376
+ peer * %logic=huawei.bgp.peer
377
+
378
+ maximum load-balancing */eibgp|ebgp|ibgp|ingress-lsp/
379
+ maximum load-balancing
380
+
381
+ */ipv[46]-family/ ~
382
+ router-id
383
+ group *
384
+ bestroute add-path
385
+ # Опции для пиров
386
+ peer * description
387
+ peer * tcp-mss
388
+ peer * bfd enable
389
+ peer * route-limit
390
+ peer * advertise add-path
391
+ peer * bfd %logic=huawei.bgp.bfd
392
+ # Правило 'peer *' должно быть в самом низу
393
+ # Чтобы не матчится на опции пира
394
+ # На порядок команд в патче это не влияет
395
+ # Только на логику. Порядок задается в huawei.order
396
+ peer * %logic=huawei.bgp.peer
397
+
398
+ maximum load-balancing */eibgp|ebgp|ibgp|ingress-lsp|transit-lsp/
399
+ maximum load-balancing
400
+ import-route direct
401
+ import-route static
402
+
403
+
404
+ ip community-filter ~
405
+ ospf *
406
+ stub-router %logic=huawei.misc.undo_redo
407
+ area *
408
+ mpls-te
409
+
410
+ isis *
411
+ set-overload *
412
+
413
+ error-down auto-recovery cause link-flap
414
+
415
+
416
+ ip route-static default-bfd
417
+ ipv6 route-static default-bfd
418
+
419
+ ip route-static ~ %logic=huawei.misc.static
420
+ ipv6 route-static ~ %logic=huawei.misc.static
421
+
422
+ # Should be after acl definition
423
+ !snmp-agent local-engineid *
424
+ snmp-agent protocol vpn-instance
425
+ snmp-agent protocol get-bulk timeout
426
+ snmp-agent sys-info version %logic=huawei.misc.snmpagent_sysinfo_version
427
+ snmp-agent sys-info *
428
+ snmp-agent mib-view ~
429
+ snmp-agent community complexity-check ~
430
+ snmp-agent community * cipher *
431
+ snmp-agent community read ~
432
+
433
+ snmp-agent target-host host-name *
434
+ snmp-agent target-host trap address udp-domain * params securityname cipher *
435
+ snmp-agent target-host trap address udp-domain * vpn-instance (?:.+) params securityname cipher *
436
+ snmp-agent target-host trap ipv6 address udp-domain * params securityname cipher *
437
+ snmp-agent target-host trap ipv6 address udp-domain * vpn-instance * params securityname cipher *
438
+
439
+ # на старых хуавеях community не зашифрован и команда по другому отменяется
440
+ snmp-agent target-host trap address udp-domain * params securityname *
441
+ snmp-agent trap source
442
+ snmp-agent packet max-size
443
+ %if hw.Huawei.Quidway:
444
+ snmp-agent protocol source-interface %logic=huawei.misc.undo_redo
445
+ %else
446
+ snmp-agent protocol source-interface *
447
+ %endif
448
+ snmp-agent ~
449
+ ifindex constant
450
+
451
+ grpc
452
+ grpc server %logic=huawei.misc.undo_children
453
+ grpc server ipv6 %logic=huawei.misc.undo_children
454
+
455
+ pce-client
456
+ connect-server *
457
+ preference
458
+ timer state-timeout *
459
+
460
+ cpu-defend policy *
461
+ cpu-defend-policy * global
462
+ cpu-defend-policy
463
+ slot *
464
+ cpu-defend-policy
465
+
466
+ description %global
467
+
468
+ undo ~ %global
469
+ ~ %global
470
+
471
+ # vim: set syntax=annrulebook:
@@ -0,0 +1,120 @@
1
+ # Операторы:
2
+ # * Один аргумент в undo
3
+ # ~ Несколько аргументов (минимум один) в undo
4
+ #
5
+ # Параметры:
6
+ # %global Команда действует на любом уровне ниже
7
+ # %logic=... Кастомная функция обработки правила
8
+ # %diff_logic=... Кастомная функция построения диффа.
9
+ # данная функция работает для подблоков (в отличие от %logic)
10
+ # %comment=... Добавить коммент после строки который будет видно с опцией patch --add-comments
11
+ # Сделано в основном для того чтобы генерировать специальные команды для наливки
12
+ # -----
13
+
14
+ system
15
+ host-name *
16
+ name-server
17
+ ~
18
+ ntp
19
+ server *
20
+ source-address *
21
+
22
+ routing-options
23
+ autonomous-system *
24
+ ~
25
+
26
+ services
27
+ ~
28
+
29
+ chassis
30
+ tfeb
31
+ slot *
32
+ inline-services
33
+ flow-table-size
34
+ ipv4-flow-table-size
35
+ ipv6-flow-table-size
36
+ fpc *
37
+ inline-services
38
+ flow-table-size
39
+ ipv4-flow-table-size
40
+ ipv6-flow-table-size
41
+ pic *
42
+ ~
43
+
44
+ protocols
45
+ isis
46
+ overload
47
+ mpls
48
+ path *
49
+ * %ordered
50
+ source-packet-routing
51
+ segment-list *
52
+ * %ordered
53
+ ~
54
+
55
+ routing-instances
56
+ ~
57
+ routing-options
58
+ autonomous-system *
59
+ protocols
60
+ bgp
61
+ group *
62
+ local-as
63
+
64
+ interfaces
65
+ *
66
+ unit *
67
+ description ~
68
+ mtu *
69
+ vlan-tags
70
+ description ~
71
+ mtu *
72
+ hold-time
73
+
74
+ snmp
75
+ community *
76
+ ~
77
+
78
+ ntp
79
+ ~
80
+
81
+ class-of-service
82
+ classifiers
83
+ dscp *
84
+ ~
85
+ forwarding-class *
86
+ ~
87
+ forwarding-classes
88
+ class *
89
+ ~
90
+
91
+ interfaces
92
+ *
93
+ unit *
94
+ rewrite-rules
95
+ dscp *
96
+ dscp-ipv6 *
97
+ exp *
98
+ ieee-802.1 *
99
+ ~
100
+
101
+ policy-options
102
+ community ~
103
+ prefix-list ~
104
+ policy-statement *
105
+ ~ %ordered
106
+ ~ %global
107
+
108
+
109
+ firewall
110
+ family *
111
+ filter *
112
+ ~ %ordered
113
+ ~ %global
114
+
115
+
116
+ forwarding-options
117
+ ~
118
+
119
+
120
+ ~ %global
@@ -0,0 +1,24 @@
1
+ # Рулбук деплоя на устройства
2
+ #
3
+ # Операторы:
4
+ # * Один аргумент
5
+ # ~ Несколько аргументов (минимум один)
6
+ #
7
+ # Параметры:
8
+ # %timeout=... Таймаут выполнения команды (в секундах, по умолчанию 30)
9
+ #
10
+ # Ответы на вопросы
11
+ #
12
+ # <команда>
13
+ # dialog: <вопрос> ::: <ответ> <параметры>
14
+ #
15
+ # Если <вопрос> заключён в слеши (//), то воспринимается как регулярка, иначе - точное совпадение.
16
+ # Параметы:
17
+ # %send_nl=... Посылать ли перевод строки после ответа (bool, по умолчанию true)
18
+ # -----
19
+
20
+ crypto key generate rsa %timeout=60
21
+ dialog: Do you really want to replace them? [yes/no]: ::: no
22
+ dialog: How many bits in the modulus [512]: ::: 2048
23
+ no username * privilege * secret 5 *
24
+ dialog: This operation will remove all username related configurations with same name.Do you want to continue? [confirm] ::: Y %send_nl=0
@@ -0,0 +1,85 @@
1
+ # В этом файле определяется порядок команд, в котором их следует подавать на устройство.
2
+ # - Если порядок команды не важен - ее можно не писать сюда совсем.
3
+ # - Если команда начинается с undo и прописан параметр %order_reverse - команда считается
4
+ # обратной, но занимает место между прямыми там, где указано.
5
+
6
+ # Фичи должны быть включены прежде всего
7
+ feature
8
+ # За ним сервисы
9
+ service
10
+
11
+ interface breakout
12
+
13
+ no password strength-check
14
+ username
15
+ tacacs-server
16
+ aaa
17
+
18
+ ip access-list
19
+ ipv6 access-list
20
+
21
+ class-map
22
+ policy-map
23
+ system qos
24
+ control-plane
25
+
26
+ no policy-map %order_reverse
27
+ no class-map %order_reverse
28
+
29
+ snmp-server source-interface
30
+ snmp-server user
31
+ snmp-server host
32
+ snmp-server enable
33
+ snmp-server context
34
+ snmp-server community
35
+ snmp-server mib
36
+
37
+ no ntp server
38
+ no ntp distribute
39
+ clear ntp session
40
+
41
+ ntp distribute
42
+ ntp server
43
+ ntp commit
44
+
45
+
46
+ vlan
47
+ vlan group
48
+
49
+ spanning-tree
50
+
51
+ # перед тем, как менять mtu на интерфейсах, надо выставить максимальный
52
+ no system jumbomtu %order_reverse
53
+ system jumbomtu
54
+
55
+ route-map
56
+
57
+ service dhcp
58
+ ip dhcp relay
59
+ ipv6 dhcp relay
60
+
61
+ vrf context
62
+
63
+ interface */Vlan\d+/
64
+ interface *
65
+ no switchport
66
+ switchport
67
+ switchport access vlan *
68
+ encapsulation
69
+ vrf member
70
+ ip
71
+ ipv6
72
+ no ipv6 nd %order_reverse
73
+ ipv6 nd
74
+ ~
75
+ channel-group
76
+
77
+ interface */\S+\.\d+/
78
+
79
+ # удалять eth-trunk можно только после того, как вычистим member interfaces
80
+ undo interface */port-channel\d+/ %order_reverse
81
+
82
+ router bgp
83
+ address-family
84
+ template
85
+ neighbor