Skip to content
Snippets Groups Projects
Commit 0dc5a910 authored by Ing. Klára Moravcová's avatar Ing. Klára Moravcová
Browse files

Modify inventory to use instance name.

parent 94dfc7a0
No related branches found
No related tags found
1 merge request!1Inventory modify
[all] [all]
%{ for index,ip in k8s_master_ip ~} %{ for i, name in k8s_control_name ~}
control${index+1} ansible_host=${ip} ${name} ansible_host=${element(k8s_control_ip, i)}
%{ endfor ~} %{ endfor ~}
%{ for index,ip in k8s_worker_ip ~} %{ for i, name in k8s_worker_name ~}
node${index+1} ansible_host=${ip} ${name} ansible_host=${element(k8s_worker_ip, i)}
%{ endfor ~} %{ endfor ~}
## configure a bastion host if your nodes are not directly reachable ## configure a bastion host if your nodes are not directly reachable
...@@ -12,21 +12,21 @@ node${index+1} ansible_host=${ip} ...@@ -12,21 +12,21 @@ node${index+1} ansible_host=${ip}
bastion ansible_host=${k8s_bastion_ip} ansible_user=${bastion_ssh_user_name} bastion ansible_host=${k8s_bastion_ip} ansible_user=${bastion_ssh_user_name}
[kube_control_plane] [kube_control_plane]
%{ for index,ip in k8s_master_ip ~} %{ for name in k8s_control_name ~}
control${index+1} ${name}
%{ endfor ~} %{ endfor ~}
[etcd] [etcd]
%{ for index,ip in k8s_master_ip ~} %{ for name in k8s_control_name ~}
control${index+1} ${name}
%{ endfor ~} %{ endfor ~}
[kube_node] [kube_node]
%{ for index,ip in k8s_master_ip ~} %{ for name in k8s_control_name ~}
control${index+1} ${name}
%{ endfor ~} %{ endfor ~}
%{ for index,ip in k8s_worker_ip ~} %{ for name in k8s_worker_name ~}
node${index+1} ${name}
%{ endfor ~} %{ endfor ~}
[calico_rr] [calico_rr]
......
...@@ -3,7 +3,9 @@ resource "local_file" "k8s_file" { ...@@ -3,7 +3,9 @@ resource "local_file" "k8s_file" {
{ {
bastion_ssh_user_name = var.bastion_ssh_user_name bastion_ssh_user_name = var.bastion_ssh_user_name
k8s_bastion_ip = openstack_networking_floatingip_v2.bastion_fip.address k8s_bastion_ip = openstack_networking_floatingip_v2.bastion_fip.address
k8s_control_ip = openstack_compute_instance_v2.control_nodes.*.access_ip_v4 k8s_control_name = openstack_compute_instance_v2.control_nodes.*.name
k8s_control_ip = openstack_compute_instance_v2.control_nodes.*.access_ip_v4
k8s_worker_name = openstack_compute_instance_v2.worker_nodes.*.name
k8s_worker_ip = openstack_compute_instance_v2.worker_nodes.*.access_ip_v4 k8s_worker_ip = openstack_compute_instance_v2.worker_nodes.*.access_ip_v4
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment