Deopinionate for now

This commit is contained in:
Greyscale 2025-02-14 20:51:43 +01:00
parent ad3cd2f14a
commit d428c8644b
Signed by: grey
GPG key ID: DDB392AE64B32D89
4 changed files with 101 additions and 0 deletions

View file

@ -0,0 +1,13 @@
# General
daemon=300
# Router
usev4=${router}
# Dynamic DNS service
protocol=${protocol}
%{ if login != null }login=${login}%{ endif }
%{ if password != null }password=${password}%{ endif }
%{ if apikey != null }apikey=${apikey}%{ endif }
%{ if secretapikey != null }secretapikey=${secretapikey}%{ endif }
${domain}

View file

@ -0,0 +1,32 @@
module "service" {
source = "../../docker/service"
image = "linuxserver/ddclient"
service_name = "ddclient"
stack_name = var.stack_name
placement_constraints = var.placement_constraints
#configs = {
# "/defaults/ddclient.conf" = templatefile("${path.module}/ddclient.conf.tpl", {
# protocol = var.protocol
# login = var.login
# password = var.password
# apikey = var.apikey
# secretapikey = var.secretapikey
# })
#}
secrets = {
"/defaults/ddclient.conf" = templatefile("${path.module}/ddclient.conf.tpl", {
protocol = var.protocol
router = var.router
login = var.login
password = var.password
apikey = var.apikey
secretapikey = var.secretapikey
domain = var.domain
})
}
environment_variables = {
PUID = 1000
PGID = 1000
}
converge_enable = false # @todo Add healthcheck and enable this.
}

View file

@ -0,0 +1,36 @@
variable "stack_name" {
default = "dns"
type = string
description = "The name of the stack to create."
}
variable "placement_constraints" {
default = []
type = list(string)
description = "Docker Swarm placement constraints"
}
variable "protocol" {
type = string
}
variable "router" {
type = string
default = "webv4,webv4=ipify-ipv4"
}
variable "domain" {
type = string
}
variable "login" {
type = string
default = null
}
variable "password" {
type = string
default = null
}
variable "apikey" {
type = string
default = null
}
variable "secretapikey" {
type = string
default = null
}

View file

@ -0,0 +1,20 @@
terraform {
required_version = "~> 1.6"
required_providers {
docker = {
source = "kreuzwerker/docker"
version = "~> 3.0"
}
random = {
source = "hashicorp/random"
version = "~> 3.5"
}
htpasswd = {
source = "loafoe/htpasswd"
version = "~> 1.0"
}
}
}