From 4f12ba00d15ddb044d9e2b27e25426c229e0374b Mon Sep 17 00:00:00 2001 From: Erwan Miran Date: Wed, 24 Oct 2018 07:19:50 +0200 Subject: [PATCH] Fix calico peering with router(s) (#3547) --- roles/network_plugin/calico/tasks/install.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/network_plugin/calico/tasks/install.yml b/roles/network_plugin/calico/tasks/install.yml index 123733016..9de50c05d 100644 --- a/roles/network_plugin/calico/tasks/install.yml +++ b/roles/network_plugin/calico/tasks/install.yml @@ -221,7 +221,7 @@ retries: 4 delay: "{{ retry_stagger | random + 3 }}" with_items: - - "{{ peers|rejectattr('scope','equalto', 'global')|default([]) }}" + - "{{ peers|selectattr('scope','undefined')|list|default([]) | union(peers|selectattr('scope','defined')|selectattr('scope','equalto', 'node')|list|default([])) }}" when: - calico_version is version('v3.0.0', '>=') - peer_with_router|default(false) @@ -238,7 +238,7 @@ | {{ bin_dir }}/calicoctl create --skip-exists -f - retries: 4 delay: "{{ retry_stagger | random + 3 }}" - with_items: "{{ peers|rejectattr('scope','equalto', 'global')|default([]) }}" + with_items: "{{ peers|selectattr('scope','undefined')|list|default([]) | union(peers|selectattr('scope','defined')|selectattr('scope','equalto', 'node')|list|default([])) }}" when: - calico_version | version_compare('v3.0.0', '<') - peer_with_router|default(false) @@ -259,7 +259,7 @@ retries: 4 delay: "{{ retry_stagger | random + 3 }}" with_items: - - "{{ peers|selectattr('scope','equalto', 'global')|default([]) }}" + - "{{ peers|selectattr('scope','defined')|selectattr('scope','equalto', 'global')|list|default([]) }}" run_once: true when: - calico_version | version_compare('v3.0.0', '>=') @@ -277,7 +277,7 @@ | {{ bin_dir }}/calicoctl create --skip-exists -f - retries: 4 delay: "{{ retry_stagger | random + 3 }}" - with_items: "{{ peers|selectattr('scope','equalto', 'global')|default([]) }}" + with_items: "{{ peers|selectattr('scope','defined')|selectattr('scope','equalto', 'global')|default([]) }}" run_once: true when: - calico_version is version('v3.0.0', '<')