Format
This commit is contained in:
@@ -4,19 +4,19 @@ provider "hcloud" {
|
||||
|
||||
data "hcloud_image" "wg_image" {
|
||||
with_selector = "service=wireguard"
|
||||
most_recent = true
|
||||
most_recent = true
|
||||
}
|
||||
|
||||
resource "hcloud_ssh_key" "wg_server_ssh_key" {
|
||||
public_key = var.wg_server_ssh_publickey
|
||||
name = var.wg_server_ssh_publickey_name
|
||||
name = var.wg_server_ssh_publickey_name
|
||||
}
|
||||
|
||||
resource "hcloud_server" "wg_server" {
|
||||
image = data.hcloud_image.wg_image.id
|
||||
name = var.wg_server_name
|
||||
image = data.hcloud_image.wg_image.id
|
||||
name = var.wg_server_name
|
||||
server_type = var.wg_server_type
|
||||
location = var.wg_server_location
|
||||
location = var.wg_server_location
|
||||
labels = {
|
||||
service = "wireguard"
|
||||
}
|
||||
@@ -24,7 +24,7 @@ resource "hcloud_server" "wg_server" {
|
||||
hcloud_ssh_key.wg_server_ssh_key.id
|
||||
]
|
||||
user_data = templatefile("${path.module}/templates/user-data.tpl", {
|
||||
wg_server_own_privatekey = var.wg_server_own_privatekey
|
||||
wg_server_own_privatekey = var.wg_server_own_privatekey
|
||||
wg_server_peer_publickeys = var.wg_server_peer_publickeys
|
||||
})
|
||||
}
|
||||
|
@@ -1,9 +1,9 @@
|
||||
output "wg_server_ipv4_address" {
|
||||
value = hcloud_server.wg_server.ipv4_address
|
||||
value = hcloud_server.wg_server.ipv4_address
|
||||
description = "IPv4 address"
|
||||
}
|
||||
|
||||
output "wg_server_ipv6_address" {
|
||||
value = hcloud_server.wg_server.ipv6_address
|
||||
value = hcloud_server.wg_server.ipv6_address
|
||||
description = "IPv6 address"
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
hcloud_api_token = ""
|
||||
|
||||
wg_server_name = ""
|
||||
wg_server_type = ""
|
||||
wg_server_name = ""
|
||||
wg_server_type = ""
|
||||
wg_server_location = ""
|
||||
|
||||
wg_server_ssh_publickey = ""
|
||||
wg_server_ssh_publickey = ""
|
||||
wg_server_ssh_publickey_name = ""
|
||||
|
||||
wg_server_own_privatekey = ""
|
||||
wg_server_own_privatekey = ""
|
||||
wg_server_peer_publickeys = []
|
||||
|
@@ -1,43 +1,43 @@
|
||||
variable "hcloud_api_token" {
|
||||
type = string
|
||||
type = string
|
||||
description = "Hetzner Cloud API token"
|
||||
default = ""
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "wg_server_name" {
|
||||
type = string
|
||||
type = string
|
||||
description = "Server name"
|
||||
default = "wireguard"
|
||||
default = "wireguard"
|
||||
}
|
||||
|
||||
variable "wg_server_type" {
|
||||
type = string
|
||||
type = string
|
||||
description = "Server type"
|
||||
default = "cx11"
|
||||
default = "cx11"
|
||||
}
|
||||
|
||||
variable "wg_server_location" {
|
||||
type = string
|
||||
type = string
|
||||
description = "Server location"
|
||||
default = "fsn1"
|
||||
default = "fsn1"
|
||||
}
|
||||
|
||||
variable "wg_server_ssh_publickey" {
|
||||
type = string
|
||||
type = string
|
||||
description = "SSH public key"
|
||||
}
|
||||
|
||||
variable "wg_server_ssh_publickey_name" {
|
||||
type = string
|
||||
type = string
|
||||
description = "SSH public key name"
|
||||
}
|
||||
|
||||
variable "wg_server_own_privatekey" {
|
||||
type = string
|
||||
type = string
|
||||
description = "WireGuard private key"
|
||||
}
|
||||
|
||||
variable "wg_server_peer_publickeys" {
|
||||
type = list(string)
|
||||
type = list(string)
|
||||
description = "WireGuard peer public keys"
|
||||
}
|
||||
|
Reference in New Issue
Block a user