Open jserras opened 2 years ago
Sorry for my English. I had the same problem. And i didn't find any solution with template and flatten. So i used dynamic block for hosts:
dns {
enabled = true
local_only = true
dynamic "hosts" {
for_each = local.servers
content {
hostname = hosts.key
ip = hosts.value.ips[0]
}
}
}
But you can't use dynamic block with count.
This is work for me:
dns {
enabled = true
local_only = true
dynamic "hosts" {
for_each = var.a_records
content {
hostname = hosts.value.hostname
ip = hosts.value.ip
}
}
}
System Information
Linux distribution
Linux Mint 20.2
Terraform version
Provider and libvirt versions
Checklist
[ ] Is your issue/contribution related with enabling some setting/option exposed by libvirt that the plugin does not yet support, or requires changing/extending the provider terraform schema?
[ ] Is it a bug or something that does not work as expected? Please make sure you fill the version information below:
Description of Issue/Question
I'm trying to create some additional A records on the created environment, and I'm using the description at the bottom of network.markdown but fails, I checked in the source code in data_source_libvirt_network.go and the example there is a bit different, and it fails in either construct, but the example in source seems more correct, anyway the error I get is
Setup
the data that fails to parse is the following from variables.tf:
from main.tf
Steps to Reproduce Issue
(Include debug logs if possible and relevant).
Additional information:
Do you have SELinux or Apparmor/Firewall enabled? Some special configuration? no Have you tried to reproduce the issue without them enabled? yes static config like in network.markdown actually works ok