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 %}
|
|
|
|
|
|
|
|
[kube-master]
|
|
|
|
{% for vm in vm_roles_list %}
|
|
|
|
{% if 'kube-master' in vm.tags.roles %}
|
|
|
|
{{ vm.name }}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
[etcd]
|
|
|
|
{% for vm in vm_roles_list %}
|
|
|
|
{% if 'etcd' in vm.tags.roles %}
|
|
|
|
{{ vm.name }}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
[kube-node]
|
|
|
|
{% for vm in vm_roles_list %}
|
|
|
|
{% if 'kube-node' in vm.tags.roles %}
|
|
|
|
{{ vm.name }}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
[k8s-cluster:children]
|
|
|
|
kube-node
|
|
|
|
kube-master
|
|
|
|
|