diff --git a/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/main.tf b/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/main.tf index 4dddbbd4b..fbe02515a 100644 --- a/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/main.tf +++ b/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/main.tf @@ -57,7 +57,7 @@ resource "hcloud_server" "master" { connection { host = self.ipv4_address timeout = "3m" - user = "core" + user = ${var.user} } inline = [ @@ -114,7 +114,7 @@ resource "hcloud_server" "worker" { connection { host = self.ipv4_address timeout = "3m" - user = "core" + user = ${var.user} } inline = [ diff --git a/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/templates/machine.yaml.tmpl b/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/templates/machine.yaml.tmpl index 9ddc77564..eb91d0f4b 100644 --- a/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/templates/machine.yaml.tmpl +++ b/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/templates/machine.yaml.tmpl @@ -1,7 +1,7 @@ --- passwd: users: - - name: core + - name: ${user} ssh_authorized_keys: ${ssh_keys} storage: files: diff --git a/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/variables.tf b/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/variables.tf index e47162dc8..35fa8a60e 100644 --- a/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/variables.tf +++ b/contrib/terraform/hetzner/modules/kubernetes-cluster-flatcar/variables.tf @@ -8,6 +8,11 @@ variable "prefix" { default = "k8s" } +variable "user" { + type = string + default = "core" +} + variable "machines" { type = map(object({ node_type = string @@ -16,6 +21,8 @@ variable "machines" { })) } + + variable "ssh_public_keys" { type = list(string) }