24 lines
670 B
YAML
24 lines
670 B
YAML
---
|
|
kubernetes:
|
|
children:
|
|
controllers:
|
|
hosts:
|
|
{% for item in nodes.inventory %}
|
|
{% if item.controller %}
|
|
"{{ item.name }}":
|
|
ansible_user: "{{ item.ssh_username }}"
|
|
ansible_host: "{{ item.address }}"
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% if nodes.inventory | selectattr('controller', 'equalto', False) | list | length %}
|
|
workers:
|
|
hosts:
|
|
{% for item in nodes.inventory %}
|
|
{% if not item.controller %}
|
|
"{{ item.name }}":
|
|
ansible_user: "{{ item.ssh_username }}"
|
|
ansible_host: "{{ item.address }}"
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|