feat: add var server_netif_filter to overwrite interface filter
This commit is contained in:
parent
071b71fa5c
commit
004371f4c1
4
main.tf
4
main.tf
@ -2,7 +2,7 @@ locals {
|
|||||||
ipv4_addresses = {
|
ipv4_addresses = {
|
||||||
for server_key, server in var.server : server.name => flatten([
|
for server_key, server in var.server : server.name => flatten([
|
||||||
for k, v in coalescelist(proxmox_virtual_environment_vm.server[server.name].ipv4_addresses, []) :
|
for k, v in coalescelist(proxmox_virtual_environment_vm.server[server.name].ipv4_addresses, []) :
|
||||||
v if length(regexall("^(lo|docker|veth).*", proxmox_virtual_environment_vm.server[server.name].network_interface_names[k])) == 0
|
v if length(regexall(try(server.netif_filter, var.server_netif_filter), proxmox_virtual_environment_vm.server[server.name].network_interface_names[k])) == 0
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -11,7 +11,7 @@ locals {
|
|||||||
ipv6_addresses = {
|
ipv6_addresses = {
|
||||||
for server_key, server in var.server : server.name => flatten([
|
for server_key, server in var.server : server.name => flatten([
|
||||||
for k, v in coalescelist(proxmox_virtual_environment_vm.server[server.name].ipv6_addresses, []) :
|
for k, v in coalescelist(proxmox_virtual_environment_vm.server[server.name].ipv6_addresses, []) :
|
||||||
v if length(regexall("^(lo|docker|veth).*", proxmox_virtual_environment_vm.server[server.name].network_interface_names[k])) == 0
|
v if length(regexall(try(server.netif_filter, var.server_netif_filter), proxmox_virtual_environment_vm.server[server.name].network_interface_names[k])) == 0
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,3 +43,8 @@ variable "server_guest_agent" {
|
|||||||
type = bool
|
type = bool
|
||||||
default = false
|
default = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "server_netif_filter" {
|
||||||
|
type = string
|
||||||
|
default = "^(lo|docker|veth).*"
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user