make image name configurable

main
Michael Wilson 3 years ago
parent 039042b608
commit b65658d120
  1. 2
      hcloud-k3s-cluster/main.tf
  2. 6
      hcloud-k3s-cluster/vars.tf

@ -31,7 +31,7 @@ resource "hcloud_ssh_key" "pubkey" {
resource "hcloud_server" "k3s-node" { resource "hcloud_server" "k3s-node" {
count = var.node_count count = var.node_count
name = "k3s-node-${count.index + 1}" name = "k3s-node-${count.index + 1}"
image = "ubuntu-22.04" image = var.image_name
server_type = var.server_type server_type = var.server_type
ssh_keys = [ "${hcloud_ssh_key.pubkey.id}" ] ssh_keys = [ "${hcloud_ssh_key.pubkey.id}" ]
location = var.server_location location = var.server_location

@ -14,6 +14,12 @@ variable "hetznerdns_token" {
description = "hetznerdns API token" description = "hetznerdns API token"
} }
variable "image_name" {
type = string
description = "hetzner cloud image name"
default = "ubuntu-22.04"
}
variable "node_count" { variable "node_count" {
type = number type = number
default = 3 default = 3

Loading…
Cancel
Save