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 monitor server radius #4595

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

Conversation

laxmikantchintakindi
Copy link
Contributor

@laxmikantchintakindi laxmikantchintakindi commented Oct 15, 2024

Change Summary

Add support for monitor server radius in eos_cli_config_gen.

monitor_server_radius:
  service_dot1x: <bool>
  probe:
    interval: <int, 1-1000>
    threshold_failure: <int, 1-255>
    method: <str; "status-server" | "access-request">
    access_request: # Only relevant when method is 'access-request'
      username: <str>
      password: <str> # Password as type 7

Related Issue(s)

Fixes #4273

Component(s) name

arista.avd.eos_cli_config_gen

Proposed changes

Add support for monitor server radius in eos_cli_config_gen.

monitor_server_radius:
  service_dot1x: <bool>
  probe:
    interval: <int, 1-1000>
    threshold_failure: <int, 1-255>
    method: <str; "status-server" | "access-request">
    access_request: # Only relevant when method is 'access-request'
      username: <str>
      password: <str> # Password as type 7

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-4595
# Activate the virtual environment
source test-avd-pr-4595/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/laxmikantchintakindi/avd.git@feat/monitor-server-radius#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/monitor-server-radius --force
# Optional: Install AVD examples
cd test-avd-pr-4595
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 labels Oct 15, 2024
@gmuloc gmuloc added this to the v5.1.0-dev1 milestone Oct 15, 2024
@laxmikantchintakindi laxmikantchintakindi force-pushed the feat/monitor-server-radius branch 3 times, most recently from e15c46b to d00db5d Compare October 16, 2024 06:09
@laxmikantchintakindi laxmikantchintakindi force-pushed the feat/monitor-server-radius branch 2 times, most recently from 152b0a8 to 6ef46b1 Compare October 28, 2024 06:52
@MaheshGSLAB MaheshGSLAB marked this pull request as ready for review October 29, 2024 05:52
@MaheshGSLAB MaheshGSLAB requested review from a team as code owners October 29, 2024 05:52
| Threshold failure | {{ monitor_server_radius.probe.threshold_failure }} |
{% endif %}
{% if monitor_server_radius.probe.method is arista.avd.defined %}
| Probe method | {{ monitor_server_radius.probe.method }} |
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to expose username (not sure about password) in case we use method: access-request?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this file needed? There is no inventory host with such name

Copy link
Contributor

Choose a reason for hiding this comment

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

nope it should be removed

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

service dot1x
probe interval 100 seconds
probe threshold failure 100
probe method access-request username arista password 7 141600021F102B
Copy link
Contributor

Choose a reason for hiding this comment

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

please make sure this is removed from documentation by default using hide_password

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

{% if monitor_server_radius.probe.access_request.username is arista.avd.defined and
monitor_server_radius.probe.access_request.password is arista.avd.defined %}
{% set access_request = monitor_server_radius.probe.access_request %}
probe method access-request username {{ access_request.username }} password {{ access_request.password_type | arista.avd.default("7") }} {{ access_request.password }}
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
probe method access-request username {{ access_request.username }} password {{ access_request.password_type | arista.avd.default("7") }} {{ access_request.password }}
probe method access-request username {{ access_request.username }} password {{ access_request.password_type | arista.avd.default("7") }} {{ access_request.password | arista.avd.hide_passwords(hide_passwords }}

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

nope it should be removed

required: true
password:
type: str
description: Type 7 password.
Copy link
Contributor

Choose a reason for hiding this comment

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

It is not a type-7 password if you select something else in password_type. Please look in other data models for inspiration for a better description.

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 the description.

keys:
interval:
type: int
description: Server probe period in seconds.
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
description: Server probe period in seconds.
description: Server probe interval in seconds.

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.

@@ -647,6 +647,12 @@ roles/eos_cli_config_gen/docs/tables/management-api-gnmi.md
roles/eos_cli_config_gen/docs/tables/monitor-connectivity.md
--8<--

### Monitor Server Radius
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
### Monitor Server Radius
### Monitor server Radius

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

please refactor the tests to add to host-1 and host-2 instead.

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.

Copy link

sonarcloud bot commented Nov 6, 2024

@github-actions github-actions bot added the state: conflict PR with conflict label Nov 6, 2024
Copy link

github-actions bot commented Nov 6, 2024

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

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: conflict PR with conflict 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 "monitor server radius"
5 participants