deploy dolibarr
This commit is contained in:
32
iac/main.tf
Normal file
32
iac/main.tf
Normal 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
|
||||
}
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user