Skip to content

Commit

Permalink
Fixed inlcuded template not found issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhenhong Zhao committed Jan 15, 2021
1 parent 3b49d23 commit ee973b5
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 24 deletions.
6 changes: 3 additions & 3 deletions dockers/docker-fpm-frr/docker_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ CFGGEN_PARAMS=" \
-y /etc/sonic/constants.yml \
-t /usr/share/sonic/templates/frr_vars.j2 \
-t /usr/share/sonic/templates/supervisord/supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf \
-t /usr/share/sonic/templates/gen_bgpd.conf.j2,/etc/frr/bgpd.conf \
-t /usr/share/sonic/templates/bgpd/gen_bgpd.conf.j2,/etc/frr/bgpd.conf \
-t /usr/share/sonic/templates/supervisord/critical_processes.j2,/etc/supervisor/critical_processes \
-t /usr/share/sonic/templates/zebra/zebra.conf.j2,/etc/frr/zebra.conf \
-t /usr/share/sonic/templates/gen_staticd.conf.j2,/etc/frr/staticd.conf \
-t /usr/share/sonic/templates/frr.conf.j2,/etc/frr/frr.conf \
-t /usr/share/sonic/templates/staticd/gen_staticd.conf.j2,/etc/frr/staticd.conf \
-t /usr/share/sonic/templates/gen_frr.conf.j2,/etc/frr/frr.conf \
-t /usr/share/sonic/templates/isolate.j2,/usr/sbin/bgp-isolate \
-t /usr/share/sonic/templates/unisolate.j2,/usr/sbin/bgp-unisolate \
-t /usr/local/sonic/frr/bfdd.conf.j2,/etc/frr/bfdd.conf \
Expand Down
File renamed without changes.
18 changes: 0 additions & 18 deletions dockers/docker-fpm-frr/frr/frr.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,9 @@ agentx
!
{% include "zebra/zebra.interfaces.conf.j2" %}
!
{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %}
{% if MGMT_VRF_CONFIG %}
{% if MGMT_VRF_CONFIG['vrf_global']['mgmtVrfEnabled'] == 'false' %}
{% include "staticd.default_route.conf.j2" %}
{% endif %}
{% else %}
{% include "staticd.default_route.conf.j2" %}
{% endif %}
!
{% include "staticd.db.conf.j2" %}
!
{% include "bgpd.conf.db.j2" %}
!
{% include "ospfd.conf.j2" %}
!
{% include "bfdd.conf.j2" %}
{% else %}
{% include "staticd/staticd.default_route.conf.j2" %}
!
{% include "staticd/staticd.loopback_route.conf.j2" %}
!
{% include "bgpd/bgpd.main.conf.j2" %}
{% endif %}
!
5 changes: 5 additions & 0 deletions dockers/docker-fpm-frr/frr/gen_frr.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %}
{% include "/usr/local/sonic/frr/frr.conf.j2" %}
{% else %}
{% include "/usr/share/sonic/templates/frr.conf.j2" %}
{% endif %}
4 changes: 3 additions & 1 deletion src/sonic-frr-mgmt-framework/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
'templates/ospfd/ospfd.conf.db.policyrange.j2',
'templates/ospfd/ospfd.conf.db.vlink.j2',
'templates/staticd/staticd.conf.j2',
'templates/staticd/staticd.db.conf.j2'])
'templates/staticd/staticd.db.conf.j2',
'templates/staticd/staticd.db.default_route.conf.j2',
'templates/frr/frr.conf.j2'])
]
)
30 changes: 30 additions & 0 deletions src/sonic-frr-mgmt-framework/templates/frr/frr.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
!
{% block banner %}
! =========== Managed by sonic-cfggen DO NOT edit manually! ====================
! generated by templates/frr.conf.j2 with config DB data
! file: frr.conf
!
{% endblock banner %}
!
{% include "common/daemons.common.conf.j2" %}
!
agentx
!
{% include "zebra/zebra.interfaces.conf.j2" %}
!
{% if MGMT_VRF_CONFIG %}
{% if MGMT_VRF_CONFIG['vrf_global']['mgmtVrfEnabled'] == 'false' %}
{% include "staticd.db.default_route.conf.j2" %}
{% endif %}
{% else %}
{% include "staticd.db.default_route.conf.j2" %}
{% endif %}
!
{% include "staticd.db.conf.j2" %}
!
{% include "bgpd.conf.db.j2" %}
!
{% include "ospfd.conf.j2" %}
!
{% include "bfdd.conf.j2" %}
!
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
!
{% if MGMT_VRF_CONFIG %}
{% if MGMT_VRF_CONFIG['vrf_global']['mgmtVrfEnabled'] == 'false' %}
{% include "staticd.default_route.conf.j2" %}
{% include "staticd.db.default_route.conf.j2" %}
{% endif %}
{% else %}
{% include "staticd.default_route.conf.j2" %}
{% include "staticd.db.default_route.conf.j2" %}
{% endif %}
!
{% include "staticd.db.conf.j2" %}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
!
{% block default_route %}
! set static default route to mgmt gateway as a backup to learned default
{% if MGMT_INTERFACE %}
{% for (name, prefix) in MGMT_INTERFACE|pfx_filter %}
{% endfor %}
{% endif %}
{% endblock default_route %}
!

0 comments on commit ee973b5

Please sign in to comment.