From 3fb9101e40ee24fc375a9611d074203581e1815d Mon Sep 17 00:00:00 2001
From: Smaine Kahlouch <smaine.kahlouch@arkena.com>
Date: Mon, 2 Nov 2015 13:41:03 +0100
Subject: [PATCH] default value for 'peer_with_router'

---
 roles/network_plugin/tasks/calico.yml                        | 4 ++--
 roles/network_plugin/templates/calico/calico-node.service.j2 | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/roles/network_plugin/tasks/calico.yml b/roles/network_plugin/tasks/calico.yml
index 65e6ba290..aefc3c80f 100644
--- a/roles/network_plugin/tasks/calico.yml
+++ b/roles/network_plugin/tasks/calico.yml
@@ -38,9 +38,9 @@
 
 - name: Calico | Disable node mesh
   shell: calicoctl bgp node-mesh off
-  when: peer_with_router is defined and peer_with_router and inventory_hostname in groups['kube-node']
+  when: peer_with_router|default(false) and inventory_hostname in groups['kube-node']
 
 - name: Calico | Configure peering with router(s)
   shell: calicoctl node bgp peer add {{ item.router_id }} as {{ item.as }}
   with_items: peers
-  when: peer_with_router and inventory_hostname in groups['kube-node']
+  when: peer_with_router|default(false) and inventory_hostname in groups['kube-node']
diff --git a/roles/network_plugin/templates/calico/calico-node.service.j2 b/roles/network_plugin/templates/calico/calico-node.service.j2
index fe44d0f5e..dc03d5213 100644
--- a/roles/network_plugin/templates/calico/calico-node.service.j2
+++ b/roles/network_plugin/templates/calico/calico-node.service.j2
@@ -8,7 +8,7 @@ User=root
 PermissionsStartOnly=true
 ExecStartPre={{ bin_dir }}/calicoctl checksystem --fix
 {% if inventory_hostname in groups['kube-node'] %}
-{%    if peer_with_router %}
+{%    if peer_with_router|default(false) %}
 ExecStart={{ bin_dir }}/calicoctl node --ip=${DEFAULT_IPV4} --as={{ local_as }} --kubernetes
 {%     else %}
 ExecStart={{ bin_dir }}/calicoctl node --ip=${DEFAULT_IPV4} --kubernetes
-- 
GitLab