deploy dolibarr

This commit is contained in:
2024-11-05 01:21:24 +01:00
parent 83b36bafc9
commit 5c08cc9cfd
26 changed files with 791 additions and 0 deletions

32
iac/main.tf Normal file
View File

@@ -0,0 +1,32 @@
locals {
app = {
name = "erp"
product_name = "dolibarr" # unused
}
}
module "app_roles" {
source = "git::ssh://git@192.168.1.202:2222/arcodange-org/tools.git//hashicorp-vault/iac/modules/app_roles?depth=1&ref=main"
name = local.app.name
}
resource "random_password" "admin_initial_password" {
length = 32
}
resource "random_uuid" "dolibarr_id" { # used for encryption as well as when buying modules
lifecycle {
prevent_destroy = true
}
}
resource "vault_kv_secret_v2" "dolibarr_admin_setup" {
mount = module.app_roles.mount_paths.kvv2
name = format("%sconfig", module.app_roles.kvv2_path_prefix)
data_json = jsonencode(
{
DOLI_ADMIN_LOGIN = "admin",
DOLI_ADMIN_PASSWORD = random_password.admin_initial_password.result
DOLI_INSTANCE_UNIQUE_ID = random_uuid.dolibarr_id.result
}
)
}