Fix default IPv6 BGP peer for BIRD

The jinja calculation of the BIRD BGP peer was failing intermittently
when IPv6 connectivity was not present.

Even though the IPv6 deployment was being detected correctly as
disabled by the role, the configuration task was failing to skip
consistently because the IPv6 peer address var could not be
resolved by Jinja.

This fixes the default IPv6 peer calculation to resolve to an empty
string when no IPv6 connectivity is present, which allows the
automatic IPv6 detection to skip the config task.

Change-Id: If450b237ba349a163f44f40b945c98b14c9d7042
This commit is contained in:
Logan V 2016-12-08 15:31:18 -06:00
parent 2e1c6a4dce
commit 61f5526945

View File

@ -30,7 +30,15 @@ bird_bgp_asn: 65000
bird_bgp_ipv4_peer_ip: "{{ ansible_default_ipv4['gateway'] }}"
#calculate the first address in the subnet since the IPv6 "gateway" may be a
#link local address that we cannot peer to.
bird_bgp_ipv6_peer_ip: "{{ ((ansible_default_ipv6['address'] ~ '/' ~ ansible_default_ipv6['prefix']) | ipaddr('network') ~ '/' ~ ansible_default_ipv6['prefix']) | ipaddr('net') | ipaddr(1) | ipaddr('address') }}"
bird_bgp_ipv6_peer_ip: >-
{% if ansible_default_ipv6['address'] is defined
and ansible_default_ipv6['prefix'] is defined %}
{{
((ansible_default_ipv6['address'] ~ '/' ~ ansible_default_ipv6['prefix']) |
ipaddr('network') ~ '/' ~ ansible_default_ipv6['prefix']
) | ipaddr('net') | ipaddr(1) | ipaddr('address')
}}
{% endif %}
bird_ipv4_protocols:
kernel: |