- #copy the script which needs to get deployed as part of ofnfv release
- echo "...... deploying now ......"
- echo " " >> environments.yaml
- echo " enable-os-refresh-update: false" >> environments.yaml
- echo " enable-os-upgrade: false" >> environments.yaml
- echo " admin-secret: admin" >> environments.yaml
- echo " default-series: $opnfvdistro" >> environments.yaml
+ # Install MAAS and expecting the labconfig.yaml at local directory.
+
+ if [ "$maasinstall" -eq 1 ]; then
+ ./clean.sh || true
+ PROFILE=${PROFILE:-ubuntu}
+ MAAS_IP=$(grep " ip_address" deployconfig.yaml | cut -d ':' -f 2 | sed -e 's/ //')
+ API_SERVER="http://$MAAS_IP:5240/MAAS/api/2.0"
+ if which maas > /dev/null; then
+ API_KEY=`sudo maas-region apikey --username=ubuntu`
+ maas login $PROFILE $API_SERVER $API_KEY
+
+ # make sure there is no machine entry in maas
+ for m in $(maas $PROFILE machines read | jq -r '.[].system_id')
+ do
+ maas $PROFILE machine delete $m || true
+ done
+ podno=$(maas $PROFILE pods read | jq -r ".[]".id)
+ maas $PROFILE pod delete $podno || true
+ fi
+ ./cleanvm.sh || true
+
+ if [ "$virtinstall" -eq 1 ]; then
+ ./03-maasdeploy.sh virtual
+ else
+ if [ -z "$labfile" ]; then
+ if [ ! -e ./labconfig.yaml ]; then
+ echo_error "Labconfig file must be specified when using custom"
+ else
+ echo_warning "Labconfig was not specified, using ./labconfig.yaml instead"
+ fi
+ elif [ ! -e "$labfile" ]; then
+ echo_warning "Labconfig not found locally, trying download"
+ wget $labfile -t 3 -T 10 -O ./labconfig.yaml || true
+ count=`wc -l labconfig.yaml | cut -d " " -f 1`
+ if [ $count -lt 10 ]; then
+ echo_error "Unable to download labconfig"
+ exit 1
+ fi
+ else
+ echo_info "Using $labfile to setup deployment"
+ cp $labfile ./labconfig.yaml
+ fi
+
+ ./03-maasdeploy.sh custom
+ fi
+ fi