From 61f5526945cd2f36b6e5c8a1f9eeba664a1a58d4 Mon Sep 17 00:00:00 2001 From: Logan V Date: Thu, 8 Dec 2016 15:31:18 -0600 Subject: [PATCH] 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 --- .../inventory/group_vars/neutron_calico_dhcp_agent.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/playbooks/inventory/group_vars/neutron_calico_dhcp_agent.yml b/playbooks/inventory/group_vars/neutron_calico_dhcp_agent.yml index afe3c207e4..48fa6ff2ad 100644 --- a/playbooks/inventory/group_vars/neutron_calico_dhcp_agent.yml +++ b/playbooks/inventory/group_vars/neutron_calico_dhcp_agent.yml @@ -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: |