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

Refactor(eos_cli_config_gen): Enhance aaa to support multiple groups where available in EOS #4666

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

Conversation

laxmikantchintakindi
Copy link
Contributor

@laxmikantchintakindi laxmikantchintakindi commented Oct 29, 2024

Change Summary

Enhance aaa to support multiple groups where available in EOS.

Related Issue(s)

Fixes #2521

Component(s) name

arista.avd.eos_cli_config_gen

Proposed changes

https://github.com/aristanetworks/ansible-avd/pull/2450/files#r1089721034

This EOS CLI is a bit confusing, and the documentation has a couple of typos which does not help :)
logging is a "method" similar to group abc, so it is not a property of a group.
For some reason EOS does not have a guard against repeating the same method multiple times, so that is why logging shows up after every group.
I do not know how the ordering of logging vs. group abc might affect the behavior, so until we know that, I would suggest that we skip expanding for now and just implement what we need (one group with group key similar to the rest of the models).
A future data model should probably be referring to methods which can then either be a group (with or without multicast) or logging.

dot1x:
  default:
    type: start-stop
    methods:
      - method: < logging | group >
        group: < group_name >   <-- Only relevant for method group
        multicast: < bool >     <-- Only relevant for method 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-4666
# Activate the virtual environment
source test-avd-pr-4666/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/laxmikantchintakindi/avd.git@refactor/dot1-aaa-auth#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/,refactor/dot1-aaa-auth --force
# Optional: Install AVD examples
cd test-avd-pr-4666
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 Oct 29, 2024
@github-actions github-actions bot added state: conflict PR with conflict labels Oct 30, 2024
Copy link

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

1 similar comment
Copy link

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

Copy link

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

Copy link

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

Copy link

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

Copy link

sonarcloud bot commented Nov 18, 2024

…nting.j2

Co-authored-by: Mahesh Kumar <122076792+MaheshGSLAB@users.noreply.github.com>
…aa_accounting.schema.yml

Co-authored-by: Mahesh Kumar <122076792+MaheshGSLAB@users.noreply.github.com>
@MaheshGSLAB MaheshGSLAB marked this pull request as ready for review November 28, 2024 10:35
@MaheshGSLAB MaheshGSLAB requested review from a team as code owners November 28, 2024 10:35
valid_values: ["logging", "group"]
group:
type: str
description: Specify the server group to be used. This option is applicable only when the `method` key is explicitly set to `group`.
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 the change.

description: |-
      Specify the server group to be used. 
      This option is applicable only when the `method` key is explicitly set to `group`.

Copy link
Contributor

Choose a reason for hiding this comment

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

for multicast as well

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.

Comment on lines 48 to 51
{% if methods_list == [] %}
{% do methods_list.append("-") %}
{% endif %}
| Dot1x - Default | - | {{ aaa_accounting.dot1x.default.type }} | {{ ", ".join(methods_list) }} | {{ logging_namespace.method_logging }} |
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
{% if methods_list == [] %}
{% do methods_list.append("-") %}
{% endif %}
| Dot1x - Default | - | {{ aaa_accounting.dot1x.default.type }} | {{ ", ".join(methods_list) }} | {{ logging_namespace.method_logging }} |
| Dot1x - Default | - | {{ aaa_accounting.dot1x.default.type }} | {{ ", ".join(methods_list | arista.avd.default(["-"])) }} | {{ logging_namespace.method_logging }} |

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.

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: Enhance aaa to support multiple groups where available in EOS
3 participants