From a202dc8ef3b7dc4b5583deca2422a25e59ca12d4 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Tue, 26 Mar 2024 21:22:53 +0100 Subject: [PATCH] fix: use include match for server_netif_filter (#6) Reviewed-on: https://gitea.rknet.org/infra/pve-server-tf/pulls/6 Co-authored-by: Robert Kaussow Co-committed-by: Robert Kaussow --- main.tf | 4 ++-- variables.tf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.tf b/main.tf index 548492a..3fba165 100644 --- a/main.tf +++ b/main.tf @@ -2,7 +2,7 @@ locals { ipv4_addresses = { for server_key, server in var.server : server.name => flatten([ 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 = { for server_key, server in var.server : server.name => flatten([ 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 ]) } } diff --git a/variables.tf b/variables.tf index be99d5a..b37a3a4 100644 --- a/variables.tf +++ b/variables.tf @@ -46,5 +46,5 @@ variable "server_guest_agent" { variable "server_netif_filter" { type = string - default = "^(lo|docker|veth).*" + default = "^(eth|ens|enp).+" }