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

Add support for multiple custom_structured_configuration prefixes #646

Conversation

ClausHolbechArista
Copy link
Contributor

@ClausHolbechArista ClausHolbechArista commented Jan 21, 2021

Change Summary

Allow multi layered custom_structured_configuration and more flexible naming.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Documentation content changes
  • Other (please describe):

Related Issue(s)

Component(s) name

eos_l3ls_evpn

Proposed changes

custom_structured_configuration_prefix allows the user to customize the prefix for Custom Structured Configuration variables.
Default value is custom_structured_configuration_. Default value is custom_structured_configuration_. Remember to include any delimiter like the last _ in this case.
It is possible to specify a list of prefixes, which will all be merged one by one. The order of merge will start from beginning of the list, which means that keys defined in the later prefixes will be able to override keys defined in previous ones.

custom_structured_configuration_prefix: < variable_prefix, default -> "custom_structured_configuration_" >	custom_structured_configuration_prefix: < variable_prefix, default -> "custom_structured_configuration_" >
#or
custom_structured_configuration_prefix: [ < variable_prefix_1 > , < variable_prefix_2 > , < variable_prefix_3 > ]

Example using multiple prefixes:

custom_structured_configuration_prefix: [ my_dci_ , my_special_dci_ ]

my_special_dci_ethernet_interfaces:
  Ethernet4000:
    ip_address: 10.3.2.1/21

my_dci_ethernet_interfaces:
  Ethernet4000:
    description: My test
    ip_address: 10.1.2.3/12
    shutdown: false
    type: routed
    mtu: 1500
    peer: MY-own-peer
    peer_interface: Ethernet123
    peer_type: my_precious

In this example Ethernet4000 will be added to the ethernet_interfaces dictionary in the Structured Configuration and the ip_address will be 10.3.2.1/21 since ip_adddress was overridden on the later custom_scructured_configuration_prefix

How to test

Tested with my test repo: https://github.com/ClausHolbechArista/claus-l3ls-dev/commits/superspine-alternative
Following commits show each test scenario.
image

  • Test without custom config
  • Test with default prefix and custom config
  • Test with 1 custom prefix but no matching config
  • Test with 1 custom prefix and both matching and non-matching custom config (non-matching is just ignored)
  • Test with multiple custom prefixes. One using the default name and others using custom names. Also including overrides.

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.
  • I have updated the documentation accordingly.
  • I have updated molecule CI testing accordingly
  • All new and existing tests passed (pre-commit, make linting and make sanity-lint).

@ClausHolbechArista ClausHolbechArista marked this pull request as ready for review January 21, 2021 16:23
@github-actions github-actions bot added the state: CI Updated CI scenario have been updated in the PR label Jan 27, 2021
@titom73 titom73 added this to the v2.0.0rc1 milestone Jan 27, 2021
Copy link
Contributor

@titom73 titom73 left a comment

Choose a reason for hiding this comment

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

Looks good to me

@ClausHolbechArista ClausHolbechArista force-pushed the expand-custom-structured-configuration branch from d260347 to 1ec016f Compare January 27, 2021 18:51
@github-actions github-actions bot requested a review from titom73 January 27, 2021 19:13
@ClausHolbechArista
Copy link
Contributor Author

Rebased and refreshed CI artifacts

@ClausHolbechArista ClausHolbechArista merged commit fbec601 into aristanetworks:devel Jan 27, 2021
@ClausHolbechArista ClausHolbechArista deleted the expand-custom-structured-configuration branch July 9, 2021 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
role: eos_l3ls_evpn issue related to eos_l3ls_evpn 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.

2 participants