From aaa0105f75287ec9fb2500901c09fd1cad71046d Mon Sep 17 00:00:00 2001 From: Brad Beam Date: Thu, 7 Sep 2017 22:19:46 +0000 Subject: [PATCH 1/2] Flexing calicocni.hostname based on cloud provider --- roles/network_plugin/calico/templates/cni-calico.conf.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/network_plugin/calico/templates/cni-calico.conf.j2 b/roles/network_plugin/calico/templates/cni-calico.conf.j2 index 2b8d5b17c..973c7de53 100644 --- a/roles/network_plugin/calico/templates/cni-calico.conf.j2 +++ b/roles/network_plugin/calico/templates/cni-calico.conf.j2 @@ -1,6 +1,10 @@ { "name": "calico-k8s-network", +{% if cloud_provider is defined %} + "hostname": "{{ inventory_hostname }}", +{% else %} "hostname": "{{ ansible_hostname }}", +{% endif %} "type": "calico", "etcd_endpoints": "{{ etcd_access_endpoint }}", "etcd_cert_file": "{{ etcd_cert_dir }}/node-{{ inventory_hostname }}.pem", From eeffbbb43ca41784442e15cbb1383a7a1c516db6 Mon Sep 17 00:00:00 2001 From: Brad Beam Date: Thu, 7 Sep 2017 22:21:40 +0000 Subject: [PATCH 2/2] Updating calicocni.hostname to calicocni.nodename --- roles/network_plugin/calico/templates/cni-calico.conf.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/network_plugin/calico/templates/cni-calico.conf.j2 b/roles/network_plugin/calico/templates/cni-calico.conf.j2 index 973c7de53..f49682ea9 100644 --- a/roles/network_plugin/calico/templates/cni-calico.conf.j2 +++ b/roles/network_plugin/calico/templates/cni-calico.conf.j2 @@ -1,9 +1,9 @@ { "name": "calico-k8s-network", {% if cloud_provider is defined %} - "hostname": "{{ inventory_hostname }}", + "nodename": "{{ inventory_hostname }}", {% else %} - "hostname": "{{ ansible_hostname }}", + "nodename": "{{ ansible_hostname }}", {% endif %} "type": "calico", "etcd_endpoints": "{{ etcd_access_endpoint }}",