fix: avoid server replacement; install tailscale via Ansible
This commit is contained in:
@@ -17,14 +17,6 @@ resource "hcloud_server" "control_plane" {
|
||||
role = "control-plane"
|
||||
}
|
||||
|
||||
user_data = <<-EOF
|
||||
#cloud-config
|
||||
package_update: true
|
||||
runcmd:
|
||||
- curl -fsSL https://tailscale.com/install.sh | sh
|
||||
- tailscale up --authkey '${var.tailscale_auth_key}' --hostname '${var.cluster_name}-cp-${count.index + 1}' --ssh=false --accept-routes=false
|
||||
EOF
|
||||
|
||||
network {
|
||||
network_id = hcloud_network.cluster.id
|
||||
ip = cidrhost(var.subnet_cidr, 10 + count.index)
|
||||
@@ -52,14 +44,6 @@ resource "hcloud_server" "workers" {
|
||||
role = "worker"
|
||||
}
|
||||
|
||||
user_data = <<-EOF
|
||||
#cloud-config
|
||||
package_update: true
|
||||
runcmd:
|
||||
- curl -fsSL https://tailscale.com/install.sh | sh
|
||||
- tailscale up --authkey '${var.tailscale_auth_key}' --hostname '${var.cluster_name}-worker-${count.index + 1}' --ssh=false --accept-routes=false
|
||||
EOF
|
||||
|
||||
network {
|
||||
network_id = hcloud_network.cluster.id
|
||||
ip = cidrhost(var.subnet_cidr, 20 + count.index)
|
||||
|
||||
@@ -76,12 +76,6 @@ variable "tailnet_cidr" {
|
||||
default = "100.64.0.0/10"
|
||||
}
|
||||
|
||||
variable "tailscale_auth_key" {
|
||||
description = "Tailscale auth key for node bootstrap"
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "tailscale_tailnet" {
|
||||
description = "Tailnet domain suffix, e.g. mytailnet.ts.net"
|
||||
type = string
|
||||
|
||||
Reference in New Issue
Block a user