Pattern-match node names for VM backup exclusion

This commit is contained in:
Râu Cao
2023-12-05 18:04:57 +01:00
parent 1e9878d17e
commit b1763cd032
2 changed files with 4 additions and 4 deletions

View File

@@ -54,7 +54,7 @@ end
vm_domains = search(:node, "role:kvm_guest").map{|n| n["hostname"] } \
& `virsh list --name`.strip.chomp.split("\n")
vm_domains.reject! { |d| node["kosmos_kvm"]["backup"]["nodes_excluded"].include?(d) }
vm_domains.reject! { |d| node["kosmos_kvm"]["backup"]["nodes_excluded"].any?{ |n| d.match?(/^#{n}/) } }
template "/root/backups/backup_all_vms.sh" do
source "backup_all_vms.sh.erb"