add module to create a k8s worker [ci skip]

This commit is contained in:
Viktor Barzin 2025-10-11 20:40:34 +00:00
parent 3547db0a13
commit 90dde34731
No known key found for this signature in database
GPG key ID: 4056458DBDBF8863
6 changed files with 59 additions and 8 deletions

View file

@ -9,6 +9,10 @@ variable "template_id" {
variable "template_name" { type = string }
variable "snippet_name" { type = string }
variable "user_passwd" { type = string } # hashed pw
variable "k8s_join_command" {
type = string
default = ""
}
# SSH connection to Proxmox
resource "null_resource" "create_template_remote" {
@ -56,7 +60,7 @@ resource "null_resource" "upload_cloud_init" {
provisioner "file" {
destination = "/var/lib/vz/snippets/${var.snippet_name}"
content = templatefile("${path.module}/cloud_init.yaml", { authorized_ssh_key = file("~/.ssh/id_ed25519.pub"), passwd = var.user_passwd })
content = templatefile("${path.module}/cloud_init.yaml", { authorized_ssh_key = file("~/.ssh/id_ed25519.pub"), passwd = var.user_passwd, k8s_join_command = var.k8s_join_command })
}
triggers = {