-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(eos_cli_config_gen): DHCP Server data model (#3269)
Co-authored-by: Guillaume Mulocher <[email protected]>
- Loading branch information
1 parent
de33210
commit 82ad975
Showing
13 changed files
with
899 additions
and
5 deletions.
There are no files selected for viewing
135 changes: 135 additions & 0 deletions
135
...ns/arista/avd/molecule/eos_cli_config_gen/documentation/devices/dhcp-servers.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
# dhcp-servers | ||
|
||
## Table of Contents | ||
|
||
- [Management](#management) | ||
- [Management Interfaces](#management-interfaces) | ||
- [DHCP Server](#dhcp-server) | ||
- [DHCP Servers Summary](#dhcp-servers-summary) | ||
- [DHCP Server Configuration](#dhcp-server-configuration) | ||
|
||
## Management | ||
|
||
### Management Interfaces | ||
|
||
#### Management Interfaces Summary | ||
|
||
##### IPv4 | ||
|
||
| Management Interface | description | Type | VRF | IP Address | Gateway | | ||
| -------------------- | ----------- | ---- | --- | ---------- | ------- | | ||
| Management1 | oob_management | oob | MGMT | 10.73.255.122/24 | 10.73.255.2 | | ||
|
||
##### IPv6 | ||
|
||
| Management Interface | description | Type | VRF | IPv6 Address | IPv6 Gateway | | ||
| -------------------- | ----------- | ---- | --- | ------------ | ------------ | | ||
| Management1 | oob_management | oob | MGMT | - | - | | ||
|
||
#### Management Interfaces Device Configuration | ||
|
||
```eos | ||
! | ||
interface Management1 | ||
description oob_management | ||
vrf MGMT | ||
ip address 10.73.255.122/24 | ||
``` | ||
|
||
## DHCP Server | ||
|
||
### DHCP Servers Summary | ||
|
||
| DHCP Server Enabled | VRF | IPv4 DNS Domain | IPv6 DNS Domain | | ||
| ------------------- | --- | --------------- | --------------- | | ||
| True | AVRF | - | - | | ||
| True | defauls | - | - | | ||
| True | default | - | - | | ||
| True | defaulu | - | - | | ||
| True | TEST | testv4.com | testv6.com | | ||
| False | VRF01 | - | - | | ||
|
||
#### VRF AVRF DHCP Server | ||
|
||
##### Subnets | ||
|
||
| Subnet | Name | DNS Servers | Default Gateway | Lease Time | Ranges | | ||
| ------ | ---- | ----------- | --------------- | ---------- | ------ | | ||
| 172.16.254.0/24 | - | - | 172.16.254.1 | - | - | | ||
|
||
#### VRF default DHCP Server | ||
|
||
##### Subnets | ||
|
||
| Subnet | Name | DNS Servers | Default Gateway | Lease Time | Ranges | | ||
| ------ | ---- | ----------- | --------------- | ---------- | ------ | | ||
| 2a00:2::/64 | - | - | - | - | - | | ||
| 10.2.3.0/24 | - | - | - | - | - | | ||
|
||
#### VRF TEST DHCP Server | ||
|
||
##### Subnets | ||
|
||
| Subnet | Name | DNS Servers | Default Gateway | Lease Time | Ranges | | ||
| ------ | ---- | ----------- | --------------- | ---------- | ------ | | ||
| 10.0.0.0/24 | TEST1 | 10.1.1.12, 10.1.1.13 | 10.0.0.1 | 0 days, 0 hours, 10 minutes | 10.0.0.10-10.0.0.100, 10.0.0.110-10.0.0.120 | | ||
|
||
##### IPv4 Vendor Options | ||
|
||
| Vendor ID | Sub-option Code | Sub-option Type | Sub-option Data | | ||
| --------- | ----------------| --------------- | --------------- | | ||
| NTP | 1 | string | test | | ||
| NTP | 42 | ipv4-address | 10.1.1.1 | | ||
| NTP | 66 | array ipv4-address | 1.1.1.1 2.2.2.2 | | ||
|
||
#### VRF VRF01 DHCP Server | ||
|
||
##### Subnets | ||
|
||
| Subnet | Name | DNS Servers | Default Gateway | Lease Time | Ranges | | ||
| ------ | ---- | ----------- | --------------- | ---------- | ------ | | ||
| 192.168.0.0/24 | - | - | - | - | - | | ||
|
||
### DHCP Server Configuration | ||
|
||
```eos | ||
! | ||
dhcp server vrf AVRF | ||
! | ||
subnet 172.16.254.0/24 | ||
default-gateway 172.16.254.1 | ||
! | ||
dhcp server vrf defauls | ||
! | ||
dhcp server | ||
! | ||
subnet 2a00:2::/64 | ||
! | ||
subnet 10.2.3.0/24 | ||
! | ||
dhcp server vrf defaulu | ||
! | ||
dhcp server vrf TEST | ||
dns domain name ipv4 testv4.com | ||
dns domain name ipv6 testv6.com | ||
! | ||
subnet 10.0.0.0/24 | ||
! | ||
range 10.0.0.10 10.0.0.100 | ||
! | ||
range 10.0.0.110 10.0.0.120 | ||
name TEST1 | ||
dns server 10.1.1.12 10.1.1.13 | ||
lease time 0 days 0 hours 10 minutes | ||
default-gateway 10.0.0.1 | ||
! | ||
vendor-option ipv4 NTP | ||
sub-option 1 type string data "test" | ||
sub-option 42 type ipv4-address data 10.1.1.1 | ||
sub-option 66 type array ipv4-address data 1.1.1.1 2.2.2.2 | ||
! | ||
dhcp server vrf VRF01 | ||
! | ||
subnet 192.168.0.0/24 | ||
disabled | ||
``` |
54 changes: 54 additions & 0 deletions
54
ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/dhcp-servers.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
!RANCID-CONTENT-TYPE: arista | ||
! | ||
dhcp server vrf AVRF | ||
! | ||
subnet 172.16.254.0/24 | ||
default-gateway 172.16.254.1 | ||
! | ||
dhcp server vrf defauls | ||
! | ||
dhcp server | ||
! | ||
subnet 2a00:2::/64 | ||
! | ||
subnet 10.2.3.0/24 | ||
! | ||
dhcp server vrf defaulu | ||
! | ||
dhcp server vrf TEST | ||
dns domain name ipv4 testv4.com | ||
dns domain name ipv6 testv6.com | ||
! | ||
subnet 10.0.0.0/24 | ||
! | ||
range 10.0.0.10 10.0.0.100 | ||
! | ||
range 10.0.0.110 10.0.0.120 | ||
name TEST1 | ||
dns server 10.1.1.12 10.1.1.13 | ||
lease time 0 days 0 hours 10 minutes | ||
default-gateway 10.0.0.1 | ||
! | ||
vendor-option ipv4 NTP | ||
sub-option 1 type string data "test" | ||
sub-option 42 type ipv4-address data 10.1.1.1 | ||
sub-option 66 type array ipv4-address data 1.1.1.1 2.2.2.2 | ||
! | ||
dhcp server vrf VRF01 | ||
! | ||
subnet 192.168.0.0/24 | ||
disabled | ||
! | ||
transceiver qsfp default-mode 4x10G | ||
! | ||
hostname dhcp-servers | ||
! | ||
no enable password | ||
no aaa root | ||
! | ||
interface Management1 | ||
description oob_management | ||
vrf MGMT | ||
ip address 10.73.255.122/24 | ||
! | ||
end |
47 changes: 47 additions & 0 deletions
47
...e_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/dhcp-servers.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
dhcp_servers: | ||
- vrf: defauls | ||
- vrf: defaulu | ||
- vrf: TEST | ||
ipv4_vendor_options: | ||
- vendor_id: NTP | ||
sub_options: | ||
- code: 42 | ||
ipv4_address: "10.1.1.1" | ||
- code: 1 | ||
string: "test" | ||
- code: 66 | ||
array_ipv4_address: [1.1.1.1, 2.2.2.2] | ||
disabled: false | ||
dns_domain_name_ipv4: testv4.com | ||
dns_domain_name_ipv6: testv6.com | ||
subnets: | ||
- subnet: 10.0.0.0/24 # required | ||
name: TEST1 | ||
ranges: | ||
- start: 10.0.0.110 # required | ||
end: 10.0.0.120 # required | ||
- start: 10.0.0.10 # required | ||
end: 10.0.0.100 # required | ||
dns_servers: | ||
- 10.1.1.12 | ||
- 10.1.1.13 | ||
lease_time: | ||
days: 0 | ||
hours: 0 | ||
minutes: 10 | ||
default_gateway: 10.0.0.1 | ||
|
||
- vrf: default | ||
subnets: | ||
- subnet: 10.2.3.0/24 | ||
- subnet: 2a00:2::/64 | ||
|
||
- vrf: VRF01 | ||
subnets: | ||
- subnet: 192.168.0.0/24 | ||
disabled: true | ||
|
||
- vrf: AVRF | ||
subnets: | ||
- subnet: 172.16.254.0/24 | ||
default_gateway: 172.16.254.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ daemons | |
dps-interfaces | ||
dns-ntp | ||
dhcp-relay | ||
dhcp-servers | ||
dot1x | ||
dot1x-2 | ||
enable-password | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
...ble_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/dhcp-servers.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<!-- | ||
~ Copyright (c) 2023-2024 Arista Networks, Inc. | ||
~ Use of this source code is governed by the Apache License 2.0 | ||
~ that can be found in the LICENSE file. | ||
--> | ||
=== "Table" | ||
|
||
| Variable | Type | Required | Default | Value Restrictions | Description | | ||
| -------- | ---- | -------- | ------- | ------------------ | ----------- | | ||
| [<samp>dhcp_servers</samp>](## "dhcp_servers") | List, items: Dictionary | | | | | | ||
| [<samp> - disabled</samp>](## "dhcp_servers.[].disabled") | Boolean | | | | | | ||
| [<samp> vrf</samp>](## "dhcp_servers.[].vrf") | String | Required, Unique | | | VRF in which to configure the DHCP server, use `default` to indicate default VRF. | | ||
| [<samp> dns_domain_name_ipv4</samp>](## "dhcp_servers.[].dns_domain_name_ipv4") | String | | | | | | ||
| [<samp> dns_domain_name_ipv6</samp>](## "dhcp_servers.[].dns_domain_name_ipv6") | String | | | | | | ||
| [<samp> ipv4_vendor_options</samp>](## "dhcp_servers.[].ipv4_vendor_options") | List, items: Dictionary | | | | | | ||
| [<samp> - vendor_id</samp>](## "dhcp_servers.[].ipv4_vendor_options.[].vendor_id") | String | Required, Unique | | | | | ||
| [<samp> sub_options</samp>](## "dhcp_servers.[].ipv4_vendor_options.[].sub_options") | List, items: Dictionary | | | | | | ||
| [<samp> - code</samp>](## "dhcp_servers.[].ipv4_vendor_options.[].sub_options.[].code") | Integer | Required, Unique | | Min: 1<br>Max: 254 | | | ||
| [<samp> string</samp>](## "dhcp_servers.[].ipv4_vendor_options.[].sub_options.[].string") | String | | | | String value for suboption data.<br>Only one of `string`, `ipv4_address` and `array_ipv4_address` variables should be used for any one suboption.<br>The order of precedence if multiple of these variables are defined is `string` -> `ipv4_address` -> `array_ipv4_address`. | | ||
| [<samp> ipv4_address</samp>](## "dhcp_servers.[].ipv4_vendor_options.[].sub_options.[].ipv4_address") | String | | | | IPv4 address value for suboption data.<br>Only one of `string`, `ipv4_address` and `array_ipv4_address` variables should be used for any one suboption.<br>The order of precedence if multiple of these variables are defined is `string` -> `ipv4_address` -> `array_ipv4_address`. | | ||
| [<samp> array_ipv4_address</samp>](## "dhcp_servers.[].ipv4_vendor_options.[].sub_options.[].array_ipv4_address") | List, items: String | | | | Array of IPv4 addresses for suboption data.<br>Only one of `string`, `ipv4_address` and `array_ipv4_address` variables should be used for any one suboption.<br>The order of precedence if multiple of these variables are defined is `string` -> `ipv4_address` -> `array_ipv4_address`. | | ||
| [<samp> - <str></samp>](## "dhcp_servers.[].ipv4_vendor_options.[].sub_options.[].array_ipv4_address.[]") | String | | | | | | ||
| [<samp> subnets</samp>](## "dhcp_servers.[].subnets") | List, items: Dictionary | | | | | | ||
| [<samp> - subnet</samp>](## "dhcp_servers.[].subnets.[].subnet") | String | Required, Unique | | | | | ||
| [<samp> name</samp>](## "dhcp_servers.[].subnets.[].name") | String | | | | | | ||
| [<samp> default_gateway</samp>](## "dhcp_servers.[].subnets.[].default_gateway") | String | | | | | | ||
| [<samp> dns_servers</samp>](## "dhcp_servers.[].subnets.[].dns_servers") | List, items: String | | | | | | ||
| [<samp> - <str></samp>](## "dhcp_servers.[].subnets.[].dns_servers.[]") | String | | | | | | ||
| [<samp> ranges</samp>](## "dhcp_servers.[].subnets.[].ranges") | List, items: Dictionary | | | | | | ||
| [<samp> - start</samp>](## "dhcp_servers.[].subnets.[].ranges.[].start") | String | Required | | | | | ||
| [<samp> end</samp>](## "dhcp_servers.[].subnets.[].ranges.[].end") | String | Required | | | | | ||
| [<samp> lease_time</samp>](## "dhcp_servers.[].subnets.[].lease_time") | Dictionary | | | | | | ||
| [<samp> days</samp>](## "dhcp_servers.[].subnets.[].lease_time.days") | Integer | Required | | Min: 0<br>Max: 2000 | | | ||
| [<samp> hours</samp>](## "dhcp_servers.[].subnets.[].lease_time.hours") | Integer | Required | | Min: 0<br>Max: 23 | | | ||
| [<samp> minutes</samp>](## "dhcp_servers.[].subnets.[].lease_time.minutes") | Integer | Required | | Min: 0<br>Max: 59 | | | ||
|
||
=== "YAML" | ||
|
||
```yaml | ||
dhcp_servers: | ||
- disabled: <bool> | ||
|
||
# VRF in which to configure the DHCP server, use `default` to indicate default VRF. | ||
vrf: <str; required; unique> | ||
dns_domain_name_ipv4: <str> | ||
dns_domain_name_ipv6: <str> | ||
ipv4_vendor_options: | ||
- vendor_id: <str; required; unique> | ||
sub_options: | ||
- code: <int; 1-254; required; unique> | ||
|
||
# String value for suboption data. | ||
# Only one of `string`, `ipv4_address` and `array_ipv4_address` variables should be used for any one suboption. | ||
# The order of precedence if multiple of these variables are defined is `string` -> `ipv4_address` -> `array_ipv4_address`. | ||
string: <str> | ||
|
||
# IPv4 address value for suboption data. | ||
# Only one of `string`, `ipv4_address` and `array_ipv4_address` variables should be used for any one suboption. | ||
# The order of precedence if multiple of these variables are defined is `string` -> `ipv4_address` -> `array_ipv4_address`. | ||
ipv4_address: <str> | ||
|
||
# Array of IPv4 addresses for suboption data. | ||
# Only one of `string`, `ipv4_address` and `array_ipv4_address` variables should be used for any one suboption. | ||
# The order of precedence if multiple of these variables are defined is `string` -> `ipv4_address` -> `array_ipv4_address`. | ||
array_ipv4_address: | ||
- <str> | ||
subnets: | ||
- subnet: <str; required; unique> | ||
name: <str> | ||
default_gateway: <str> | ||
dns_servers: | ||
- <str> | ||
ranges: | ||
- start: <str; required> | ||
end: <str; required> | ||
lease_time: | ||
days: <int; 0-2000; required> | ||
hours: <int; 0-23; required> | ||
minutes: <int; 0-59; required> | ||
``` |
Oops, something went wrong.