Enable flags

This commit is contained in:
Greyscale 2025-02-14 21:29:33 +01:00
parent 93f0f03cd7
commit fb3a77f526
Signed by: grey
GPG key ID: DDB392AE64B32D89
9 changed files with 25 additions and 5 deletions

View file

@ -1,3 +1,8 @@
variable "enable" {
type = bool
description = "Whether to enable the service or merely provision it."
default = true
}
variable "stack_name" {
type = string
description = "The name of the stack to deploy the service to."

View file

@ -1,3 +1,8 @@
variable "enable" {
type = bool
description = "Whether to enable the service or merely provision it."
default = true
}
variable "mysql_image" {
default = "mariadb"
type = string

View file

@ -1,5 +1,6 @@
module "service" {
source = "../../docker/service"
enable = var.enable
image = "${var.mysql_image}:${var.mysql_version}"
stack_name = var.stack_name
service_name = var.service_name

View file

@ -1,3 +1,8 @@
variable "enable" {
type = bool
description = "Whether to enable the service or merely provision it."
default = true
}
# Pass-thru variables
variable "stack_name" {
type = string

View file

@ -5,6 +5,7 @@ module "network" {
module "anisette" {
source = "../../docker/service"
image = "dadoum/anisette-v3-server"
enable = var.enable
stack_name = var.stack_name
service_name = "anisette"
networks = concat(var.networks, [module.network])
@ -17,6 +18,7 @@ module "anisette" {
}
module "macless-haystack" {
source = "../../docker/service"
enable = var.enable
stack_name = var.stack_name
service_name = "macless-haystack"
image = "christld/macless-haystack"

View file

@ -1,4 +1,4 @@
variable "enabled" {
variable "enable" {
type = bool
description = "Whether to enable the service or merely provision it."
default = true

View file

@ -21,7 +21,7 @@ variable "servers" {
}
module "pgadmin" {
source = "../../docker/service"
enable = var.enabled
enable = var.enable
image = "dpage/pgadmin4:8"
service_name = "pgadmin"
stack_name = "pgadmin"

View file

@ -1,4 +1,4 @@
variable "enabled" {
variable "enable" {
type = bool
description = "Whether to enable the service or merely provision it."
default = true

View file

@ -8,7 +8,7 @@ resource "random_password" "encryption_key" {
}
module "pgbackweb" {
source = "../../docker/service"
enable = var.enabled
enable = var.enable
image = "${var.pgbackweb_image}:${var.pgbackweb_version}"
environment_variables = {
PBW_ENCRYPTION_KEY = nonsensitive(random_password.encryption_key.result)
@ -22,7 +22,9 @@ module "pgbackweb" {
}
module "postgres" {
source = "../postgres"
postgres_version = "16"
enable = var.enable
postgres_version = "17"
service_name = "pgbackweb-postgres"
stack_name = var.stack_name
networks = [module.network]
placement_constraints = var.placement_constraints