Merge changes from topic "OOM-2112"

* changes:
  Make cicdansible to set external ip
  Use external_ip to populate the node address
  Add external_ip variable
diff --git a/ansible/inventory/hosts.yml b/ansible/inventory/hosts.yml
index 4a6b68c..825ee3b 100644
--- a/ansible/inventory/hosts.yml
+++ b/ansible/inventory/hosts.yml
@@ -33,6 +33,10 @@
               ansible_host: 10.8.8.19
               #ip of the node that it uses for communication with k8s cluster.
               cluster_ip: 10.8.8.19
+              # External ip of the node, used for access from outside of the cluster.
+              # Can be set to some kind of floating or public ip.
+              # If not set, cluster_ip is used for this purpose.
+              # external_ip: x.x.x.x
 
         # Group of hosts containing etcd cluster nodes.
         # Defaults to infra.
@@ -44,7 +48,7 @@
         # This means they host kubernetes api server, controller manager and scheduler.
         # This example uses infra for this purpose, however note that any
         # other host could be used including kubernetes nodes.
-        # cluster_ip needs to be set for hosts used as control planes.
+        # cluster_ip needs to be set for hosts used as control planes, external_ip can also be used.
         kubernetes-control-plane:
           hosts:
             infrastructure-server
diff --git a/ansible/roles/rke/templates/cluster.yml.j2 b/ansible/roles/rke/templates/cluster.yml.j2
index 737d306..51f4e28 100644
--- a/ansible/roles/rke/templates/cluster.yml.j2
+++ b/ansible/roles/rke/templates/cluster.yml.j2
@@ -1,6 +1,6 @@
 nodes:
 {% for node in groups['kubernetes'] %}
-- address: "{{ hostvars[node].cluster_ip }}"
+- address: "{{ hostvars[node].external_ip | default(hostvars[node].cluster_ip) }}"
   port: "22"
   internal_address: "{{ hostvars[node].cluster_ip }}"
   role:
@@ -13,7 +13,7 @@
 {% if node in groups['kubernetes-etcd'] %}
   - etcd
 {% endif %}
-  hostname_override: ""
+  hostname_override: "{{ node }}"
   user: "{{ rke_username }}"
   docker_socket: /var/run/docker.sock
   ssh_key: ""
diff --git a/tools/cicdansible/roles/install/templates/inventory.yml.j2 b/tools/cicdansible/roles/install/templates/inventory.yml.j2
index 36bf3bd..c828ca0 100644
--- a/tools/cicdansible/roles/install/templates/inventory.yml.j2
+++ b/tools/cicdansible/roles/install/templates/inventory.yml.j2
@@ -16,6 +16,7 @@
         infra_host:
           ansible_host: infra
           cluster_ip: {{ hostvars['infra'].ansible_default_ipv4.address }}
+          external_ip: "{{ hostvars['infra'].ansible_host }}"
     kubernetes:
       children:
         kubernetes-node:
@@ -24,6 +25,9 @@
             {{ h }}:
               ansible_host: "{{ hostvars[h].ansible_default_ipv4.address }}"
               cluster_ip: "{{ hostvars[h].ansible_default_ipv4.address }}"
+{% if h == 'node0' %}
+              external_ip: "{{ hostvars[h].first_node_ip }}"
+{% endif %}
 {% endfor %}
         kubernetes-control-plane:
           hosts: