first commit
This commit is contained in:
49
modules/20-services-apps/actualbudget/main.tf
Normal file
49
modules/20-services-apps/actualbudget/main.tf
Normal file
@@ -0,0 +1,49 @@
|
||||
// ActualBudget module for budgeting
|
||||
// This module configures an ActualBudget container with the specified volumes
|
||||
|
||||
locals {
|
||||
container_name = var.container_name != "" ? var.container_name : "actualbudget"
|
||||
image_tag = var.image_tag != "" ? var.image_tag : "latest"
|
||||
|
||||
default_env_vars = {
|
||||
TZ = var.timezone
|
||||
PUID = var.puid
|
||||
PGID = var.pgid
|
||||
}
|
||||
|
||||
default_volumes = [
|
||||
{
|
||||
container_path = "/data"
|
||||
host_path = var.data_volume_path
|
||||
read_only = false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
module "actualbudget" {
|
||||
source = "../../10-services-generic/docker-service"
|
||||
|
||||
container_name = var.container_name
|
||||
image = "actualbudget/actual-server"
|
||||
tag = var.image_tag
|
||||
|
||||
// Environment variables
|
||||
env_vars = local.default_env_vars
|
||||
|
||||
// Port mapping
|
||||
ports = [
|
||||
{
|
||||
internal = 5006
|
||||
external = var.port
|
||||
protocol = "tcp"
|
||||
}
|
||||
]
|
||||
|
||||
// Volume mapping
|
||||
volumes = local.default_volumes
|
||||
|
||||
// Enable monitoring for the container via Watchtower
|
||||
monitoring = var.monitoring
|
||||
|
||||
networks = var.networks
|
||||
}
|
||||
24
modules/20-services-apps/actualbudget/outputs.tf
Normal file
24
modules/20-services-apps/actualbudget/outputs.tf
Normal file
@@ -0,0 +1,24 @@
|
||||
output "container_name" {
|
||||
description = "The name of the ActualBudget container"
|
||||
value = module.actualbudget.container_name
|
||||
}
|
||||
|
||||
output "container_id" {
|
||||
description = "The ID of the ActualBudget container"
|
||||
value = module.actualbudget.container_id
|
||||
}
|
||||
|
||||
output "image_id" {
|
||||
description = "The ID of the ActualBudget image"
|
||||
value = module.actualbudget.image_id
|
||||
}
|
||||
|
||||
output "ip_address" {
|
||||
description = "The IP address of the ActualBudget container"
|
||||
value = module.actualbudget.ip_address
|
||||
}
|
||||
|
||||
output "local_url" {
|
||||
description = "The local URL to access the ActualBudget interface"
|
||||
value = "http://localhost:${var.port}"
|
||||
}
|
||||
52
modules/20-services-apps/actualbudget/variables.tf
Normal file
52
modules/20-services-apps/actualbudget/variables.tf
Normal file
@@ -0,0 +1,52 @@
|
||||
variable "container_name" {
|
||||
description = "Name of the ActualBudget container"
|
||||
type = string
|
||||
default = "actualbudget"
|
||||
}
|
||||
|
||||
variable "timezone" {
|
||||
description = "Timezone for the container"
|
||||
type = string
|
||||
default = "UTC"
|
||||
}
|
||||
|
||||
variable "image_tag" {
|
||||
description = "Tag of the ActualBudget image to use"
|
||||
type = string
|
||||
default = "latest"
|
||||
}
|
||||
|
||||
variable "port" {
|
||||
description = "External port for ActualBudget server"
|
||||
type = number
|
||||
default = 5006
|
||||
}
|
||||
|
||||
variable "data_volume_path" {
|
||||
description = "Host path for ActualBudget data volume"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "puid" {
|
||||
description = "User ID for the container"
|
||||
type = number
|
||||
default = 1000
|
||||
}
|
||||
|
||||
variable "pgid" {
|
||||
description = "Group ID for the container"
|
||||
type = number
|
||||
default = 1000
|
||||
}
|
||||
|
||||
variable "monitoring" {
|
||||
description = "Enable monitoring for the container via Watchtower"
|
||||
type = bool
|
||||
default = true
|
||||
}
|
||||
|
||||
variable "networks" {
|
||||
description = "List of networks to which the container should be attached"
|
||||
type = list(string)
|
||||
default = []
|
||||
}
|
||||
Reference in New Issue
Block a user