From aaa0105f75287ec9fb2500901c09fd1cad71046d Mon Sep 17 00:00:00 2001
From: Brad Beam <brad.beam@b-rad.info>
Date: Thu, 7 Sep 2017 22:19:46 +0000
Subject: [PATCH] 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",
-- 
GitLab