From 0ab5a9e727f0b99fc5121caf387136e960d8c3bb Mon Sep 17 00:00:00 2001 From: Ryan Nobrega Date: Mon, 18 Mar 2019 15:24:49 -0400 Subject: [PATCH] simplified add template --- template/set-flow-route.conf | 55 +++--------------------------------- 1 file changed, 4 insertions(+), 51 deletions(-) diff --git a/template/set-flow-route.conf b/template/set-flow-route.conf index daa135c..faaa760 100644 --- a/template/set-flow-route.conf +++ b/template/set-flow-route.conf @@ -1,6 +1,7 @@ -{%- if vrf == 'trcps' %} +{%- if vrf is defined %} routing-instances { - trcps { + {{vrf}} { +{%- endif %} routing-options { flow { route {{ flowRouteName }} { @@ -46,55 +47,7 @@ routing-instances { {{action}}; } } - } -} -{%- endif %} -{%- if vrf == 're' %} -routing-options { - flow { - route {{ flowRouteName }} { - match { - {%- if dstPrefix is defined and dstPrefix !=None %} - destination {{dstPrefix}}; - {%- endif %} - {%- if dstPort is defined and dstPort !=None %} - destination-port {{ dstPort }}; - {%- endif %} - {%- if dscp is defined and dscp !=None %} - dscp {{dscp}}; - {%- endif %} - {%- if fragment is defined and fragment !=None %} - fragment {{fragment}}; - {%- endif %} - {%- if icmp_code is defined and icmp_code !=None %} - icmp-code {{icmp_code}}; - {%- endif %} - {%- if icmp_type is defined and icmp_type !=None %} - icmp-type {{icmp_type}}; - {%- endif %} - {%- if packet_length is defined and packet_length !=None %} - packet-length {{packet_length}}; - {%- endif %} - {%- if port is defined and port !=None %} - port {{port}}; - {%- endif %} - {%- if protocol is defined and protocol !=None %} - protocol {{protocol}}; - {%- endif %} - {%- if srcPrefix is defined and srcPrefix !=None %} - source {{srcPrefix}}; - {%- endif %} - {%- if srcPort is defined and srcPortt !=None %} - source-port {{srcPort}}; - {%- endif %} - {%- if tcp_flags is defined and tcp_flags !=None %} - tcp-flags {{tcp_flags}}; - {%- endif %} - } - then { - {{action}}; - } - } +{%- if vrf is defined %} } } {%- endif %}