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 filter feature in default section for l2leaf and l3leaf devices #559

Merged
merged 3 commits into from
Dec 30, 2020
Merged

Add filter feature in default section for l2leaf and l3leaf devices #559

merged 3 commits into from
Dec 30, 2020

Conversation

ksator
Copy link
Contributor

@ksator ksator commented Dec 29, 2020

Change Summary

Add filter (tags and tenants) in default section for l2leaf and l3leaf devices.
These filters already exist in l2leaf and l3leaf nodes_groups.
They were missing in default section.

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): role enhancement

Related Issue(s)

#469

Component(s) name

role: eos_l3ls_evpn

Templates:

  • eos_l3ls_evpn/templates/evpn-fabric-l3leaf-yml.j2
  • eos_l3ls_evpn/templates/evpn-fabric-l2leaf-yml.j2

Proposed changes

in roles/eos_l3ls_evpn/templates/evpn-fabric-l3leaf-yml.j2

replaced

{%             if l3leaf.node_groups[l3leaf_node_group].filter.tenants is defined %}
{%                 set leaf.filter_tenants = l3leaf.node_groups[l3leaf_node_group].filter.tenants %}
{%             else %}
{%                 set leaf.filter_tenants = [ 'all' ] %}
{%             endif %}

with

{%             if l3leaf.node_groups[l3leaf_node_group].filter.tenants is defined %}
{%                 set leaf.filter_tenants = l3leaf.node_groups[l3leaf_node_group].filter.tenants %}
{%             elif l3leaf.defaults.filter.tenants is defined %}
{%                 set leaf.filter_tenants = l3leaf.defaults.filter.tenants %}
{%             else %}
{%                 set leaf.filter_tenants = [ 'all' ] %}
{%             endif %}

and replaced

{%             if l3leaf.node_groups[l3leaf_node_group].filter.tags is defined %}
{%                 set leaf.filter_tags = l3leaf.node_groups[l3leaf_node_group].filter.tags %}
{%             else %}
{%                 set leaf.filter_tags = [ 'all' ] %}
{%             endif %}

with

{%             if l3leaf.node_groups[l3leaf_node_group].filter.tags is defined %}
{%                 set leaf.filter_tags = l3leaf.node_groups[l3leaf_node_group].filter.tags %}
{%             elif l3leaf.defaults.filter.tags is defined %}
{%                 set leaf.filter_tags = l3leaf.defaults.filter.tags %}
{%             else %}
{%                 set leaf.filter_tags = [ 'all' ] %}
{%             endif %}

and same thing for evpn-fabric-l2leaf-yml.j2

  • updated molecule

How to test

run the role eos_l3ls_evpn with

      filter:
        tenants: [ a list ]
        tags: [ a list ]

at diff levels (l3leaf/defaults, l3leaf/node_groups/group, l2leaf/defaults, l2leaf/node_groups/group).

Example:

l3leaf:
  defaults:
    virtual_router_mac_address: 00:1c:73:00:dc:01
    platform: vEOS-LAB
    filter:
      tenants: [ Tenant_A, Tenant_D ]
      tags: [ web, app, vm, nfs, erp, db, vmotion ]
    spines: [DC1-SPINE1, DC1-SPINE2]
    uplink_to_spine_interfaces: [Ethernet1, Ethernet2]
    mlag_interfaces: [Ethernet7, Ethernet8]
  node_groups:
    DC1_LEAF1:
      mlag: true
      bgp_as: 65101
      filter:
        tenants: [ Tenant_A, Tenant_D ]
        tags: [ web, app, vm, nfs, erp ]
      nodes:
        DC1-LEAF1A:
          id: 1
          mgmt_ip: 10.73.1.105/24
          spine_interfaces: [Ethernet1, Ethernet1]
        DC1-LEAF1B:
          id: 2
          mgmt_ip: 10.73.1.106/24
          spine_interfaces: [Ethernet2, Ethernet2]
    DC1_LEAF2:
      bgp_as: 65102
      nodes:
        DC1-LEAF2A:
          id: 3
          mgmt_ip: 10.73.1.107/24
          spine_interfaces: [Ethernet4, Ethernet4]
        DC1-LEAF2B:
          id: 4
          mgmt_ip: 10.73.1.108/24
          spine_interfaces: [Ethernet5, Ethernet5]
l2leaf:
  defaults:
    filter:
      tenants: [ Tenant_A ]
      tags: [ app, vm ]
    platform: vEOS-LAB
    parent_l3leafs: [ DC1-LEAF1A, DC1-LEAF1B ]
    uplink_interfaces: [ Ethernet1, Ethernet2 ]
    mlag_interfaces: [ Ethernet7, Ethernet8 ]
    spanning_tree_mode: mstp
    spanning_tree_priority: 16384
  node_groups:
    DC1_L2LEAF:
      parent_l3leafs: [ DC1-LEAF1A, DC1-LEAF1B ]
      nodes:
        DC1-L2LEAF1A:
          id: 5
          mgmt_ip: 10.73.1.117/24
          l3leaf_interfaces: [ Ethernet3, Ethernet3 ]
        DC1-L2LEAF2A:
          id: 7
          mgmt_ip: 10.73.1.118/24
          l3leaf_interfaces: [ Ethernet4, Ethernet4 ]

Checklist:

  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed (pre-commit, make linting and make sanity-lint).
  • I have updated molecule CI testing accordingly

@ksator ksator added the role: eos_l3ls_evpn issue related to eos_l3ls_evpn role label Dec 29, 2020
@ksator ksator self-assigned this Dec 29, 2020
@ksator ksator requested a review from titom73 December 29, 2020 16:58
@github-actions github-actions bot added the state: CI Updated CI scenario have been updated in the PR label Dec 29, 2020
@ksator ksator linked an issue Dec 29, 2020 that may be closed by this pull request
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

@titom73 titom73 changed the title Add filter (tags and tenants) in default section for l2leaf and l3leaf devices Add filter feature in default section for l2leaf and l3leaf devices Dec 30, 2020
@titom73 titom73 added this to the v1.2.0 milestone Dec 30, 2020
@titom73 titom73 merged commit 9daad6b into aristanetworks:devel Dec 30, 2020
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.

Add filter supported by default section in l2leaf and l3leaf devices.
2 participants