hosts/plover: add Tailscale tag and network file for future references

This commit is contained in:
Gabriel Arazas 2024-10-20 13:25:18 +08:00
parent 560230645f
commit 506e64d44c
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
2 changed files with 17 additions and 0 deletions

View File

@ -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"
}

View File

@ -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"