Don't use opinionated.tf while inside opinionated.tf modules.

This commit is contained in:
Greyscale 2025-02-02 03:53:22 +01:00
parent c96f6e5bd7
commit 06835f9030
Signed by: grey
GPG key ID: DDB392AE64B32D89
8 changed files with 15 additions and 10 deletions
docker/socket-proxy
products

View file

@ -1,10 +1,10 @@
module "network" {
source = "github.com/matthewbaggett/terraform_modules//docker/network"
source = "../../docker/network"
network_name = "docker-socket-proxy"
stack_name = var.stack_name
}
module "service" {
source = "github.com/matthewbaggett/terraform_modules//docker/service"
source = "../../docker/service"
image = "${var.docker_socket_proxy_image}:${var.docker_socket_proxy_version}"
stack_name = var.stack_name
service_name = var.service_name

View file

@ -4,7 +4,7 @@ module "postgres" {
placement_constraints = var.placement_constraints
postgres_version = "15"
networks = [module.forgejo_network]
data_persist_path = "/fast/gitea/db"
data_persist_path = var.database_storage_path
ports = [
{
host = 62800

View file

@ -21,6 +21,7 @@ module "forgejo" {
}))
}
mounts = merge(var.mounts, {
"${var.data_storage_path}" = "/data",
"/etc/timezone" = "/etc/timezone",
"/etc/localtime" = "/etc/localtime",
})

View file

@ -60,6 +60,11 @@ variable "mounts" {
description = "A map of host paths to container paths to mount. Key is Host path, Value is Container path"
}
variable "data_storage_path" {
type = string
description = "Specify path to store the data."
default = null
}
variable "database_storage_path" {
type = string
description = "Specify path to store the database data."

View file

@ -1,5 +1,5 @@
module "docker_socket_proxy" {
source = "github.com/matthewbaggett/terraform_modules//docker/socket-proxy"
source = "../../../docker/socket-proxy"
stack_name = var.stack_name
enable_all = true
}

View file

@ -1,5 +1,5 @@
module "portainer_network" {
source = "github.com/matthewbaggett/terraform_modules//docker/network"
source = "../../../docker/network"
stack_name = var.stack_name
network_name = "portainer"
}

View file

@ -9,12 +9,12 @@ resource "htpasswd_password" "hash" {
salt = random_password.salt.result
}
module "vol_portainer" {
source = "github.com/matthewbaggett/terraform_modules//docker//volume"
source = "../../../docker//volume"
stack_name = var.stack_name
volume_name = "portainer"
}
module "portainer" {
source = "github.com/matthewbaggett/terraform_modules//docker//service"
source = "../../../docker//service"
stack_name = var.stack_name
service_name = "portainer"
image = "portainer/portainer-ce:${var.portainer_version}"

View file

@ -4,7 +4,6 @@ locals {
command = ["socat", local.listen, local.connect]
}
module "socat" {
#source = "github.com/matthewbaggett/terraform_modules//docker/service"
source = "../../docker/service"
stack_name = var.stack_name
service_name = var.service_name