2023-10-18 12:00:20 -04:00

82 lines
1.1 KiB
HCL

# Variables
# =====================
variable "cloud" {
description = "Cloud informations"
type = any
default = {}
}
variable "tenant" {
description = "Tenant informations"
type = any
default = {}
}
variable "deploy" {
description = "Deployment options"
type = any
default = {}
}
variable "stack" {
description = "Default stack"
type = any
default = {}
}
variable "stacks" {
description = "Deployments configuration"
type = any
default = []
}
# Resources
# =====================
locals {
# Fetch stack name
stack_name = try(
var.deploy.stack,
"main"
)
# Proceed to chained merges
stack = merge(
var.stack,
try(
var.stacks[local.stack_name], {}
)
)
}
module "virt_namespace" {
source = "../virt_namespace"
cloud = var.cloud
tenant = var.tenant
deploy = var.deploy
stack = local.stack
}
#module "iaas_inv_ansible" {
# source = "../iaas_inv_ansible"
# payload = var.config
#}
# Output
# =====================
output "namespace" {
value = module.virt_namespace
}
#output "iaas" {
# value = module.iaas_inv_ansible
#}