Proper tracking of Charmed Install
[osm/devops.git] / installers / charmed_uninstall.sh
1 #! /bin/bash
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 #
15
16
17 juju destroy-model osm --destroy-storage -y --force --no-wait
18 sudo snap unalias osm
19 sudo snap remove osmclient
20 CONTROLLER_NAME="osm-vca"
21 CONTROLLER_PRESENT=$(juju controllers 2>/dev/null| grep ${CONTROLLER_NAME} | wc -l)
22 if [[ $CONTROLLER_PRESENT -ge 1 ]]; then
23 cat << EOF
24 The VCA with the name "${CONTROLLER_NAME}" has been left in place to ensure that no other
25 applications are using it. If you are sure you wish to remove this controller,
26 please execute the following command:
27
28 juju destroy-controller --release-storage --destroy-all-models -y ${CONTROLLER_NAME}
29
30 EOF
31 fi