aboutsummaryrefslogtreecommitdiff
path: root/tools/cleanup-host
diff options
context:
space:
mode:
Diffstat (limited to 'tools/cleanup-host')
-rwxr-xr-xtools/cleanup-host17
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/cleanup-host b/tools/cleanup-host
index b0dfb4782..fc6e94320 100755
--- a/tools/cleanup-host
+++ b/tools/cleanup-host
@@ -77,14 +77,27 @@ fi
echo "Getting folders name..."
for dir in $FOLDER_PATH/*; do
+ skip="false"
+
+ for inventory in $kolla_ansible_inventories; do
+ if [ "$dir" == "$inventory" ]; then
+ skip="true"
+ break
+ fi
+ done
+
if [ "$dir" == "$FOLDER_PATH/passwords.yml" ] || \
[ "$dir" == "$FOLDER_PATH/globals.yml" ] || \
[ "$dir" == "$FOLDER_PATH/globals.d" ] || \
[ "$dir" == "$FOLDER_PATH/kolla-build.conf" ] || \
[ "$dir" == "$FOLDER_PATH/config" ] || \
[ "$dir" == "$FOLDER_PATH/certificates" ]; then
- echo "Skipping:" $dir
- else
+ echo "Skipping: $dir"
+ skip="true"
+ fi
+
+ # If it's not to be skipped, remove it
+ if [ "$skip" == "false" ]; then
rm -rfv $dir
fi
done