2023-10-23 10:44:10 -04:00

82 lines
1.3 KiB
HCL

# Variables
# =====================
variable "tenant" {
description = "Tenant informations"
type = any
default = {}
}
variable "deploy" {
description = "Deployment options"
type = any
default = {}
}
variable "catalog" {
description = "CAtalog informations"
type = any
default = {}
}
variable "deployment_defaults" {
description = "Default stack"
type = any
default = {}
}
variable "deployments" {
description = "Deployments configuration"
type = any
default = {}
}
# Resources
# =====================
locals {
# Fetch stack name
deployment_name = try(
var.deploy.deployment_name,
"default"
)
# Proceed to chained merges
deployment = merge(
var.deployment_defaults,
try(
var.deployments[local.deployment_name], {}
)
)
}
module "virt_deployment" {
source = "../virt_deployment"
tenant = var.tenant
deploy = merge(var.deploy, {deployment_name = local.deployment_name})
catalog = var.catalog
deployment = local.deployment
}
#module "iaas_inv_ansible" {
# source = "../iaas_inv_ansible"
# payload = var.config
#}
# Output
# =====================
// output "namespace" {
// value = module.virt_namespace
// }
output "deployment" {
value = local.deployment
}