Bug 1530: Limit IP addresses
[osm/devops.git] / installers / charmed_install.sh
index 577fe82..bd714a6 100755 (executable)
@@ -286,6 +286,10 @@ function deploy_charmed_osm(){
 
     echo "Waiting for deployment to finish..."
     check_osm_deployed
+    grafana_leader=`juju status -m $MODEL_NAME grafana | grep "*" | cut -d "*" -f 1`
+    grafana_admin_password=`juju run -m $MODEL_NAME --unit $grafana_leader "echo \\$GF_SECURITY_ADMIN_PASSWORD"`
+    juju config -m $MODEL_NAME mon grafana_password=$grafana_admin_password
+    check_osm_deployed
     echo "OSM with charms deployed"
 }
 
@@ -446,8 +450,8 @@ function install_microstack() {
     version: 3}'
 }
 
-DEFAULT_IF=`ip route list match 0.0.0.0 | awk '{print $5}'`
-DEFAULT_IP=`ip -o -4 a |grep ${DEFAULT_IF}|awk '{split($4,a,"/"); print a[1]}'`
+DEFAULT_IF=`ip route list match 0.0.0.0 | awk '{print $5; exit}'`
+DEFAULT_IP=`ip -o -4 a |grep ${DEFAULT_IF}|awk '{split($4,a,"/"); print a[1]; exit}'`
 
 check_arguments $@
 mkdir -p ~/.osm