initial commit

This commit is contained in:
Gregor Michels 2023-10-26 16:45:29 +02:00
commit 74412c51a4
9 changed files with 229 additions and 0 deletions

27
delete_organisation Executable file
View file

@ -0,0 +1,27 @@
#!/bin/sh
set -e
ORGA=$1
usage() {
printf "usage: %s <organisation_name>\n" $0
}
# check if we where correctly called
[ $# != 1 ] && usage && exit 1
# remove storage from storage pool
pveum pool modify "${ORGA}" --storage "${ORGA}-images" --delete
# remove proxmox storage object
pvesm remove "${ORGA}-images"
# nuke zfs filesystem with isos and backups
zfs destroy rpool/customer/${ORGA}-images
# delete resource pool for the organisation
pveum pool delete "${ORGA}"
# delete group
pveum group delete "${ORGA}"