Files
home-cluster/bootstrap/templates/ansible/inventory/hosts.yaml.j2
T
Jakub JędrzejczykandDevin Buhl d1b5fa1c98 Add the option for assigning a specific SSH key to a node. (#1356)
* Add the option for specifying an SSH key.

* Add ability to specify SSH key.

* Update config.sample.yaml

* Update config.sample.yaml

* Update bootstrap/templates/ansible/inventory/hosts.yaml.j2

* Update bootstrap/templates/ansible/inventory/hosts.yaml.j2

---------

Co-authored-by: Devin Buhl <onedr0p@users.noreply.github.com>
2024-03-04 15:57:47 -05:00

30 lines
919 B
YAML

---
kubernetes:
children:
controllers:
hosts:
#% for item in bootstrap_node_inventory %#
#% if item.controller %#
"#{ item.name }#":
ansible_user: "#{ item.ssh_user }#"
ansible_host: "#{ item.address }#"
#% if item.ssh_key %#
ansible_ssh_private_key_file: "#{ item.ssh_key }#"
#% endif %#
#% endif %#
#% endfor %#
#% if bootstrap_node_inventory | selectattr('controller', 'equalto', False) | list | length %#
workers:
hosts:
#% for item in bootstrap_node_inventory %#
#% if not item.controller %#
"#{ item.name }#":
ansible_user: "#{ item.ssh_user }#"
ansible_host: "#{ item.address }#"
#% if item.ssh_key %#
ansible_ssh_private_key_file: "#{ item.ssh_key }#"
#% endif %#
#% endif %#
#% endfor %#
#% endif %#