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

Check if INTERFACE needs to be added to config_db in SONiC role #348

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions partition/roles/sonic/templates/metal.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ MGMT_VRF_CONFIG:
vrf_global:
mgmtVrfEnabled: "{{ sonic_mgmt_vrf | lower }}"
{% if sonic_ports_dict|length > 0 %}
{% set ports_with_vrf_exist = sonic_ports_dict.items() | map('last') | map(attribute="vrf", default="") | select('regex', '.+') | length > 0 %}
{% set ports_with_ips_exist = sonic_ports_dict.items() | map('last') | map(attribute="ips", default="") | select('regex', '.+') | length > 0 %}
{% set ports_intersect_with_bgp_ports = sonic_ports_dict.items() | map('first') | intersect(sonic_bgp_ports) | length > 0 %}
{% if ports_with_vrf_exist or ports_with_ips_exist or ports_intersect_with_bgp_ports %}

INTERFACE:
{% endif %}
{% for name, port in sonic_ports_dict.items() %}
{% if name in sonic_bgp_ports|default([]) or port.vrf is defined %}
{{ name }}:
Expand Down
Loading