{% for instance in droplets.results %}
{{instance.droplet.name}} ansible_ssh_host={{instance.droplet.ip_address}}
{% endfor %}

{% if mode is defined and mode == "separate" %}
[kube_control_plane]
{{droplets.results[0].droplet.name}}

[kube_node]
{{droplets.results[1].droplet.name}}

[etcd]
{{droplets.results[2].droplet.name}}
{% elif mode is defined and mode == "ha" %}
[kube_control_plane]
{{droplets.results[0].droplet.name}}
{{droplets.results[1].droplet.name}}

[kube_node]
{{droplets.results[2].droplet.name}}

[etcd]
{{droplets.results[1].droplet.name}}
{{droplets.results[2].droplet.name}}

[broken_kube_control_plane]
{{droplets.results[1].droplet.name}}

[broken_etcd]
{{droplets.results[2].droplet.name}}
{% else %}
[kube_control_plane]
{{droplets.results[0].droplet.name}}

[kube_node]
{{droplets.results[1].droplet.name}}

[etcd]
{{droplets.results[0].droplet.name}}
{% endif %}

[calico_rr]

[k8s_cluster:children]
kube_node
kube_control_plane
calico_rr
