tested n8n template

This commit is contained in:
CC
2026-05-22 21:59:40 +01:00
parent 7f84f1b2b6
commit 45a704709a
32 changed files with 1027 additions and 69 deletions

View File

@@ -0,0 +1,26 @@
locals {
inventory = {
all = {
vars = {
ansible_user = "cloud"
}
children = {
for svc in distinct([for k, v in var.instances : v.service_name]) :
svc => {
hosts = {
for k, v in var.instances :
v.vm_name => {
ansible_host = v.ipv4_address
}
if v.service_name == svc
}
}
}
}
}
}
resource "local_file" "inventory" {
filename = var.filename
content = yamlencode(local.inventory)
}