Skip to content

Commit 2120d7a

Browse files
laxmikantchintakindipre-commit-ci[bot]Vibhu-gslabShivani-gslabcarl-baillargeon
authored
Refactor(eos_cli_config_gen): Replace sequence_numbers with new entries key in standard_access_lists (#6606)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Vibhu-gslab <[email protected]> Co-authored-by: Shivani-gslab <[email protected]> Co-authored-by: Carl Baillargeon <[email protected]>
1 parent de87c34 commit 2120d7a

12 files changed

Lines changed: 546 additions & 86 deletions

File tree

ansible_collections/arista/avd/extensions/molecule/eos_cli_config_gen/documentation/devices/host1.md

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11996,70 +11996,75 @@ poe
1199611996

1199711997
##### 99
1199811998

11999-
| Sequence | Action |
12000-
| -------- | ------ |
12001-
| 10 | remark ACL to restrict access RFC1918 addresses |
12002-
| 20 | permit 10.0.0.0/8 |
12003-
| 30 | permit 172.16.0.0/12 |
12004-
| 40 | permit 192.168.0.0/16 |
11999+
| Sequence | Action | Source | Remark | VLAN/Mask | Inner VLAN/Mask | Log | Mirror Session |
12000+
| -------- | ------ | ------ | ------ | ---- | ---------- | --- | -------------- |
12001+
| - | - | - | ACL to restrict access RFC1918 addresses | - | - | - | - |
12002+
| - | permit | 10.0.0.0/8 | - | 20 | 10 | - | mirror1 |
12003+
| 30 | permit | 172.16.0.0/12 | - | - | - | True | - |
12004+
| 40 | permit | 192.168.0.0/16 | - | - | - | True | mirror2 |
12005+
| 50 | permit | any | - | - | - | - | - |
12006+
| 60 | permit | - | - | - | - | - | - |
1200512007

1200612008
##### ACL-API
1200712009

12008-
| Sequence | Action |
12009-
| -------- | ------ |
12010-
| 10 | remark ACL to restrict access to switch API to CVP and Ansible |
12011-
| 20 | permit host 10.10.10.10 |
12012-
| 30 | permit host 10.10.10.11 |
12013-
| 40 | permit host 10.10.10.12 |
12010+
| Sequence | Action | Source | Remark | VLAN/Mask | Inner VLAN/Mask | Log | Mirror Session |
12011+
| -------- | ------ | ------ | ------ | ---- | ---------- | --- | -------------- |
12012+
| 10 | - | - | ACL to restrict access to switch API to CVP and Ansible | - | - | - | - |
12013+
| 20 | permit | 10.10.10.10 | - | 10 0x001 | - | - | mirror1 |
12014+
| 30 | permit | 10.10.10.11 | - | - | 10 0x001 | True | - |
12015+
| 40 | permit | 10.10.10.12 | - | 10 0x001 | 10 0x001 | True | mirror1 |
12016+
| 50 | permit | any | - | 10 0x001 | 10 0x001 | - | - |
1201412017

1201512018
##### ACL-SSH
1201612019

1201712020
ACL has counting mode `counters per-entry` enabled!
1201812021

12019-
| Sequence | Action |
12020-
| -------- | ------ |
12021-
| 10 | remark ACL to restrict access RFC1918 addresses |
12022-
| 20 | permit 10.0.0.0/8 |
12023-
| 30 | permit 172.16.0.0/12 |
12024-
| 40 | permit 192.168.0.0/16 |
12022+
| Sequence | Action | Source | Remark | VLAN/Mask | Inner VLAN/Mask | Log | Mirror Session |
12023+
| -------- | ------ | ------ | ------ | ---- | ---------- | --- | -------------- |
12024+
| 10 | - | - | ACL to restrict access RFC1918 addresses | - | - | - | - |
12025+
| 20 | permit | 10.0.0.0/8 | - | 10 0x000 | 20 0x001 | True | mirror1 |
12026+
| 30 | permit | 172.16.0.0/12 | - | - | 20 0x001 | True | mirror1 |
12027+
| 40 | permit | 192.168.0.0/16 | - | - | - | - | - |
1202512028

1202612029
##### ACL-SSH-VRF
1202712030

12028-
| Sequence | Action |
12029-
| -------- | ------ |
12030-
| 10 | remark ACL to restrict access RFC1918 addresses |
12031-
| 20 | permit 10.0.0.0/8 |
12032-
| 30 | permit 172.16.0.0/12 |
12033-
| 40 | permit 192.168.0.0/16 |
12031+
| Sequence | Action | Source | Remark | VLAN/Mask | Inner VLAN/Mask | Log | Mirror Session |
12032+
| -------- | ------ | ------ | ------ | ---- | ---------- | --- | -------------- |
12033+
| 10 | - | - | ACL to restrict access RFC1918 addresses | - | - | - | - |
12034+
| 20 | permit | 10.0.0.0/8 | - | 10 0x000 | 20 0x001 | - | - |
12035+
| 30 | permit | 172.16.0.0/12 | - | 10 0x000 | - | - | - |
12036+
| 40 | permit | 192.168.0.0/16 | - | - | 20 0x001 | - | - |
1203412037

1203512038
#### Standard Access-lists Device Configuration
1203612039

1203712040
```eos
1203812041
!
1203912042
ip access-list standard 99
12040-
10 remark ACL to restrict access RFC1918 addresses
12041-
20 permit 10.0.0.0/8
12042-
30 permit 172.16.0.0/12
12043-
40 permit 192.168.0.0/16
12043+
remark ACL to restrict access RFC1918 addresses
12044+
permit 10.0.0.0/8 mirror session mirror1
12045+
30 permit 172.16.0.0/12 log
12046+
40 permit 192.168.0.0/16 mirror session mirror2 log
12047+
50 permit any
1204412048
!
1204512049
ip access-list standard ACL-API
1204612050
10 remark ACL to restrict access to switch API to CVP and Ansible
12047-
20 permit host 10.10.10.10
12048-
30 permit host 10.10.10.11
12049-
40 permit host 10.10.10.12
12051+
20 permit vlan 10 0x001 host 10.10.10.10 mirror session mirror1
12052+
30 permit vlan inner 10 0x001 host 10.10.10.11 log
12053+
40 permit vlan 10 0x001 inner 10 0x001 host 10.10.10.12 mirror session mirror1 log
12054+
50 permit vlan 10 0x001 inner 10 0x001 any
1205012055
!
1205112056
ip access-list standard ACL-SSH
1205212057
counters per-entry
1205312058
10 remark ACL to restrict access RFC1918 addresses
12054-
20 permit 10.0.0.0/8
12055-
30 permit 172.16.0.0/12
12059+
20 permit vlan 10 0x000 inner 20 0x001 10.0.0.0/8 mirror session mirror1 log
12060+
30 permit vlan inner 20 0x001 172.16.0.0/12 mirror session mirror1 log
1205612061
40 permit 192.168.0.0/16
1205712062
!
1205812063
ip access-list standard ACL-SSH-VRF
1205912064
10 remark ACL to restrict access RFC1918 addresses
12060-
20 permit 10.0.0.0/8
12061-
30 permit 172.16.0.0/12
12062-
40 permit 192.168.0.0/16
12065+
20 permit vlan 10 0x000 inner 20 0x001 10.0.0.0/8
12066+
30 permit vlan 10 0x000 172.16.0.0/12
12067+
40 permit vlan inner 20 0x001 192.168.0.0/16
1206312068
```
1206412069

1206512070
### IP Access-lists

ansible_collections/arista/avd/extensions/molecule/eos_cli_config_gen/intended/configs/host1.cfg

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5062,29 +5062,31 @@ class-map type pbr match-any aaa
50625062
match ip access-group ACL_PBR_INCLUDE
50635063
!
50645064
ip access-list standard 99
5065-
10 remark ACL to restrict access RFC1918 addresses
5066-
20 permit 10.0.0.0/8
5067-
30 permit 172.16.0.0/12
5068-
40 permit 192.168.0.0/16
5065+
remark ACL to restrict access RFC1918 addresses
5066+
permit 10.0.0.0/8 mirror session mirror1
5067+
30 permit 172.16.0.0/12 log
5068+
40 permit 192.168.0.0/16 mirror session mirror2 log
5069+
50 permit any
50695070
!
50705071
ip access-list standard ACL-API
50715072
10 remark ACL to restrict access to switch API to CVP and Ansible
5072-
20 permit host 10.10.10.10
5073-
30 permit host 10.10.10.11
5074-
40 permit host 10.10.10.12
5073+
20 permit vlan 10 0x001 host 10.10.10.10 mirror session mirror1
5074+
30 permit vlan inner 10 0x001 host 10.10.10.11 log
5075+
40 permit vlan 10 0x001 inner 10 0x001 host 10.10.10.12 mirror session mirror1 log
5076+
50 permit vlan 10 0x001 inner 10 0x001 any
50755077
!
50765078
ip access-list standard ACL-SSH
50775079
counters per-entry
50785080
10 remark ACL to restrict access RFC1918 addresses
5079-
20 permit 10.0.0.0/8
5080-
30 permit 172.16.0.0/12
5081+
20 permit vlan 10 0x000 inner 20 0x001 10.0.0.0/8 mirror session mirror1 log
5082+
30 permit vlan inner 20 0x001 172.16.0.0/12 mirror session mirror1 log
50815083
40 permit 192.168.0.0/16
50825084
!
50835085
ip access-list standard ACL-SSH-VRF
50845086
10 remark ACL to restrict access RFC1918 addresses
5085-
20 permit 10.0.0.0/8
5086-
30 permit 172.16.0.0/12
5087-
40 permit 192.168.0.0/16
5087+
20 permit vlan 10 0x000 inner 20 0x001 10.0.0.0/8
5088+
30 permit vlan 10 0x000 172.16.0.0/12
5089+
40 permit vlan inner 20 0x001 192.168.0.0/16
50885090
!
50895091
ip routing ipv6 interfaces
50905092
ip hardware fib optimize prefixes profile urpf-internet

ansible_collections/arista/avd/extensions/molecule/eos_cli_config_gen/inventory/host_vars/host1/standard-acl.yml

Lines changed: 81 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,104 @@
22
### Standard Access-Lists ###
33
standard_access_lists:
44
- name: ACL-API
5-
sequence_numbers:
5+
entries:
66
- sequence: 10
7-
action: "remark ACL to restrict access to switch API to CVP and Ansible"
7+
remark: "ACL to restrict access to switch API to CVP and Ansible"
88
- sequence: 20
9-
action: "permit host 10.10.10.10"
9+
action: permit
10+
source: 10.10.10.10
11+
mirror_session: mirror1
12+
vlan: 10
13+
vlan_mask: "0x001"
1014
- sequence: 30
11-
action: "permit host 10.10.10.11"
15+
action: permit
16+
source: 10.10.10.11
17+
inner_vlan: 10
18+
inner_vlan_mask: "0x001"
19+
log: true
1220
- sequence: 40
13-
action: "permit host 10.10.10.12"
21+
action: permit
22+
source: 10.10.10.12
23+
mirror_session: mirror1
24+
log: true
25+
vlan: 10
26+
vlan_mask: "0x001"
27+
inner_vlan: 10
28+
inner_vlan_mask: "0x001"
29+
- sequence: 50
30+
action: permit
31+
source: any
32+
vlan: 10
33+
vlan_mask: "0x001"
34+
inner_vlan: 10
35+
inner_vlan_mask: "0x001"
1436
- name: ACL-SSH
1537
counters_per_entry: true
16-
sequence_numbers:
38+
entries:
1739
- sequence: 10
18-
action: "remark ACL to restrict access RFC1918 addresses"
40+
remark: "ACL to restrict access RFC1918 addresses"
1941
- sequence: 20
20-
action: "permit 10.0.0.0/8"
42+
action: permit
43+
source: 10.0.0.0/8
44+
vlan: 10
45+
vlan_mask: "0x000"
46+
inner_vlan: 20
47+
inner_vlan_mask: "0x001"
48+
log: true
49+
mirror_session: mirror1
2150
- sequence: 30
22-
action: "permit 172.16.0.0/12"
51+
action: permit
52+
source: 172.16.0.0/12
53+
inner_vlan: 20
54+
inner_vlan_mask: "0x001"
55+
log: true
56+
mirror_session: mirror1
2357
- sequence: 40
24-
action: "permit 192.168.0.0/16"
58+
action: permit
59+
source: 192.168.0.0/16
2560
- name: ACL-SSH-VRF
2661
counters_per_entry: false
27-
sequence_numbers:
62+
entries:
2863
- sequence: 10
29-
action: "remark ACL to restrict access RFC1918 addresses"
64+
remark: "ACL to restrict access RFC1918 addresses"
3065
- sequence: 20
31-
action: "permit 10.0.0.0/8"
66+
action: permit
67+
source: 10.0.0.0/8
68+
vlan: 10
69+
vlan_mask: "0x000"
70+
inner_vlan: 20
71+
inner_vlan_mask: "0x001"
3272
- sequence: 30
33-
action: "permit 172.16.0.0/12"
73+
action: permit
74+
source: 172.16.0.0/12
75+
vlan: 10
76+
vlan_mask: "0x000"
3477
- sequence: 40
35-
action: "permit 192.168.0.0/16"
78+
action: permit
79+
source: 192.168.0.0/16
80+
inner_vlan: 20
81+
inner_vlan_mask: "0x001"
3682
- name: 99 # numeric ACL name
3783
counters_per_entry: false
38-
sequence_numbers:
39-
- sequence: 10
40-
action: "remark ACL to restrict access RFC1918 addresses"
41-
- sequence: 20
42-
action: "permit 10.0.0.0/8"
84+
entries:
85+
- remark: "ACL to restrict access RFC1918 addresses"
86+
- action: permit
87+
source: 10.0.0.0/8
88+
vlan: 20
89+
inner_vlan: 10
90+
mirror_session: mirror1
4391
- sequence: 30
44-
action: "permit 172.16.0.0/12"
92+
action: permit
93+
source: 172.16.0.0/12
94+
log: true
4595
- sequence: 40
46-
action: "permit 192.168.0.0/16"
96+
action: permit
97+
source: 192.168.0.0/16
98+
mirror_session: mirror2
99+
log: true
100+
- sequence: 50
101+
action: permit
102+
source: any
103+
# Below configuration is not rendered as there is not source.
104+
- sequence: 60
105+
action: permit

ansible_collections/arista/avd/extensions/molecule/eos_cli_config_gen_deprecated_vars/documentation/devices/host1.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- [Tunnel Interfaces](#tunnel-interfaces)
1616
- [VLAN Interfaces](#vlan-interfaces)
1717
- [ACL](#acl)
18+
- [Standard Access-lists](#standard-access-lists)
1819
- [Extended Access-lists](#extended-access-lists)
1920

2021
## Management
@@ -280,6 +281,26 @@ interface VLAN20
280281

281282
## ACL
282283

284+
### Standard Access-lists
285+
286+
#### Standard Access-lists Summary
287+
288+
##### ACL-API
289+
290+
| Sequence | Action | Source | Remark | VLAN/Mask | Inner VLAN/Mask | Log | Mirror Session |
291+
| -------- | ------ | ------ | ------ | ---- | ---------- | --- | -------------- |
292+
| 10 | remark ACL to restrict access to switch API to CVP and Ansible | - | - | - | - | - | - |
293+
| 20 | permit host 10.10.10.10 | - | - | - | - | - | - |
294+
295+
#### Standard Access-lists Device Configuration
296+
297+
```eos
298+
!
299+
ip access-list standard ACL-API
300+
10 remark ACL to restrict access to switch API to CVP and Ansible
301+
20 permit host 10.10.10.10
302+
```
303+
283304
### Extended Access-lists
284305

285306
#### Extended Access-lists Summary

ansible_collections/arista/avd/extensions/molecule/eos_cli_config_gen_deprecated_vars/intended/configs/host1.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ ip access-list acl_qos_tc0_v4
7777
ip access-list acl_qos_tc5_v4
7878
10 permit ip any any dscp ef
7979
!
80+
ip access-list standard ACL-API
81+
10 remark ACL to restrict access to switch API to CVP and Ansible
82+
20 permit host 10.10.10.10
83+
!
8084
ip radius vrf default source-interface Loopback1
8185
!
8286
ip radius source-interface Loopback10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
### Standard Access-Lists ###
3+
standard_access_lists:
4+
- name: ACL-API
5+
sequence_numbers:
6+
- sequence: 10
7+
action: "remark ACL to restrict access to switch API to CVP and Ansible"
8+
- sequence: 20
9+
action: "permit host 10.10.10.10"

0 commit comments

Comments
 (0)