Files
home-cluster/bootstrap/templates/ansible/inventory/hosts.yaml.j2
T
Devin Buhl 0c4f0260d5 fix: ansible dir should only exist for k3s and k0s (#1191)
* fix: ansible dir should only exist for k3s and k0s

Signed-off-by: Devin Buhl <devin@buhl.casa>

* fix: rename partial files

Signed-off-by: Devin Buhl <devin@buhl.casa>

---------

Signed-off-by: Devin Buhl <devin@buhl.casa>
2024-01-18 13:52:11 -05:00

30 lines
887 B
YAML

#% if bootstrap_distribution == 'k3s' or bootstrap_distribution == 'k0s' %#
---
kubernetes:
children:
master:
hosts:
#% for item in bootstrap_nodes.master %#
"#{ item.name }#":
ansible_user: "#{ item.username }#"
#% if item.external_address is defined %#
ansible_host: "#{ item.external_address }#"
#% else %#
ansible_host: "#{ item.address }#"
#% endif %#
#% endfor %#
#% if bootstrap_nodes.worker | default([]) | length > 0 %#
worker:
hosts:
#% for item in bootstrap_nodes.worker %#
"#{ item.name }#":
ansible_user: "#{ item.username }#"
#% if item.external_address is defined %#
ansible_host: "#{ item.external_address }#"
#% else %#
ansible_host: "#{ item.address }#"
#% endif %#
#% endfor %#
#% endif %#
#% endif %#