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 eos_cli key to management_interfaces #2379

Merged
merged 4 commits into from Jan 9, 2023

Conversation

gusmb
Copy link
Contributor

@gusmb gusmb commented Jan 5, 2023

Change Summary

Add support for eos_cli key on the management_interfaces data model

Related Issue(s)

Fixes #2376

Component(s) name

arista.avd.eos_cli_config_gen

Proposed changes

Add new eos_cli key that render random EOS CLI commands on the management interface configuration

{# eos - management interfaces #}
{% for management_interface in management_interfaces | arista.avd.natural_sort('name') %}
!
interface {{ management_interface.name }}
{%     if management_interface.description is arista.avd.defined %}
   description {{ management_interface.description }}
{%     endif %}
{%     if management_interface.shutdown is arista.avd.defined(true) %}
   shutdown
{%     elif management_interface.shutdown is arista.avd.defined(false) %}
   no shutdown
{%     endif %}
{%     if management_interface.mtu is arista.avd.defined %}
   mtu {{ management_interface.mtu }}
{%     endif %}
{%     if management_interface.mac_address is arista.avd.defined %}
   mac-address {{ management_interface.mac_address }}
{%     endif %}
{%     if management_interface.vrf is arista.avd.defined and management_interface.vrf != 'default' %}
   vrf {{ management_interface.vrf }}
{%     endif %}
{%     if management_interface.ip_address is arista.avd.defined %}
   ip address {{ management_interface.ip_address }}
{%     endif %}
{%     if management_interface.ipv6_enable is arista.avd.defined(true) %}
   ipv6 enable
{%     endif %}
{%     if management_interface.ipv6_address is arista.avd.defined %}
   ipv6 address {{ management_interface.ipv6_address }}
{%     endif %}
{%     if management_interface.eos_cli is arista.avd.defined %}
   {{ management_interface.eos_cli | indent(3, false) }}
{%     endif %}
{% endfor %}

How to test

molecule tests

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)

@gusmb gusmb requested a review from a team as a code owner January 5, 2023 16:07
@github-actions github-actions bot added role: eos_cli_config_gen issue related to eos_cli_config_gen role state: Documentation role Updated labels Jan 5, 2023
@ClausHolbechArista ClausHolbechArista requested a review from a team January 6, 2023 06:48
Copy link
Contributor

@gmuloc gmuloc left a comment

Choose a reason for hiding this comment

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

Thanks for the PR,

Could you please add some test in molecule scenario eos_cli_config_gen for the new key?
No need to do it for the 4.0 scenario.

Let us know if you need some more guidance!

@github-actions github-actions bot added the state: CI Updated CI scenario have been updated in the PR label Jan 6, 2023
@gusmb
Copy link
Contributor Author

gusmb commented Jan 6, 2023

Thanks for the PR,

Could you please add some test in molecule scenario eos_cli_config_gen for the new key? No need to do it for the 4.0 scenario.

Let us know if you need some more guidance!

Added a test as requested

Copy link
Contributor

@gmuloc gmuloc left a comment

Choose a reason for hiding this comment

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

LGTM - Thanks!

@gmuloc gmuloc merged commit 4d51162 into aristanetworks:devel Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn: Feat(eos_cli_config_gen) 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.

Add support for eos_cli key on mgmt-interface.j2
3 participants