mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 04:58:01 +00:00
hosts/plover/terraform: add Tailscale resources
Not automated per-se since we are dealing with not-NixOS-but-only-after-it-is-installed Hetzner server. I really have to figure that part out.
This commit is contained in:
parent
c1cdb7b48b
commit
560230645f
22
configs/nixos/plover/terraform/tailscale.tf
Normal file
22
configs/nixos/plover/terraform/tailscale.tf
Normal file
@ -0,0 +1,22 @@
|
||||
data "tailscale_device" "plover" {
|
||||
hostname = "plover"
|
||||
}
|
||||
|
||||
resource "tailscale_device_authorization" "plover_authorization" {
|
||||
device_id = data.tailscale_device.plover.id
|
||||
authorized = true
|
||||
depends_on = [ hcloud_server.plover ]
|
||||
}
|
||||
|
||||
resource "tailscale_tailnet_key" "plover" {
|
||||
reusable = false
|
||||
ephemeral = false
|
||||
preauthorized = true
|
||||
recreate_if_invalid = "always"
|
||||
description = "Plover"
|
||||
}
|
||||
|
||||
resource "local_file" "tailscale_auth_key" {
|
||||
content = tailscale_tailnet_key.plover.key
|
||||
filename = "${path.module}/plover-tailscale-auth-key"
|
||||
}
|
@ -9,5 +9,15 @@ terraform {
|
||||
source = "timohirt/hetznerdns"
|
||||
version = "2.2.0"
|
||||
}
|
||||
|
||||
tailscale = {
|
||||
source = "tailscale/tailscale"
|
||||
version = "0.17.2"
|
||||
}
|
||||
|
||||
local = {
|
||||
source = "hashicorp/local"
|
||||
version = "2.5.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user