Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(eos_cli_config_gen): Extend match lists to support IPv4 and IPv6 #3770

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
88a076e
update templates
colinmacgiolla Mar 25, 2024
01ece3a
update schema
colinmacgiolla Mar 25, 2024
da0fd66
cleanup
colinmacgiolla Mar 25, 2024
f2c362a
Update molecule tests
colinmacgiolla Mar 25, 2024
20944e2
Merge branch 'aristanetworks:devel' into extend_match_lists
colinmacgiolla Mar 25, 2024
f440fbd
linter
colinmacgiolla Mar 25, 2024
9ce5779
Merge branch 'extend_match_lists' of https://github.com/colinmacgioll…
colinmacgiolla Mar 25, 2024
aa440f3
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Mar 25, 2024
8534922
rerun pre-commit on all files
colinmacgiolla Mar 25, 2024
c5b6153
Merge branch 'extend_match_lists' of https://github.com/colinmacgioll…
colinmacgiolla Mar 25, 2024
4c7fbbf
Close table row
colinmacgiolla Mar 26, 2024
409c3e4
Keep list of prefixes as a single row
colinmacgiolla Mar 26, 2024
3aa97d8
typos
colinmacgiolla Mar 26, 2024
96fd744
switch to using RFC5737
colinmacgiolla Mar 26, 2024
42f88ee
enhance schema with min_length
colinmacgiolla Mar 26, 2024
1077758
Schema rebuild
colinmacgiolla Mar 26, 2024
9ce10b1
Rebuild documentation
colinmacgiolla Mar 26, 2024
37d6dd3
Merge branch 'devel' into extend_match_lists
colinmacgiolla Mar 26, 2024
e40e2e7
Update ansible_collections/arista/avd/roles/eos_cli_config_gen/templa…
colinmacgiolla Mar 26, 2024
8100413
Update ansible_collections/arista/avd/roles/eos_cli_config_gen/templa…
colinmacgiolla Mar 26, 2024
ec9cd02
Fix generated documentation based on suggestion
colinmacgiolla Mar 26, 2024
0460fc9
doc update
colinmacgiolla Mar 26, 2024
a8969d8
Merge branch 'devel' into extend_match_lists
colinmacgiolla Mar 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ interface Management1

### Match-lists

#### Match-list Input IPv4-prefix Summary

| Prefix List Name | Prefixes |
| ---------------- | -------- |
| molecule_v4 | 10.10.10.0/24, 10.10.20.0/24 |

#### Match-list Input IPv6-prefix Summary

| Prefix List Name | Prefixes |
| ---------------- | -------- |
| molecule_v6 | 2001:0DB8::/32 |

#### Match-list Input String Summary

##### molecule
Expand All @@ -52,6 +64,13 @@ interface Management1

```eos
!
match-list input prefix-ipv4 molecule_v4
match prefix-ipv4 10.10.10.0/24
match prefix-ipv4 10.10.20.0/24
!
match-list input prefix-ipv6 molecule_v6
match prefix-ipv6 2001:0DB8::/32
!
match-list input string molecule
10 match regex ^.*MOLECULE.*$
20 match regex ^.*TESTING.*$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
!
transceiver qsfp default-mode 4x10G
!
match-list input prefix-ipv4 molecule_v4
match prefix-ipv4 10.10.10.0/24
match prefix-ipv4 10.10.20.0/24
!
match-list input prefix-ipv6 molecule_v6
match prefix-ipv6 2001:0DB8::/32
!
match-list input string molecule
10 match regex ^.*MOLECULE.*$
20 match regex ^.*TESTING.*$
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
match_list_input:
prefix_ipv4:
- name: molecule_v4
prefixes:
- 10.10.10.0/24
- 10.10.20.0/24
prefix_ipv6:
- name: molecule_v6
prefixes:
- 2001:0DB8::/32
string:
- name: molecule
sequence_numbers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
| Variable | Type | Required | Default | Value Restrictions | Description |
| -------- | ---- | -------- | ------- | ------------------ | ----------- |
| [<samp>match_list_input</samp>](## "match_list_input") | Dictionary | | | | |
| [<samp>&nbsp;&nbsp;prefix_ipv4</samp>](## "match_list_input.prefix_ipv4") | List, items: Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;name</samp>](## "match_list_input.prefix_ipv4.[].name") | String | Required, Unique | | | Prefix-List Name. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prefixes</samp>](## "match_list_input.prefix_ipv4.[].prefixes") | List, items: String | Required | | Min Length: 1 | List of IPv4 prefixes (with the subnet mask e.g. 192.0.2.0/24). |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&lt;str&gt;</samp>](## "match_list_input.prefix_ipv4.[].prefixes.[]") | String | | | | |
| [<samp>&nbsp;&nbsp;prefix_ipv6</samp>](## "match_list_input.prefix_ipv6") | List, items: Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;name</samp>](## "match_list_input.prefix_ipv6.[].name") | String | Required, Unique | | | Prefix-List Name. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prefixes</samp>](## "match_list_input.prefix_ipv6.[].prefixes") | List, items: String | Required | | Min Length: 1 | List of IPv6 prefixes (with the subnet mask e.g. 2001:db8:abcd:0013::/64). |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&lt;str&gt;</samp>](## "match_list_input.prefix_ipv6.[].prefixes.[]") | String | | | | |
| [<samp>&nbsp;&nbsp;string</samp>](## "match_list_input.string") | List, items: Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;name</samp>](## "match_list_input.string.[].name") | String | Required, Unique | | | Match-list Name |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sequence_numbers</samp>](## "match_list_input.string.[].sequence_numbers") | List, items: Dictionary | Required | | | |
Expand All @@ -18,6 +26,22 @@

```yaml
match_list_input:
prefix_ipv4:

