diff --git a/roles/network_plugin/calico/templates/cni-calico.conf.j2 b/roles/network_plugin/calico/templates/cni-calico.conf.j2
index 2b8d5b17c15dbc4f7902c4c437a5412ada5561fe..973c7de53b8f994ff5b5cde38ba590f9c5997aa2 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",