Skip to content

Commit

Permalink
frr: make it possible to not use ipv6 in the leaf template
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berendt <[email protected]>
  • Loading branch information
berendt committed Sep 25, 2024
1 parent 4842b79 commit d5e37ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion roles/frr/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
mode: 0640
notify: Restart frr service

- name: Install frr.conf configuration file
- name: Copy frr.conf configuration file
become: true
ansible.builtin.template:
src: "frr_{{ frr_type }}.conf.j2"
Expand Down
6 changes: 6 additions & 0 deletions roles/frr/templates/frr_leaf.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ router bgp {{ frr_local_as }}
exit-address-family
!
address-family ipv6 unicast
{% if frr_loopback_v6 and frr_loopback_v6 | length %}
redistribute connected route-map bgp_out
{% for item in frr_uplinks %}
neighbor {{ item.interface }} activate
neighbor {{ item.interface }} route-map bgp_out out
{% endfor %}
{% endif %}
exit-address-family
exit
!
Expand All @@ -37,10 +39,14 @@ route-map RM_SET_SRC4 permit 10
set src {{ frr_loopback_v4 }}
exit
!
{% if frr_loopback_v6 and frr_loopback_v6 | length %}
route-map RM_SET_SRC6 permit 10
set src {{ frr_loopback_v6 }}
exit
!
{% endif %}
ip protocol bgp route-map RM_SET_SRC4
!
{% if frr_loopback_v6 and frr_loopback_v6 | length %}
ipv6 protocol bgp route-map RM_SET_SRC6
{% endif %}

0 comments on commit d5e37ce

Please sign in to comment.