From 476b14b06e6a3d6796c6021939c03acb870d3f0d Mon Sep 17 00:00:00 2001 From: Daniel Mohr Date: Mon, 14 May 2018 14:13:51 +0200 Subject: [PATCH] Make Calico nodename overridable on bare metal Signed-off-by: Daniel Mohr --- roles/network_plugin/calico/defaults/main.yml | 2 ++ roles/network_plugin/calico/templates/cni-calico.conflist.j2 | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/network_plugin/calico/defaults/main.yml b/roles/network_plugin/calico/defaults/main.yml index 857ebd11a..553eb6753 100644 --- a/roles/network_plugin/calico/defaults/main.yml +++ b/roles/network_plugin/calico/defaults/main.yml @@ -51,3 +51,5 @@ rbac_resources: # * interface=INTERFACE-REGEX # see https://docs.projectcalico.org/v3.0/reference/node/configuration#ip-autodetection-methods # calico_ip_auto_method: "interface=eth.*" + +calico_baremetal_nodename: "{{ inventory_hostname }}" diff --git a/roles/network_plugin/calico/templates/cni-calico.conflist.j2 b/roles/network_plugin/calico/templates/cni-calico.conflist.j2 index 6dd51e912..443e3b43b 100644 --- a/roles/network_plugin/calico/templates/cni-calico.conflist.j2 +++ b/roles/network_plugin/calico/templates/cni-calico.conflist.j2 @@ -6,7 +6,7 @@ {% if cloud_provider is defined %} "nodename": "{{ calico_kubelet_name.stdout }}", {% else %} - "nodename": "{{ inventory_hostname }}", + "nodename": "{{ calico_baremetal_nodename }}", {% endif %} "type": "calico", "etcd_endpoints": "{{ etcd_access_addresses }}",