generated from CC/VMServiceTemplate
n8n ansible base
This commit is contained in:
17
terraform/modules/proxmox_vm_data/main.tf
Normal file
17
terraform/modules/proxmox_vm_data/main.tf
Normal file
@@ -0,0 +1,17 @@
|
||||
locals {
|
||||
vm_data = {
|
||||
vm_tag_data = {
|
||||
for k, v in var.instances :
|
||||
k => {
|
||||
node_name = v.node_name
|
||||
vm_name = v.vm_name
|
||||
tags = v.vm_tags
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "local_file" "vm_data" {
|
||||
filename = var.filename
|
||||
content = yamlencode(local.vm_data)
|
||||
}
|
||||
7
terraform/modules/proxmox_vm_data/outputs.tf
Normal file
7
terraform/modules/proxmox_vm_data/outputs.tf
Normal file
@@ -0,0 +1,7 @@
|
||||
output "filename" {
|
||||
value = local_file.vm_data.filename
|
||||
}
|
||||
|
||||
output "content" {
|
||||
value = local_file.vm_data.content
|
||||
}
|
||||
15
terraform/modules/proxmox_vm_data/variables.tf
Normal file
15
terraform/modules/proxmox_vm_data/variables.tf
Normal file
@@ -0,0 +1,15 @@
|
||||
variable "filename" {
|
||||
description = "Path to write the vm_data.yml file"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "instances" {
|
||||
description = "Normalized instance map keyed by instance key"
|
||||
type = map(object({
|
||||
service_name = string
|
||||
vm_name = string
|
||||
node_name = string
|
||||
ipv4_address = string
|
||||
vm_tags = list(string)
|
||||
}))
|
||||
}
|
||||
Reference in New Issue
Block a user