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>
This commit is contained in:
Jakub JędrzejczykandDevin Buhl authored and GitHub committed 2024-03-04 15:57:47 -05:00
1 parent e6f8f4dd33
commit d1b5fa1c98
2 files changed
+9 -2

No files matched your search

@@ -8,6 +8,9 @@ kubernetes:
"#{ item.name }#": "#{ item.name }#":
ansible_user: "#{ item.ssh_user }#" ansible_user: "#{ item.ssh_user }#"
ansible_host: "#{ item.address }#" ansible_host: "#{ item.address }#"
#% if item.ssh_key %#
ansible_ssh_private_key_file: "#{ item.ssh_key }#"
#% endif %#
#% endif %# #% endif %#
#% endfor %# #% endfor %#
#% if bootstrap_node_inventory | selectattr('controller', 'equalto', False) | list | length %# #% if bootstrap_node_inventory | selectattr('controller', 'equalto', False) | list | length %#
@@ -18,6 +21,9 @@ kubernetes:
"#{ item.name }#": "#{ item.name }#":
ansible_user: "#{ item.ssh_user }#" ansible_user: "#{ item.ssh_user }#"
ansible_host: "#{ item.address }#" ansible_host: "#{ item.address }#"
#% if item.ssh_key %#
ansible_ssh_private_key_file: "#{ item.ssh_key }#"
#% endif %#
#% endif %# #% endif %#
#% endfor %# #% endfor %#
#% endif %# #% endif %#
+3 -2
View File
@@ -46,11 +46,12 @@ bootstrap_node_default_gateway: ""
# (Required) Use only 1, 3 or more ODD number of controller nodes, recommended is 3 # (Required) Use only 1, 3 or more ODD number of controller nodes, recommended is 3
# Worker nodes are optional # Worker nodes are optional
bootstrap_node_inventory: [] bootstrap_node_inventory: []
# - name: "" # Name of the node (must match [a-z0-9-\.]+) # - name: "" # (Required) Name of the node (must match [a-z0-9-\.]+)
# address: "" # IP address of the node # address: "" # (Required) IP address of the node
# controller: true # (Required) Set to true if this is a controller node # controller: true # (Required) Set to true if this is a controller node
# ssh_user: "" # (Required: k3s) SSH username of the node # ssh_user: "" # (Required: k3s) SSH username of the node
# talos_disk: "" # (Required: Talos) Device path or serial number of the disk for this node # talos_disk: "" # (Required: Talos) Device path or serial number of the disk for this node
# ssh_key: "" # (Optional: k3s) Set specific SSH key for this node
# ... # ...
# (Optional) The DNS server to use for the cluster, this can be an existing # (Optional) The DNS server to use for the cluster, this can be an existing