Uninstall node_exporter when removing OSM stack 04/8304/2
authorlavado <glavado@whitestack.com>
Tue, 3 Dec 2019 21:19:59 +0000 (16:19 -0500)
committerlavado <glavado@whitestack.com>
Wed, 4 Dec 2019 10:43:17 +0000 (05:43 -0500)
Change-Id: I71680b2924e307738742efb69173c883662a605a
Signed-off-by: lavado <glavado@whitestack.com>
installers/docker/docker-compose.yaml
installers/full_install_osm.sh

index 7070edd..340cb84 100644 (file)
@@ -108,7 +108,7 @@ services:
       - /var/lib/docker/:/var/lib/docker:ro
       - /dev/disk/:/dev/disk:ro
     networks:
-      - netOSM    
+      - netOSM
   keystone:
     image: ${DOCKER_USER:-opensourcemano}/keystone:${TAG:-6}
     networks:
index 777c855..0bf2e20 100755 (executable)
@@ -194,6 +194,7 @@ function uninstall_lightweight() {
         else
             remove_stack $OSM_STACK_NAME
             remove_stack osm_elk
+            uninstall_prometheus_nodeexporter
         fi
         echo "Now osm docker images and volumes will be deleted"
         newgrp docker << EONG
@@ -615,6 +616,16 @@ function install_prometheus_nodeexporter(){
     return 0
 }
 
+function uninstall_prometheus_nodeexporter(){
+    sudo systemctl stop node_exporter
+    sudo systemctl disable node_exporter
+    sudo rm /etc/systemd/system/node_exporter.service
+    sudo systemctl daemon-reload
+    sudo userdel node_exporter
+    sudo rm /usr/local/bin/node_exporter
+    return 0
+}
+
 function install_from_lxdimages(){
     LXD_RELEASE=${RELEASE#"-R "}
     if [ -n "$LXD_REPOSITORY_PATH" ]; then