From 506e64d44c6bf83a13057b4b6f0c915954ebe2a2 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 20 Oct 2024 13:25:18 +0800 Subject: [PATCH] hosts/plover: add Tailscale tag and network file for future references --- configs/nixos/plover/terraform/main.tf | 12 ++++++++++++ configs/nixos/plover/terraform/tailscale.tf | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/configs/nixos/plover/terraform/main.tf b/configs/nixos/plover/terraform/main.tf index 0f484174..e410f94b 100644 --- a/configs/nixos/plover/terraform/main.tf +++ b/configs/nixos/plover/terraform/main.tf @@ -26,3 +26,15 @@ resource "hcloud_ssh_key" "plover" { name = "plover.foodogsquared.one" public_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGo3tfNQjWZ5pxlqREfBgQJxdNzGHKJIy5hDS9Z+Hpth plover.foodogsquared.one" } + +resource "local_file" "network_file" { + content = jsonencode({ + interfaces = { + wan = { + ipv4 = hcloud_server.plover.ipv4_address + ipv6 = hcloud_server.plover.ipv6_address + } + } + }) + filename = "${path.module}/network.json" +} diff --git a/configs/nixos/plover/terraform/tailscale.tf b/configs/nixos/plover/terraform/tailscale.tf index 69ea31b9..117d766b 100644 --- a/configs/nixos/plover/terraform/tailscale.tf +++ b/configs/nixos/plover/terraform/tailscale.tf @@ -16,6 +16,11 @@ resource "tailscale_tailnet_key" "plover" { description = "Plover" } +resource "tailscale_device_tags" "hcloud_plover" { + device_id = data.tailscale_device.plover.id + tags = [ "tag:server" ] +} + resource "local_file" "tailscale_auth_key" { content = tailscale_tailnet_key.plover.key filename = "${path.module}/plover-tailscale-auth-key"