Pattern-match node names for VM backup exclusion
This commit is contained in:
parent
1e9878d17e
commit
b1763cd032
@ -45,9 +45,9 @@
|
||||
"kosmos_kvm": {
|
||||
"backup": {
|
||||
"nodes_excluded": [
|
||||
"garage-2", "garage-3", "garage-4",
|
||||
"postgres-5",
|
||||
"rsk-mainnet-2", "rsk-testnet-3"
|
||||
"garage-",
|
||||
"rsk-",
|
||||
"postgres-5"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user