fix: use include match for server_netif_filter
All checks were successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build-package Pipeline was successful

This commit is contained in:
Robert Kaussow 2024-03-26 21:20:26 +01:00
parent a0fa66b93e
commit af54308f57
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
2 changed files with 3 additions and 3 deletions

View File

@ -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(try(server.netif_filter, var.server_netif_filter), 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(try(server.netif_filter, var.server_netif_filter), 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
]) ])
} }
} }

View File

@ -46,5 +46,5 @@ variable "server_guest_agent" {
variable "server_netif_filter" { variable "server_netif_filter" {
type = string type = string
default = "^(lo|docker|veth).*" default = "^(eth|ens|enp).+"
} }