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): DHCP Server data model #3269
Conversation
739cd3e
to
466ae2f
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
466ae2f
to
f3ce50f
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
...ections/arista/avd/roles/eos_cli_config_gen/schemas/schema_fragments/dhcp_servers.schema.yml
Show resolved
Hide resolved
...ections/arista/avd/roles/eos_cli_config_gen/schemas/schema_fragments/dhcp_servers.schema.yml
Show resolved
Hide resolved
...ections/arista/avd/roles/eos_cli_config_gen/schemas/schema_fragments/dhcp_servers.schema.yml
Show resolved
Hide resolved
...ections/arista/avd/roles/eos_cli_config_gen/schemas/schema_fragments/dhcp_servers.schema.yml
Outdated
Show resolved
Hide resolved
...ections/arista/avd/roles/eos_cli_config_gen/schemas/schema_fragments/dhcp_servers.schema.yml
Outdated
Show resolved
Hide resolved
ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/dhcp-server.yml
Outdated
Show resolved
Hide resolved
ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/dhcp-server.cfg
Outdated
Show resolved
Hide resolved
ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/dhcp-servers.j2
Outdated
Show resolved
Hide resolved
ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/dhcp-servers.j2
Outdated
Show resolved
Hide resolved
ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/dhcp-servers.j2
Outdated
Show resolved
Hide resolved
Just tried rendering config with this data model and I was able to render a subnet with a prefix with no subnet mask and a plain-text value, which wouldn't be accepted at the CLI. See below: With subnet with no subnet mask: ---
type: l3spine
dhcp_servers:
- disabled: false
vrf: default
dns_domain_name_ipv4: arista.com
dns_domain_name_ipv6: arista.com
ipv4_vendor_options:
- vendor_id: phone
sub_options:
- number: 66
type: ipv4-address
data: 1.1.1.1
subnets:
- subnet: 10.255.255.0
name: Phones
default_gateway: 10.255.255.1
dns_servers:
- 8.8.8.8
ranges:
- start: 10.255.255.50
end: 10.255.255.254
lease_time:
days: 5
hours: 24
minutes: 15 Resulting configuration: dhcp server vrf default
dns domain name ipv4 arista.com
dns domain name ipv6 arista.com
!
subnet 10.255.255.0
!
range 10.255.255.50 10.255.255.254
name Phones
dns server 8.8.8.8
lease time 5 days 24 hours 15 minutes
default-gateway 10.255.255.1
!
vendor-option ipv4 phone
sub-option 66 type ipv4-address data 1.1.1.1 With plain text: ---
type: l3spine
dhcp_servers:
- disabled: false
vrf: default
dns_domain_name_ipv4: arista.com
dns_domain_name_ipv6: arista.com
ipv4_vendor_options:
- vendor_id: phone
sub_options:
- number: 66
type: ipv4-address
data: 1.1.1.1
subnets:
- subnet: phone-subnet
name: Phones
default_gateway: 10.255.255.1
dns_servers:
- 8.8.8.8
ranges:
- start: 10.255.255.50
end: 10.255.255.254
lease_time:
days: 5
hours: 24
minutes: 15 Resulting configuration: dhcp server vrf default
dns domain name ipv4 arista.com
dns domain name ipv6 arista.com
!
subnet phone-subnet
!
range 10.255.255.50 10.255.255.254
name Phones
dns server 8.8.8.8
lease time 5 days 24 hours 15 minutes
default-gateway 10.255.255.1
!
vendor-option ipv4 phone
sub-option 66 type ipv4-address data 1.1.1.1 Everything else looks good. |
These are both valid points though today we don't support yet format validation on these type of keys except through regex and we are not really implementing this today for instance you could generate this using AVD:
so let's not fix it in this PR yet |
ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/dhcp-server.j2
Outdated
Show resolved
Hide resolved
ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/dhcp-server.j2
Outdated
Show resolved
Hide resolved
ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/dhcp-server.j2
Outdated
Show resolved
Hide resolved
ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/dhcp-server.j2
Outdated
Show resolved
Hide resolved
ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/dhcp-server.j2
Outdated
Show resolved
Hide resolved
ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/dhcp-servers.yml
Outdated
Show resolved
Hide resolved
ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/dhcp-servers.yml
Show resolved
Hide resolved
ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/dhcp-servers.yml
Outdated
Show resolved
Hide resolved
...ble_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/dhcp-servers.md
Outdated
Show resolved
Hide resolved
Moving to draft until review comments have been addressed. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
...ections/arista/avd/roles/eos_cli_config_gen/schemas/schema_fragments/dhcp_servers.schema.yml
Show resolved
Hide resolved
...ections/arista/avd/roles/eos_cli_config_gen/schemas/schema_fragments/dhcp_servers.schema.yml
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of final touches - my changes will require to re-run molecule so let me do this. And I will approve!
Thanks @emilarista
...ections/arista/avd/roles/eos_cli_config_gen/schemas/schema_fragments/dhcp_servers.schema.yml
Outdated
Show resolved
Hide resolved
...ections/arista/avd/roles/eos_cli_config_gen/schemas/schema_fragments/dhcp_servers.schema.yml
Outdated
Show resolved
Hide resolved
...ections/arista/avd/roles/eos_cli_config_gen/schemas/schema_fragments/dhcp_servers.schema.yml
Outdated
Show resolved
Hide resolved
...ections/arista/avd/roles/eos_cli_config_gen/schemas/schema_fragments/dhcp_servers.schema.yml
Outdated
Show resolved
Hide resolved
ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/dhcp-server.j2
Outdated
Show resolved
Hide resolved
will need to run pre-commit + molecule again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked and works as intended!
Thanks for the review @hubertsumarno |
Change Summary
Implements dhcp servers in eos_cli_config_gen
Component(s) name
arista.avd.eos_cli_config_gen
Proposed changes
How to test
Repository Checklist