add var for username in flatcar

This commit is contained in:
Florian Nowarre 2022-09-21 14:25:51 +02:00
parent 73ff8144c2
commit 49a0fd6093
3 changed files with 10 additions and 3 deletions

View file

@ -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 = [

View file

@ -1,7 +1,7 @@
---
passwd:
users:
- name: core
- name: ${user}
ssh_authorized_keys: ${ssh_keys}
storage:
files:

View file

@ -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)
}