diff --git a/roles/network_plugin/calico/templates/calico-node.service.legacy.j2 b/roles/network_plugin/calico/templates/calico-node.service.legacy.j2 index bc6f66a9dde34420ed7ac9470f1fa2666319fa6a..f542f64f6545d4aaddc8b097910c175698d96705 100644 --- a/roles/network_plugin/calico/templates/calico-node.service.legacy.j2 +++ b/roles/network_plugin/calico/templates/calico-node.service.legacy.j2 @@ -7,7 +7,7 @@ Wants=docker.socket [Service] User=root PermissionsStartOnly=true -{% if inventory_hostname in groups['kube-node'] and peer_with_router|default(false)%} +{% if inventory_hostname in groups['k8s-cluster'] and peer_with_router|default(false)%} ExecStart={{ bin_dir }}/calicoctl node --ip={{ip | default(ansible_default_ipv4.address) }} --as={{ local_as }} --detach=false --node-image={{ calico_node_image_repo }}:{{ calico_node_image_tag }} {% else %} ExecStart={{ bin_dir }}/calicoctl node --ip={{ip | default(ansible_default_ipv4.address) }} --detach=false --node-image={{ calico_node_image_repo }}:{{ calico_node_image_tag }} diff --git a/roles/network_plugin/calico/templates/calico.env.j2 b/roles/network_plugin/calico/templates/calico.env.j2 index 47f685928714a806f1646d709a137c58b21f2be5..83cf8f2915211a2aea821992bb20849ae50d0fb7 100644 --- a/roles/network_plugin/calico/templates/calico.env.j2 +++ b/roles/network_plugin/calico/templates/calico.env.j2 @@ -7,9 +7,9 @@ CALICO_IP6="" {% if calico_network_backend is defined %} CALICO_NETWORKING_BACKEND="{{calico_network_backend }}" {% endif %} -{% if inventory_hostname in groups['kube-node'] and peer_with_router|default(false)%} +{% if inventory_hostname in groups['k8s-cluster'] and peer_with_router|default(false)%} CALICO_AS="{{ local_as }}" {% endif %} CALICO_NO_DEFAULT_POOLS="true" CALICO_LIBNETWORK_ENABLED="true" -CALICO_HOSTNAME="{{ inventory_hostname }}" +CALICO_HOSTNAME="{{ ansible_hostname }}" diff --git a/roles/network_plugin/calico/templates/cni-calico.conf.j2 b/roles/network_plugin/calico/templates/cni-calico.conf.j2 index 2834e4cba8c22aac9c813f804f61f683fc18d77c..f9427e69da0bd506edc65285dce6b7d3a113619a 100644 --- a/roles/network_plugin/calico/templates/cni-calico.conf.j2 +++ b/roles/network_plugin/calico/templates/cni-calico.conf.j2 @@ -1,7 +1,7 @@ { "name": "calico-k8s-network", {% if not legacy_calicoctl %} - "hostname": "{{ inventory_hostname }}", + "hostname": "{{ ansible_hostname }}", {% endif %} "type": "calico", "etcd_endpoints": "{{ etcd_access_endpoint }}",