Deopinionate for now
This commit is contained in:
parent
ad3cd2f14a
commit
d428c8644b
4 changed files with 101 additions and 0 deletions
products/ddclient
13
products/ddclient/ddclient.conf.tpl
Normal file
13
products/ddclient/ddclient.conf.tpl
Normal 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}
|
32
products/ddclient/ddclient.tf
Normal file
32
products/ddclient/ddclient.tf
Normal 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.
|
||||
}
|
36
products/ddclient/inputs.tf
Normal file
36
products/ddclient/inputs.tf
Normal 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
|
||||
}
|
20
products/ddclient/terraform.tf
Normal file
20
products/ddclient/terraform.tf
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in a new issue