refactor: simplify project structure
This commit is contained in:
30
services/main.tf
Normal file
30
services/main.tf
Normal file
@@ -0,0 +1,30 @@
|
||||
locals {
|
||||
module_dir = "../modules"
|
||||
data_dir = module.system_globals.data_dir
|
||||
}
|
||||
|
||||
module "system_globals" {
|
||||
source = "${local.module_dir}/00-globals/system"
|
||||
}
|
||||
|
||||
// Docker network used for modules that needs to be exposed to the internet
|
||||
// using Cloudflared
|
||||
module "homelab_docker_network" {
|
||||
source = "${local.module_dir}/01-networking/docker-network"
|
||||
|
||||
name = "homelab-network"
|
||||
driver = "bridge"
|
||||
attachable = true
|
||||
subnet = "10.100.0.0/16"
|
||||
}
|
||||
|
||||
module "actualbudget" {
|
||||
source = "${local.module_dir}/20-services-apps/actualbudget"
|
||||
volume_path = "${local.data_dir}/actual"
|
||||
networks = [module.homelab_docker_network.name]
|
||||
}
|
||||
|
||||
module "emulatorjs" {
|
||||
source = "${local.module_dir}/20-services-apps/emulatorjs"
|
||||
volume_path = "${local.data_dir}/emulatorjs"
|
||||
}
|
||||
15
services/outputs.tf
Normal file
15
services/outputs.tf
Normal file
@@ -0,0 +1,15 @@
|
||||
// Services environment outputs
|
||||
|
||||
// Consolidated service definitions for networking
|
||||
output "service_definitions" {
|
||||
description = "Service definitions for all services"
|
||||
value = [
|
||||
module.actualbudget.service_definition,
|
||||
module.emulatorjs.service_definition
|
||||
]
|
||||
}
|
||||
|
||||
output "homelab_docker_network_name" {
|
||||
description = "The name of the Docker network"
|
||||
value = module.homelab_docker_network.name
|
||||
}
|
||||
Reference in New Issue
Block a user