}
fi
+function track(){
+ ctime=`date +%s`
+ duration=$((ctime - SESSION_ID))
+ url="http://www.woopra.com/track/ce?project=osm.etsi.org&cookie=${SESSION_ID}"
+ event_name="bin"
+ event_name="${event_name}_$1"
+ url="${url}&event=${event_name}&ce_duration=${duration}"
+ wget -q -O /dev/null $url
+}
+
+function FATAL_TRACK(){
+ track
+ exit 1
+}
+
MODEL_NAME=osm
ssl-hostname-verification: false
EOF
openssl req -nodes -new -x509 -keyout ~/.osm/client.key -out ~/.osm/client.crt -days 365 -subj "/C=FR/ST=Nice/L=Nice/O=ETSI/OU=OSM/CN=osm.etsi.org"
- local server_cert=`cat /var/snap/lxd/common/lxd/server.crt | sed 's/^/ /'`
- local client_cert=`cat ~/.osm/client.crt | sed 's/^/ /'`
- local client_key=`cat ~/.osm/client.key | sed 's/^/ /'`
-
cat << EOF > $LXD_CREDENTIALS
credentials:
lxd-cloud:
lxd-cloud:
auth-type: certificate
- server-cert: |
-$server_cert
- client-cert: |
-$client_cert
- client-key: |
-$client_key
+ server-cert: /var/snap/lxd/common/lxd/server.crt
+ client-cert: ~/.osm/client.crt
+ client-key: ~/.osm/client.key
EOF
lxc config trust add local: ~/.osm/client.crt
fi
juju config -m $MODEL_NAME prometheus site_url=https://prometheus.${API_SERVER}.nip.io
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"
}