From 105ce627fb73dc5e14f1767f59f708ab6efa6943 Mon Sep 17 00:00:00 2001
From: Pekka Helenius <pekka.helenius@fjordtek.com>
Date: Thu, 27 Jan 2022 14:09:58 +0200
Subject: [PATCH] Update CloudStack post_remove function

---
 cloudstack/cloudstack-management.install | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/cloudstack/cloudstack-management.install b/cloudstack/cloudstack-management.install
index 332ebc3..a6840c4 100644
--- a/cloudstack/cloudstack-management.install
+++ b/cloudstack/cloudstack-management.install
@@ -31,6 +31,9 @@ post_install() {
 #post_upgrade() {
 #}
 
-#post_remove() {
-#  rm -rf /var/lib/cloudstack/user
-#}
+post_remove() {
+  msg2 "CloudStack logs are stored at '/var/log/cloudstack'"
+  rm -rf /var/lib/cloudstack
+  userdel cloud
+  systemctl restart systemd-networkd
+}