Skip to content

Commit

Permalink
clean resource first
Browse files Browse the repository at this point in the history
  • Loading branch information
fewensa authored Nov 25, 2024
1 parent 045d096 commit a88ca53
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ansible/roles/snapshots/templates/take.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,17 @@ take_node_snapshots() {
rm -rf ${SNAPSHOTS_WORKDIR}
}

clean_resource() {
delete_snapshots || true
umount ${SNAPSHOTS_WORKDIR} || true
rm -rf ${SNAPSHOTS_WORKDIR} || true
detach_disk || true
delete_disk || true
}

main() {
install_deps
clean_resource
collect_chain_info
create_disk_snapshots
create_disk_from_snapshots
Expand Down

0 comments on commit a88ca53

Please sign in to comment.