# Prefix-List Name.
- name: <str; required; unique>

# List of IPv4 prefixes (with the subnet mask e.g. 192.0.2.0/24).
prefixes: # >=1 items; required
- <str>
prefix_ipv6:

# Prefix-List Name.
- name: <str; required; unique>

# List of IPv6 prefixes (with the subnet mask e.g. 2001:db8:abcd:0013::/64).
prefixes: # >=1 items; required
- <str>
ClausHolbechArista marked this conversation as resolved.
Show resolved Hide resolved
string:

# Match-list Name
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,38 @@ keys:
type: dict
display_name: Match Lists
keys:
prefix_ipv4:
type: list
primary_key: name
items:
type: dict
keys:
name:
type: str
description: Prefix-List Name.
prefixes:
type: list
required: true
colinmacgiolla marked this conversation as resolved.
Show resolved Hide resolved
min_length: 1
description: List of IPv4 prefixes (with the subnet mask e.g. 192.0.2.0/24).
items:
type: str
prefix_ipv6:
type: list
primary_key: name
items:
type: dict
keys:
name:
type: str
description: Prefix-List Name.
prefixes:
type: list
required: true
min_length: 1
description: List of IPv6 prefixes (with the subnet mask e.g. 2001:db8:abcd:0013::/64).
items:
type: str
string:
type: list
primary_key: name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,28 @@
{% if match_list_input is arista.avd.defined %}

### Match-lists
{% if match_list_input.prefix_ipv4 is arista.avd.defined %}

#### Match-list Input IPv4-prefix Summary

| Prefix List Name | Prefixes |
| ---------------- | -------- |
{% for match_list in match_list_input.prefix_ipv4 %}
| {{ match_list.name }} | {{ match_list.prefixes | arista.avd.default(['-']) | join(', ') }} |
{% endfor %}
{% endif %}
{% if match_list_input.prefix_ipv6 is arista.avd.defined %}

#### Match-list Input IPv6-prefix Summary

| Prefix List Name | Prefixes |
| ---------------- | -------- |
{% for match_list in match_list_input.prefix_ipv6 %}
| {{ match_list.name }} | {{ match_list.prefixes | arista.avd.default(['-']) | join(', ') }} |
{% endfor %}
{% endif %}
{% if match_list_input.string is arista.avd.defined %}

#### Match-list Input String Summary

{% for match_list in match_list_input.string | arista.avd.natural_sort('name') %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,33 @@
#}
{# eos - match list input #}
{% if match_list_input is arista.avd.defined %}
{% if match_list_input.prefix_ipv4 is arista.avd.defined %}
!
{% for match_list in match_list_input.string | arista.avd.natural_sort('name') %}
{% for match_list in match_list_input.prefix_ipv4 | arista.avd.natural_sort('name') %}
match-list input prefix-ipv4 {{ match_list.name }}
{% for entry in match_list.prefixes %}
match prefix-ipv4 {{ entry }}
{% endfor %}
{% endfor %}
{% endif %}
{% if match_list_input.prefix_ipv6 is arista.avd.defined %}
!
{% for match_list in match_list_input.prefix_ipv6 | arista.avd.natural_sort('name') %}
match-list input prefix-ipv6 {{ match_list.name }}
{% for entry in match_list.prefixes %}
match prefix-ipv6 {{ entry }}
{% endfor %}
{% endfor %}
{% endif %}
{% if match_list_input.string is arista.avd.defined %}
!
{% for match_list in match_list_input.string | arista.avd.natural_sort('name') %}
match-list input string {{ match_list.name }}
{% for sequence in match_list.sequence_numbers | arista.avd.natural_sort('sequence') %}
{% if sequence.match_regex is arista.avd.defined %}
{% for sequence in match_list.sequence_numbers | arista.avd.natural_sort('sequence') %}
{% if sequence.match_regex is arista.avd.defined %}
{{ sequence.sequence }} match regex {{ sequence.match_regex }}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
Loading