From d3adf09bdec4402d80042b7ccd3f4c34852f2e63 Mon Sep 17 00:00:00 2001 From: Kevin Schuck Date: Mon, 17 Sep 2018 15:22:28 -0500 Subject: [PATCH 1/2] Fixes BGPPeer resource for calico >= 3.0.0 --- roles/network_plugin/calico/tasks/install.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/roles/network_plugin/calico/tasks/install.yml b/roles/network_plugin/calico/tasks/install.yml index f2d41f9fc..86a304a4f 100644 --- a/roles/network_plugin/calico/tasks/install.yml +++ b/roles/network_plugin/calico/tasks/install.yml @@ -163,14 +163,13 @@ shell: > echo '{ "apiVersion": "projectcalico.org/v3", - "kind": "bgpPeer", + "kind": "BGPPeer", "metadata": { "name": "{{ inventory_hostname }}-bgp" }, "spec": { "asNumber": "{{ item.as }}", "node": "{{ inventory_hostname }}", - "scope": "node", "peerIP": "{{ item.router_id }}" }}' | {{ bin_dir }}/calicoctl create --skip-exists -f - retries: 4 @@ -203,13 +202,12 @@ shell: > echo '{ "apiVersion": "projectcalico.org/v3", - "kind": "bgpPeer", + "kind": "BGPPeer", "metadata": { "name": "{{ inventory_hostname }}" }, "spec": { "asNumber": "{{ local_as | default(global_as_num)}}", - "scope": "node", "node": "{{ inventory_hostname }}", "peerIP": "{{ hostvars[item]["calico_rr_ip"]|default(hostvars[item]["ip"])|default(hostvars[item]["ansible_default_ipv4"]["address"]) }}" }}' | {{ bin_dir }}/calicoctl create --skip-exists -f - From fb1678d42532a42e0e32128246b8ed7331adef15 Mon Sep 17 00:00:00 2001 From: Kevin Schuck Date: Tue, 18 Sep 2018 10:48:30 -0500 Subject: [PATCH 2/2] Ensures BGPPeer resource names are unique --- roles/network_plugin/calico/tasks/install.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/network_plugin/calico/tasks/install.yml b/roles/network_plugin/calico/tasks/install.yml index 86a304a4f..5cce41388 100644 --- a/roles/network_plugin/calico/tasks/install.yml +++ b/roles/network_plugin/calico/tasks/install.yml @@ -165,7 +165,7 @@ "apiVersion": "projectcalico.org/v3", "kind": "BGPPeer", "metadata": { - "name": "{{ inventory_hostname }}-bgp" + "name": "{{ inventory_hostname }}-{{ item.router_id }}" }, "spec": { "asNumber": "{{ item.as }}", @@ -204,7 +204,7 @@ "apiVersion": "projectcalico.org/v3", "kind": "BGPPeer", "metadata": { - "name": "{{ inventory_hostname }}" + "name": "{{ inventory_hostname }}-{{ hostvars[item]["calico_rr_ip"]|default(hostvars[item]["ip"])|default(hostvars[item]["ansible_default_ipv4"]["address"]) }}" }, "spec": { "asNumber": "{{ local_as | default(global_as_num)}}",