From: lavado Date: Tue, 3 Dec 2019 21:19:59 +0000 (-0500) Subject: Uninstall node_exporter when removing OSM stack X-Git-Tag: v7.0.0rc1~10 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=1e4a88c85bc0786d57abdaded4ed3f64b6ffb344;p=osm%2Fdevops.git Uninstall node_exporter when removing OSM stack Change-Id: I71680b2924e307738742efb69173c883662a605a Signed-off-by: lavado --- diff --git a/installers/docker/docker-compose.yaml b/installers/docker/docker-compose.yaml index 7070edd0..340cb846 100644 --- a/installers/docker/docker-compose.yaml +++ b/installers/docker/docker-compose.yaml @@ -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: diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 777c855d..0bf2e200 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -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