File tree Expand file tree Collapse file tree 5 files changed +31
-15
lines changed
ansible/templates/routing/iosxr Expand file tree Collapse file tree 5 files changed +31
-15
lines changed Original file line number Diff line number Diff line change 1+ {% set ckw = {
2+ 'standard' : 'community' ,
3+ 'large' : 'large-community' }
4+ %}
15{% for cl_name ,cl_data in routing .community |dictsort %}
26!
3- community -set {{ cl_name }}
7+ {{ ckw[cl_data.typ e] }} -set {{ cl_name }}
48{% for p_entry in cl_data .value %}
59{% if p_entry .regexp |default (False ) %}
610 ios-regex '{{ p_entry._value }}'{% if not loop .last %} ,{% endif +%}
Original file line number Diff line number Diff line change 1+ {#
2+ Delete communities -- implemented with a loop to deal with various community types
3+ #}
4+ {% set ckw = {
5+ 'standard' : 'community' ,
6+ 'large' : 'large-community' }
7+ %}
8+ {% for c_kw ,c_value in p_entry .delete .community |default ({})|dictsort %}
9+ {% if c_kw in ['standard' ,'large' ] %}
10+ delete {{ ckw[c_kw] }} in ({{ c_value|join(",") }})
11+ {% elif c_kw == 'list' %}
12+ {% for l_kw ,l_value in c_value |dictsort if l_kw in ckw %}
13+ delete {{ ckw[l_kw] }} in {{ l_value }}
14+ {% endfor %}
15+ {% endif %}
16+ {% endfor %}
Original file line number Diff line number Diff line change 1+ {% set ckw = {
2+ 'standard' : 'community' ,
3+ 'large' : 'large-community' }
4+ %}
15{% for match_kw ,match_value in p_entry .match |default ({})|dictsort %}
26{% if loop .first %} if{% else %} and{% endif %}
37{% if match_kw == 'prefix'
1014 %} not as-path in {{ match_value.deny }} and as-path in {{ match_value.permit }}{% endif %}
1115{% if match_kw == 'community' %}{%
1216 for c_type ,c_list in match_value .items ()
13- %} community matches-any {{ c_list }}{%
17+ %} {{ ckw[c_typ e] }} matches-any {{ c_list }}{%
1418 endfor %}{%
1519 endif %}
1620{% if match_kw == '_xr_community' %}{%
1721 for c_type ,c_list in match_value .items ()
18- %} not community matches-any {{ c_list.deny }} and community matches-any {{ c_list.permit }}{%
22+ %} not {{ ckw[c_typ e] }} matches-any {{ c_list.deny }} and {{ ckw[c_typ e] }} matches-any {{ c_list.permit }}{%
1923 endfor %}{%
2024 endif %}
2125{% if loop .last %} then{% endif +%}
Original file line number Diff line number Diff line change @@ -6,16 +6,7 @@ route-policy {{ pname }}
66#}
77{% include 'iosxr/policy-match.j2' %}
88{% include 'iosxr/policy-set.j2' %}
9- {#
10- Delete communities -- implemented with a loop to deal with various community types
11- #}
12- {% for c_kw ,c_value in p_entry .delete .community |default ({})|dictsort %}
13- {% if c_kw == 'standard' %}
14- delete community in ({{ c_value|join(",") }})
15- {% elif c_kw == 'large' %}
16- delete large-community in ({{ c_value|join(",") }})
17- {% endif %}
18- {% endfor %}
9+ {% include 'iosxr/policy-delete.j2' %}
1910{#
2011 Process action
2112#}
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ features:
6767 aspath : True
6868 community :
6969 standard : True
70- # large: True
70+ large : True
7171 policy :
7272 set :
7373 community :
@@ -82,12 +82,13 @@ features:
8282 community :
8383 standard : True
8484 large : True
85+ list : True
8586 match :
8687 prefix : True
8788 aspath : True
8889 community :
8990 standard : True
90- # large: True
91+ large : True
9192 prefix : True
9293 static :
9394 vrf : True
You can’t perform that action at this time.
0 commit comments