tf: add tailscale configuration
This commit is contained in:
parent
b3673f9a2f
commit
253c68f590
12
main.tf
12
main.tf
@ -1,11 +1,23 @@
|
||||
# https://www.tweag.io/blog/2019-04-03-terraform-provider-secret/
|
||||
# resource "secret_resource" "" {}
|
||||
|
||||
|
||||
##### provider block start
|
||||
#
|
||||
|
||||
# https://www.linode.com/docs/guides/secrets-management-with-terraform/
|
||||
provider "linode" {
|
||||
token = var.linode_token
|
||||
}
|
||||
|
||||
provider "tailscale" {
|
||||
api_key = var.tailscale_api_key
|
||||
tailnet = var.tailscale_tailnet
|
||||
}
|
||||
|
||||
#
|
||||
##### provider block end
|
||||
|
||||
resource "linode_sshkey" "surtur" {
|
||||
label = "nbgw"
|
||||
ssh_key = chomp(file("~/.ssh/surtur.pub"))
|
||||
|
3
tailscale.tf
Normal file
3
tailscale.tf
Normal file
@ -0,0 +1,3 @@
|
||||
resource "tailscale_dns_preferences" "magic_dns" {
|
||||
magic_dns = true
|
||||
}
|
@ -4,6 +4,11 @@ terraform {
|
||||
linode = {
|
||||
source = "linode/linode"
|
||||
}
|
||||
|
||||
tailscale = {
|
||||
source = "tailscale/tailscale"
|
||||
version = "0.13.7"
|
||||
}
|
||||
}
|
||||
|
||||
# init using: tfi -backend-config=path/to/decrypted/infra-backend
|
||||
|
10
variables.tf
10
variables.tf
@ -20,3 +20,13 @@ variable "linode_wheel_login" {
|
||||
type = string
|
||||
description = "username of the admin user"
|
||||
}
|
||||
|
||||
variable "tailscale_api_key" {
|
||||
type = string
|
||||
description = "Tailscale API key"
|
||||
}
|
||||
|
||||
variable "tailscale_tailnet" {
|
||||
type = string
|
||||
description = "Tailscale Tailnet to manage"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user