Fix bug 1770: pin osmclient to v11.0 track (charmed installer)
[osm/devops.git] / installers / charmed_install.sh
index 04a5678..bb1a9da 100755 (executable)
 
 # set -eux
 
+LXD_VERSION=4.0
 JUJU_VERSION=2.9
-JUJU_AGENT_VERSION=2.9.12
+JUJU_AGENT_VERSION=2.9.17
 K8S_CLOUD_NAME="k8s-cloud"
 KUBECTL="microk8s.kubectl"
 MICROK8S_VERSION=1.20
-OSMCLIENT_VERSION=10.0
+OSMCLIENT_VERSION=11.0
 IMAGES_OVERLAY_FILE=~/.osm/images-overlay.yaml
 PATH=/snap/bin:${PATH}
 
@@ -34,7 +35,7 @@ MODEL_NAME=osm
 # charms to CharmHub.
 OSM_BUNDLE=/usr/share/osm-devops/installers/charm/bundles/osm/bundle.yaml
 OSM_HA_BUNDLE=/usr/share/osm-devops/installers/charm/bundles/osm-ha/bundle.yaml
-TAG=testing-daily
+TAG=11
 
 function check_arguments(){
     while [ $# -gt 0 ] ; do
@@ -158,7 +159,7 @@ EOF
         sudo sysctl --system
         # Install LXD snap
         sudo apt-get remove --purge -y liblxc1 lxc-common lxcfs lxd lxd-client
-        sudo snap install lxd
+        sudo snap install lxd --channel $LXD_VERSION/stable
         # Configure LXD
         sudo usermod -a -G lxd `whoami`
         cat /usr/share/osm-devops/installers/lxd-preseed.conf | sed 's/^config: {}/config:\n  core.https_address: '$LXDENDPOINT':8443/' | sg lxd -c "lxd init --preseed"
@@ -285,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"
 }