From 9ee92797e1e557764dac918e20113802df694f56 Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Fri, 27 Sep 2024 01:51:58 +0200 Subject: [PATCH] Move tfvars into variables defaults --- hcloud.tf | 2 +- hosts.auto.tfvars | 24 ----------------------- secrets.auto.tfvars.example | 19 +++++++++++++++++++ service_buckets.auto.tfvars | 14 -------------- variables.tf | 38 +++++++++++++++++++++++++++++++++++++ 5 files changed, 58 insertions(+), 39 deletions(-) delete mode 100644 hosts.auto.tfvars create mode 100644 secrets.auto.tfvars.example delete mode 100644 service_buckets.auto.tfvars diff --git a/hcloud.tf b/hcloud.tf index 281ec61..7dda884 100644 --- a/hcloud.tf +++ b/hcloud.tf @@ -51,7 +51,7 @@ resource "hcloud_server" "nodes" { ssh_keys, user_data ] - prevent_destroy = true + prevent_destroy = true } } diff --git a/hosts.auto.tfvars b/hosts.auto.tfvars deleted file mode 100644 index 7e062bc..0000000 --- a/hosts.auto.tfvars +++ /dev/null @@ -1,24 +0,0 @@ -hosts = { - "node001" = { - hostname = "node001" - rdns = "node001.serguzim.net" - provider = "contabo" - ipv4_address = "144.91.106.67", - ipv6_address = "2a02:c207:2051:6620::1" - }, - "node002" = { - hostname = "node002" - rdns = "node002.serguzim.net" - provider = "contabo" - ipv4_address = "62.171.181.192", - ipv6_address = "2a02:c207:2036:6681::1" - }, - "node003" = { - hostname = "node003" - rdns = "mail.serguzim.me" - provider = "hetzner" - image = "debian-12" - server_type = "cx32" - datacenter = "fsn1-dc14" - }, -} diff --git a/secrets.auto.tfvars.example b/secrets.auto.tfvars.example new file mode 100644 index 0000000..2e25253 --- /dev/null +++ b/secrets.auto.tfvars.example @@ -0,0 +1,19 @@ +backend_access_key = "" +backend_secret_key = "" +backend_endpoint = "" +backend_region = "" +backend_bucket = "" + +hcloud_token = "" + +ovh_application_key = "" +ovh_application_secret = "" +ovh_consumer_key = "" + +scaleway_organization_id = "" +scaleway_project_id = "" +scaleway_access_key = "" +scaleway_secret_key = "" + +tailscale_api_key = "" +tailscale_tailnet = "" diff --git a/service_buckets.auto.tfvars b/service_buckets.auto.tfvars deleted file mode 100644 index 5a8d391..0000000 --- a/service_buckets.auto.tfvars +++ /dev/null @@ -1,14 +0,0 @@ -service_buckets = { - "linkwarden" = { - name = "linkwarden" - bucket = "linkwarden.serguzim.me" - }, - "harbor" = { - name = "harbor" - bucket = "harbor.serguzim.me" - } - "forgejo" = { - name = "forgejo" - bucket = "forgejo.serguzim.me" - } -} diff --git a/variables.tf b/variables.tf index 67db83f..2d2eeda 100644 --- a/variables.tf +++ b/variables.tf @@ -68,6 +68,20 @@ variable "service_buckets" { name = string bucket = string })) + default = { + "linkwarden" = { + name = "linkwarden" + bucket = "linkwarden.serguzim.me" + }, + "harbor" = { + name = "harbor" + bucket = "harbor.serguzim.me" + } + "forgejo" = { + name = "forgejo" + bucket = "forgejo.serguzim.me" + } + } } variable "hosts" { @@ -81,4 +95,28 @@ variable "hosts" { server_type = optional(string) datacenter = optional(string) })) + default = { + "node001" = { + hostname = "node001" + rdns = "node001.serguzim.net" + provider = "contabo" + ipv4_address = "144.91.106.67", + ipv6_address = "2a02:c207:2051:6620::1" + }, + "node002" = { + hostname = "node002" + rdns = "node002.serguzim.net" + provider = "contabo" + ipv4_address = "62.171.181.192" + ipv6_address = "2a02:c207:2036:6681::1" + }, + "node003" = { + hostname = "node003" + rdns = "mail.serguzim.me" + provider = "hetzner" + image = "debian-12" + server_type = "cx32" + datacenter = "fsn1-dc14" + }, + } }