Exclude specified nodes/VMs from image backups
This commit is contained in:
parent
a85bbc4a3e
commit
9568b7072d
@ -34,6 +34,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"kosmos_kvm": {
|
||||
"backup": {
|
||||
"nodes_excluded": [
|
||||
"garage-2", "garage-3", "garage-4",
|
||||
"postgres-5",
|
||||
"rsk-mainnet-2", "rsk-testnet-3"
|
||||
]
|
||||
}
|
||||
},
|
||||
"kosmos-mastodon": {
|
||||
"domain": "kosmos.social",
|
||||
"s3_endpoint": "http://localhost:3900",
|
||||
|
@ -8,3 +8,5 @@ node.default["kosmos_kvm"]["host"]["qemu_base_image"] = {
|
||||
|
||||
# A systemd.timer OnCalendar config value
|
||||
node.default["kosmos_kvm"]["backup"]["schedule"] = "daily"
|
||||
# Node/VM names excluded from backups
|
||||
node.default["kosmos_kvm"]["backup"]["nodes_excluded"] = []
|
||||
|
@ -54,6 +54,8 @@ 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) }
|
||||
|
||||
template "/root/backups/backup_all_vms.sh" do
|
||||
source "backup_all_vms.sh.erb"
|
||||
mode '0750'
|
||||
|
Loading…
x
Reference in New Issue
Block a user