mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2026-03-28 06:26:08 +01:00
Setup relay server
This commit is contained in:
parent
a1945ec137
commit
d04d69157e
9 changed files with 354 additions and 50 deletions
|
|
@ -8,6 +8,14 @@ terraform {
|
|||
username = "phfroidmont"
|
||||
}
|
||||
required_providers {
|
||||
hcloud = {
|
||||
source = "hetznercloud/hcloud"
|
||||
version = "~> 1.49"
|
||||
}
|
||||
null = {
|
||||
source = "hashicorp/null"
|
||||
version = "~> 3.2"
|
||||
}
|
||||
hetznerdns = {
|
||||
source = "timohirt/hetznerdns"
|
||||
version = ">= 2.2.0"
|
||||
|
|
@ -28,4 +36,3 @@ data "sops_file" "secrets" {
|
|||
provider "hetznerdns" {
|
||||
apitoken = data.sops_file.secrets.data["hcloud.dns_token"]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -382,6 +382,14 @@ resource "hetznerdns_record" "froidmont_a" {
|
|||
ttl = 600
|
||||
}
|
||||
|
||||
resource "hetznerdns_record" "rl_a" {
|
||||
zone_id = data.hetznerdns_zone.froidmont_zone.id
|
||||
name = "rl"
|
||||
value = hcloud_server.relay1.ipv4_address
|
||||
type = "A"
|
||||
ttl = 600
|
||||
}
|
||||
|
||||
resource "hetznerdns_record" "website_marie_a" {
|
||||
zone_id = data.hetznerdns_zone.froidmont_zone.id
|
||||
name = "osteopathie"
|
||||
|
|
|
|||
44
terraform/hcloud.tf
Normal file
44
terraform/hcloud.tf
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
provider "hcloud" {}
|
||||
|
||||
resource "hcloud_ssh_key" "phfroidmont_stellaris" {
|
||||
name = "phfroidmont-stellaris"
|
||||
public_key = file("${path.module}/../ssh_keys/phfroidmont-stellaris.pub")
|
||||
}
|
||||
|
||||
resource "hcloud_ssh_key" "froidmpa_desktop" {
|
||||
name = "froidmpa-desktop"
|
||||
public_key = file("${path.module}/../ssh_keys/froidmpa-desktop.pub")
|
||||
}
|
||||
|
||||
resource "hcloud_ssh_key" "elios_desktop" {
|
||||
name = "elios-desktop"
|
||||
public_key = file("${path.module}/../ssh_keys/elios-desktop.pub")
|
||||
}
|
||||
|
||||
resource "hcloud_server" "relay1" {
|
||||
name = "relay1"
|
||||
server_type = "cx23"
|
||||
image = "ubuntu-24.04"
|
||||
location = "nbg1"
|
||||
|
||||
public_net {
|
||||
ipv4_enabled = true
|
||||
ipv6_enabled = false
|
||||
}
|
||||
|
||||
ssh_keys = [
|
||||
hcloud_ssh_key.phfroidmont_stellaris.id,
|
||||
hcloud_ssh_key.froidmpa_desktop.id,
|
||||
hcloud_ssh_key.elios_desktop.id,
|
||||
]
|
||||
}
|
||||
|
||||
module "nixos_anywhere_install" {
|
||||
source = "github.com/nix-community/nixos-anywhere//terraform/install"
|
||||
|
||||
target_host = hcloud_server.relay1.ipv4_address
|
||||
instance_id = hcloud_server.relay1.id
|
||||
flake = "${path.module}/..#relay1"
|
||||
|
||||
depends_on = [hcloud_server.relay1]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue