added caddy provider support
This commit is contained in:
1 parent
91e80ae6f8
commit
408b5d8652
6 files changed
+193
-4
No files matched your search
@@ -12,6 +12,10 @@ terraform {
|
||||
source = "kenske/technitium"
|
||||
version = "~> 0.2"
|
||||
}
|
||||
caddy = {
|
||||
source = "conradludgate/caddy"
|
||||
version = "~> 0.2"
|
||||
}
|
||||
# phpipam = {
|
||||
# source = "lord-kyron/phpipam"
|
||||
# version = "1.6.2"
|
||||
@@ -27,6 +31,26 @@ provider "technitium" {
|
||||
token = coalesce(try(data.external.infisical.result["technitium_api_token"], ""), "token-not-yet-provisioned")
|
||||
}
|
||||
|
||||
provider "caddy" {
|
||||
# Endpoint as seen from wherever the request lands: with the SSH tunnel below
|
||||
# this is the caddy host's own loopback admin API; without it, a directly
|
||||
# reachable admin endpoint. Falls back to the Caddy default so the provider
|
||||
# configures cleanly before caddy_host is set (no resources use it until then).
|
||||
host = coalesce(var.caddy_host, "http://localhost:2019")
|
||||
|
||||
# Tunnel to the admin API over SSH when it only listens on loopback (the
|
||||
# default, recommended setup). Reuses the ansible key generated above. Leave
|
||||
# caddy_ssh_host empty to talk to caddy_host directly.
|
||||
dynamic "ssh" {
|
||||
for_each = var.caddy_ssh_host != "" ? [1] : []
|
||||
content {
|
||||
host = var.caddy_ssh_host
|
||||
key_file = local_sensitive_file.ssh_private_key.filename
|
||||
host_key = var.caddy_ssh_host_key
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data "external" "infisical" {
|
||||
program = ["bash", "-c", "infisical export --template=./secrets.tmpl"]
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user