X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fjoid%2Fjoid-deploy.sh;h=37b0c0dc324c1c8b272d8c56ce7cac1d400afaf7;hb=fd0f8c5c707f94589ef94558c0abe4abc33b014f;hp=cdf92a785cfae23983a43f121326851af79c6c0f;hpb=f716c828d44779dbc7afa7aa8f24f20294cab1f6;p=releng.git diff --git a/jjb/joid/joid-deploy.sh b/jjb/joid/joid-deploy.sh index cdf92a785..37b0c0dc3 100644 --- a/jjb/joid/joid-deploy.sh +++ b/jjb/joid/joid-deploy.sh @@ -48,10 +48,6 @@ fi ## # This part will be removed when pod names will be synced between jenkins and joid config case $NODE_NAME in - orange-fr-pod2) - POD=orange-pod2 ;; - juniper-us-test-1) - POD=juniper-pod1 ;; *virtual*) POD=default ;; *) @@ -127,23 +123,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 ## @@ -151,9 +140,9 @@ sed -i -r -- "s/^(\s+osd-reformat: )'no'/\1'$CEPH_REFORMAT'/" $SRCBUNDLE ## echo "------ Deploy with juju ------" -echo "Execute: ./deploy.sh -t $HA_MODE -o $OS_RELEASE -s $SDN_CONTROLLER -l $POD_NAME" +echo "Execute: ./deploy.sh -t $HA_MODE -o $OS_RELEASE -s $SDN_CONTROLLER -l $POD_NAME -d $UBUNTU_DISTRO -f $NFV_FEATURES" -./deploy.sh -t $HA_MODE -o $OS_RELEASE -s $SDN_CONTROLLER -l $POD_NAME +./deploy.sh -t $HA_MODE -o $OS_RELEASE -s $SDN_CONTROLLER -l $POD_NAME -d $UBUNTU_DISTRO -f $NFV_FEATURES exit_on_error $? "Main deploy FAILED" ## @@ -162,12 +151,20 @@ exit_on_error $? "Main deploy FAILED" JOID_ADMIN_OPENRC=$LAB_CONFIG/admin-openrc echo "------ Create OpenRC file [$JOID_ADMIN_OPENRC] ------" -# get Keystone vip -KEYSTONE=$(cat bundles.yaml |shyaml get-value openstack-phase2.services.keystone.options.vip) +# 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_l2" | "odl_l3") + "odl") SDN_CONTROLLER_IP=$(juju status odl-controller/0 |grep public-address|sed -- 's/.*\: //') ;; "onos") @@ -184,10 +181,17 @@ cat << EOF > $JOID_ADMIN_OPENRC export OS_USERNAME=admin export OS_PASSWORD=$OS_ADMIN_PASSWORD export OS_TENANT_NAME=admin -export OS_AUTH_URL=http://$KEYSTONE:5000/v2.0 +export OS_AUTH_URL=http://$KEYSTONE:35357/v2.0 export OS_REGION_NAME=Canonical +export OS_ENDPOINT_TYPE='adminURL' +export CINDER_ENDPOINT_TYPE='adminURL' +export GLANCE_ENDPOINT_TYPE='adminURL' +export KEYSTONE_ENDPOINT_TYPE='adminURL' +export NEUTRON_ENDPOINT_TYPE='adminURL' +export NOVA_ENDPOINT_TYPE='adminURL' export SDN_CONTROLLER=$SDN_CONTROLLER_IP export SDN_PASSWORD=$SDN_PASSWORD +export OS_INTERFACE=admin EOF ## @@ -219,29 +223,6 @@ curl -i -sw '%{http_code}' -H "Content-Type: application/json" -d " }" http://$KEYSTONE:5000/v3/auth/tokens |grep "HTTP/1.1 20" 2>&1 >/dev/null; exit_on_error $? "Deploy FAILED to auth to openstack" - -## -## Create external network if needed -## - -# If we have more information than only the name, try to create it -if [ -z "$EXTNET_TYPE" ]; then - echo "------ No data for external network creation, pass ------" -elif [[ "$DEPLOY_SCENARIO" =~ "onos" ]]; then - echo "------ ONOS have created the external network, pass ------" -else - echo "------ External network creation ------" - neutron net-create $EXTNET_NAME --router:external True \ - --provider:physical_network external --provider:network_type $EXTNET_TYPE - exit_on_error $? "External network creation failed" - neutron subnet-create $EXTNET_NAME --name $EXTNET_NAME \ - --allocation-pool start=$EXTNET_FIP,end=$EXTNET_LIP \ - --disable-dhcp --gateway $EXTNET_GW $EXTNET_NET - exit_on_error $? "External subnet creation failed" - neutron net-update $EXTNET_NAME --shared - exit_on_error $? "External network sharing failed" -fi - ## ## Exit success ##