From b33713da4a86f6e21a6ddf3c1866418ce5d47a68 Mon Sep 17 00:00:00 2001
From: Antoine Legrand <antoine.legrand@arkena.com>
Date: Fri, 29 Jan 2016 14:07:21 +0100
Subject: [PATCH] Change calico condition --ipip

---
 roles/network_plugin/tasks/calico.yml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/roles/network_plugin/tasks/calico.yml b/roles/network_plugin/tasks/calico.yml
index e33b31247..3c512501a 100644
--- a/roles/network_plugin/tasks/calico.yml
+++ b/roles/network_plugin/tasks/calico.yml
@@ -26,10 +26,15 @@
   register: calico_conf
   run_once: true
 
+- name: Calico | Configure calico network pool for cloud
+  command: "calicoctl pool add {{ kube_pods_subnet }} --ipip"
+  run_once: true
+  when: calico_conf.status == 404 and cloud_provider is defined and cloud_provider == True
+
 - name: Calico | Configure calico network pool
-  shell: calicoctl pool add {{ kube_pods_subnet }}  {%- if cloud_provider is defined and cloud_provider == True -%} --ipip{%- endif -%}
+  command: "calicoctl pool add {{ kube_pods_subnet }}"
   run_once: true
-  when: calico_conf.status == 404
+  when: calico_conf.status == 404 and (cloud_provider is not defined or cloud_provider != True)
 
 - name: Calico | Get calico configuration from etcd
   uri:
-- 
GitLab