refactor: use direct tailscale auth-key enrollment
All checks were successful
Terraform Plan / Terraform Plan (push) Successful in 18s
All checks were successful
Terraform Plan / Terraform Plan (push) Successful in 18s
Stop writing auth keys to guest files and enroll nodes by running tailscale up directly via Proxmox guest agent with VM-name hostnames.
This commit is contained in:
@@ -199,14 +199,12 @@ jobs:
|
||||
safe_hostname = hostname.replace("'", "'\"'\"'")
|
||||
cmd = (
|
||||
"set -e; "
|
||||
"install -d -m 700 /etc/tailscale; "
|
||||
f"printf '%s' '{safe_key}' > /etc/tailscale/authkey; "
|
||||
f"printf '%s' '{safe_hostname}' > /etc/tailscale/hostname; "
|
||||
"chmod 600 /etc/tailscale/authkey; "
|
||||
f"hostnamectl set-hostname '{safe_hostname}' || true; "
|
||||
"install -d -m 700 /var/lib/tailscale; "
|
||||
"rm -f /var/lib/tailscale/tailscaled.state; "
|
||||
"systemctl restart tailscaled; "
|
||||
"systemctl start tailscale-firstboot.service; "
|
||||
"tailscale status || true"
|
||||
f"/run/current-system/sw/bin/tailscale up --reset --auth-key='{safe_key}' --hostname='{safe_hostname}'; "
|
||||
"/run/current-system/sw/bin/tailscale status || true"
|
||||
)
|
||||
|
||||
exitcode, stdout, stderr = exec_guest(vmid, cmd)
|
||||
|
||||
Reference in New Issue
Block a user