X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fjoid%2Fjoid-deploy.sh;h=59ba01588bcd053aed8b942e3b8a1eefc3923875;hb=4ff7399fd66525743b3cfd7e3e46d8efc13f0ed5;hp=747332cabf2cf1ef719786cd2a4928df2701757a;hpb=84b8baf7b07c76743948e45ca532c5ce7de3e6a0;p=releng.git diff --git a/jjb/joid/joid-deploy.sh b/jjb/joid/joid-deploy.sh index 747332cab..59ba01588 100644 --- a/jjb/joid/joid-deploy.sh +++ b/jjb/joid/joid-deploy.sh @@ -1,4 +1,12 @@ #!/bin/bash +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2016 Orange and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## set +e set -o nounset @@ -119,23 +127,16 @@ SRCBUNDLE="${SRCBUNDLE}/ovs-${SDN_CONTROLLER}-${HA_MODE}.yaml" # Modify Bundle echo "------ Set openstack password ------" -sed -i -- "s/\"admin-password\": openstack/\"admin-password\": $OS_ADMIN_PASSWORD/" $SRCBUNDLE +sed -i -- "s/admin-password: openstack/admin-password: $OS_ADMIN_PASSWORD/" $SRCBUNDLE if [ -n "$EXTNET_NAME" ]; then echo "------ Set openstack default network ------" - sed -i -- "s/\"neutron-external-network\": ext_net/\"neutron-external-network\": $EXTNET_NAME/" $SRCBUNDLE + sed -i -- "s/neutron-external-network: ext_net/neutron-external-network: $EXTNET_NAME/" $SRCBUNDLE fi echo "------ Set ceph disks ------" -CEPH_DISKS_CONTROLLERS=${CEPH_DISKS_CONTROLLERS:-} -if [ -z "$CEPH_DISKS_CONTROLLERS" ]; then - CEPH_DISKS_CONTROLLERS=$CEPH_DISKS -fi - #Find the first line of osd-devices to change the one for ceph, then the other for ceph-osd -CEPH_DEV_LINE=$(grep -nr osd-devices $SRCBUNDLE |head -n1|cut -d: -f1) -sed -i -- "${CEPH_DEV_LINE}s@osd-devices: /srv@osd-devices: $CEPH_DISKS@" $SRCBUNDLE -sed -i -- "s@osd-devices: /srv@osd-devices: $CEPH_DISKS_CONTROLLERS@" $SRCBUNDLE +sed -i -- "s@osd-devices: /srv@osd-devices: $CEPH_DISKS@" $SRCBUNDLE sed -i -r -- "s/^(\s+osd-reformat: )'no'/\1'$CEPH_REFORMAT'/" $SRCBUNDLE ## @@ -153,9 +154,31 @@ exit_on_error $? "Main deploy FAILED" ## JOID_ADMIN_OPENRC=$LAB_CONFIG/admin-openrc echo "------ Create OpenRC file [$JOID_ADMIN_OPENRC] ------" -KEYSTONE=$(cat bundles.yaml |shyaml get-value openstack-phase2.services.keystone.options.vip) -ODL_CONTROLLER=$(juju status odl-controller/0 |grep public-address|sed -- 's/.*\: //') -ODL_PASSWORD=admin + +# get Keystone ip +case "$HA_MODE" in + "ha") + KEYSTONE=$(cat bundles.yaml |shyaml get-value openstack-phase2.services.keystone.options.vip) + ;; + *) + KEYSTONE=$(juju status keystone |grep public-address|sed -- 's/.*\: //') + ;; +esac + + +# get controller IP +case "$SDN_CONTROLLER" in + "odl") + SDN_CONTROLLER_IP=$(juju status odl-controller/0 |grep public-address|sed -- 's/.*\: //') + ;; + "onos") + SDN_CONTROLLER_IP=$(juju status onos-controller/0 |grep public-address|sed -- 's/.*\: //') + ;; + *) + SDN_CONTROLLER_IP='none' + ;; +esac +SDN_PASSWORD='admin' # export the openrc file cat << EOF > $JOID_ADMIN_OPENRC @@ -164,8 +187,8 @@ export OS_PASSWORD=$OS_ADMIN_PASSWORD export OS_TENANT_NAME=admin export OS_AUTH_URL=http://$KEYSTONE:5000/v2.0 export OS_REGION_NAME=Canonical -export ODL_CONTROLLER=$ODL_CONTROLLER -export ODL_PASSWORD=$ODL_PASSWORD +export SDN_CONTROLLER=$SDN_CONTROLLER_IP +export SDN_PASSWORD=$SDN_PASSWORD EOF ##