2017-07-19 17:00:27 +08:00
|
|
|
|
2018-10-11 10:28:39 +08:00
|
|
|
{% for vm in vm_ip_list %}
|
2018-03-26 13:00:02 +08:00
|
|
|
{% if not use_bastion or vm.virtualMachine.name == 'bastion' %}
|
2017-07-19 17:00:27 +08:00
|
|
|
{{ vm.virtualMachine.name }} ansible_ssh_host={{ vm.virtualMachine.network.publicIpAddresses[0].ipAddress }} ip={{ vm.virtualMachine.network.privateIpAddresses[0] }}
|
|
|
|
{% else %}
|
|
|
|
{{ vm.virtualMachine.name }} ansible_ssh_host={{ vm.virtualMachine.network.privateIpAddresses[0] }}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
|
2021-03-24 08:26:05 +08:00
|
|
|
[kube_control_plane]
|
2017-07-19 17:00:27 +08:00
|
|
|
{% for vm in vm_roles_list %}
|
2021-03-24 08:26:05 +08:00
|
|
|
{% if 'kube_control_plane' in vm.tags.roles %}
|
2017-07-19 17:00:27 +08:00
|
|
|
{{ vm.name }}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
[etcd]
|
|
|
|
{% for vm in vm_roles_list %}
|
|
|
|
{% if 'etcd' in vm.tags.roles %}
|
|
|
|
{{ vm.name }}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
|
2021-04-29 20:20:50 +08:00
|
|
|
[kube_node]
|
2017-07-19 17:00:27 +08:00
|
|
|
{% for vm in vm_roles_list %}
|
2021-04-29 20:20:50 +08:00
|
|
|
{% if 'kube_node' in vm.tags.roles %}
|
2017-07-19 17:00:27 +08:00
|
|
|
{{ vm.name }}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
|
2021-04-29 20:20:50 +08:00
|
|
|
[k8s_cluster:children]
|
|
|
|
kube_node
|
2021-03-24 08:26:05 +08:00
|
|
|
kube_control_plane
|