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): Add support for ip name server groups #4763

Draft
wants to merge 12 commits into
base: devel
Choose a base branch
from

Conversation

laxmikantchintakindi
Copy link
Contributor

@laxmikantchintakindi laxmikantchintakindi commented Nov 26, 2024

Change Summary

Add support for ip name server groups

Related Issue(s)

Fixes #4698

Component(s) name

arista.avd.eos_cli_config_gen

Proposed changes

There is no input variable for applying the ip name-server group to monitor connectivity via eos_cli_config_gen. Below contains the use cause example.

ip name-server group {name_server_group}
name-server vrf {name_server_vrf} {IP}

monitor connectivity
vrf {name_server_vrf}
interface set {set_name} {loopback_name}
description {description}
!
host {host_name}
url {url}
name-server group {name_server_group}

How to test

Checklist

User Checklist

  • N/A

Repository Checklist

  • My code has been rebased from devel before I start
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly.
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

Copy link

Review docs on Read the Docs

To test this pull request:

# Create virtual environment for this testing below the current directory
python -m venv test-avd-pr-4763
# Activate the virtual environment
source test-avd-pr-4763/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/laxmikantchintakindi/avd.git@feat/eos_cli/ip-name-server-group#subdirectory=python-avd" --force
# Point Ansible collections path to the Python virtual environment
export ANSIBLE_COLLECTIONS_PATH=$VIRTUAL_ENV/ansible_collections
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/laxmikantchintakindi/avd.git#/ansible_collections/arista/avd/,feat/eos_cli/ip-name-server-group --force
# Optional: Install AVD examples
cd test-avd-pr-4763
ansible-playbook arista.avd.install_examples

@github-actions github-actions bot added role: eos_cli_config_gen issue related to eos_cli_config_gen role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated labels Nov 26, 2024
@laxmikantchintakindi laxmikantchintakindi force-pushed the feat/eos_cli/ip-name-server-group branch 6 times, most recently from 13bff48 to 52d9f5a Compare November 26, 2024 15:07
@@ -5,7 +5,7 @@
# Line above is used by RedHat's YAML Schema vscode extension
# Use Ctrl + Space to get suggestions for every field. Autocomplete will pop up after typing 2 letters.
type: dict
keys:
$defs:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add default: default on the vrf to document what you are doing in the templates

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this defs and added all the keys in ip_name_server_groups schema with default vrf default.

Copy link
Contributor

@gmuloc gmuloc Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the reason for this (==removing the defs) was because we are not currently injecting default for ip name-servers ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

Copy link
Contributor

@gmuloc gmuloc Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok thanks

seems that default: default would make sense for the other one as well:

site3-leaf1(config-if-Et4)#ip name-server 1.1.1.1
site3-leaf1(config)#show run se name-ser
ip name-server vrf MGMT 10.14.0.1
ip name-server vrf MGMT 192.168.17.1
ip name-server vrf default 1.1.1.1

but that would be a breaking change in terms of what we produce as the current template does not inject VRF default. so we can revisit this later.

Can you please open an issue to track this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laxmikantchintakindi laxmikantchintakindi force-pushed the feat/eos_cli/ip-name-server-group branch from 3e14cbf to ae1ef81 Compare November 27, 2024 12:28
@laxmikantchintakindi laxmikantchintakindi force-pushed the feat/eos_cli/ip-name-server-group branch 3 times, most recently from fd9d66f to 37daa62 Compare December 2, 2024 07:30
@github-actions github-actions bot added the state: conflict PR with conflict label Dec 2, 2024
Copy link

github-actions bot commented Dec 2, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@laxmikantchintakindi laxmikantchintakindi force-pushed the feat/eos_cli/ip-name-server-group branch from 3fa7b5e to 69ae148 Compare December 2, 2024 10:01
@github-actions github-actions bot removed the state: conflict PR with conflict label Dec 2, 2024
Copy link

github-actions bot commented Dec 2, 2024

Conflicts have been resolved. A maintainer will review the pull request shortly.

@Vibhu-gslab Vibhu-gslab force-pushed the feat/eos_cli/ip-name-server-group branch from 69ae148 to f555179 Compare December 3, 2024 07:06
@laxmikantchintakindi laxmikantchintakindi marked this pull request as ready for review December 5, 2024 08:18
@laxmikantchintakindi laxmikantchintakindi requested a review from a team as a code owner December 5, 2024 08:18
@laxmikantchintakindi laxmikantchintakindi requested a review from a team as a code owner December 5, 2024 08:18
Use of this source code is governed by the Apache License 2.0
that can be found in the LICENSE file.
#}
{% for name_server_group in ip_name_server_groups | arista.avd.natural_sort("name") %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a documentation templates for ip name-server groups listing the servers inside

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

@laxmikantchintakindi laxmikantchintakindi marked this pull request as draft December 5, 2024 08:51
@laxmikantchintakindi laxmikantchintakindi force-pushed the feat/eos_cli/ip-name-server-group branch 5 times, most recently from 29f42a2 to cabcd45 Compare December 9, 2024 05:53
name_servers:
- ip_address: 8.8.8.8
vrf: vrf1
priority: 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the test for priority 0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

keys:
ip_address:
type: str
required: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we have ip_address as primary key we may not need required as true

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also we can have the same ip address in different vrf.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed primary_key

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we are allowed to keep required yet, please check once.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, you can keep ip_address as primary key and use allow_duplicate in order to use same ip address.

@@ -0,0 +1,33 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename the file to ip-name-server-groups

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

priority: 3

- name: mynameserver0
ip_domain_list: domain-list1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can improve the coverage by not defining ip_domain_list and dns_domain here. Add one more name server when just define dns_domain and do not define name_servers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

Comment on lines 25 to 26
| IP Address | VRF | Priority |
| ----------- | --- | -------- |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| IP Address | VRF | Priority |
| ----------- | --- | -------- |
| IP Address | VRF | Priority |
| ---------- | --- | -------- |

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@laxmikantchintakindi laxmikantchintakindi force-pushed the feat/eos_cli/ip-name-server-group branch from f773c16 to 706180d Compare December 10, 2024 09:13
@Vibhu-gslab Vibhu-gslab force-pushed the feat/eos_cli/ip-name-server-group branch from 706180d to 36830c4 Compare December 10, 2024 10:46
keys:
ip_address:
type: str
required: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we are allowed to keep required yet, please check once.

keys:
ip_address:
type: str
required: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, you can keep ip_address as primary key and use allow_duplicate in order to use same ip address.

{% do all_server_groups.append(server) %}
{% endfor %}
{% for server in all_server_groups | arista.avd.natural_sort("ip_address") | arista.avd.natural_sort("vrf") | arista.avd.natural_sort("priority") %}
{% if server.priority_defined %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need of priority_defined you can just check if priority != 0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Comment on lines 423 to 424
dns domain arista.avd.com
ip domain-list domain-list1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we give different values for dns domain and ip domain-list across list.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@@ -416,6 +416,27 @@ monitor server radius
probe threshold failure 100
probe method access-request username arista password 7 141600021F102B
!
ip name-server group mynameserver0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we verified config on cvp?

@laxmikantchintakindi laxmikantchintakindi force-pushed the feat/eos_cli/ip-name-server-group branch from 6209a56 to 172a66d Compare December 10, 2024 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
role: eos_cli_config_gen issue related to eos_cli_config_gen role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat(eos_cli_config_gen): Add support for ip name-server group
4 participants