X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=prototypes%2Fsfc_tacker%2Fpoc.tacker-up.sh;h=4dbb37240e3f984ba6a48b00e5f0d457cdd50a9d;hb=271dc336e71086af7f14a9585af71bb261557035;hp=8377b805518fd34612a8e65e0dd58a5db87cfaa7;hpb=2b5a8776687cb5954cbd46ddf567cdc6ecba7e17;p=fuel.git diff --git a/prototypes/sfc_tacker/poc.tacker-up.sh b/prototypes/sfc_tacker/poc.tacker-up.sh index 8377b8055..4dbb37240 100755 --- a/prototypes/sfc_tacker/poc.tacker-up.sh +++ b/prototypes/sfc_tacker/poc.tacker-up.sh @@ -1,6 +1,5 @@ #!/bin/bash - # # POC Script to build/install/deploy/orchestrate Tacker on an OPNFV Brhamaputra Fuel cluster # Script assuming it runs on the openstack primary controller (where is opendaylight @@ -11,10 +10,9 @@ # # (c) 2016 Telefonaktiebolaget L. M. ERICSSON # -# 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 +# 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 # @@ -25,16 +23,16 @@ MYREPO="tacker-server" CLIREPO="tacker-client" DEPREPO="jsonrpclib" -CLIENT="python-python-tackerclient_0.0.1~dev48-1_all.deb" -JSONRPC="python-jsonrpclib_0.1.7-1_all.deb" -SERVER="python-tacker_2014.2.0~dev176-1_all.deb" +CLIENT=$(echo python-python-tackerclient_*_all.deb) +JSONRPC=$(echo python-jsonrpclib_*_all.deb) +SERVER=$(echo python-tacker_*_all.deb) # Function checks whether crudini is available, if not - installs function chkCrudini () { if [[ ! -f '/usr/bin/crudini' ]]; then wget -N http://mirrors.kernel.org/ubuntu/pool/universe/p/python-iniparse/python-iniparse_0.4-2.1build1_all.deb wget -N http://archive.ubuntu.com/ubuntu/pool/universe/c/crudini/crudini_0.3-1_amd64.deb - dpkg -i python-iniparse_0.4-2.1build1_all.deb crudini_0.3-1_amd64.deb crudini_0.3-1_amd64.deb + dpkg -i python-iniparse_0.4-2.1build1_all.deb crudini_0.3-1_amd64.deb fi } @@ -76,6 +74,7 @@ function deployJsonrpclib () { dpkg --purge python-jsonrpclib python setup.py --command-packages=stdeb.command bdist_deb cd "deb_dist" + JSONRPC=$(echo python-jsonrpclib_*_all.deb) cp $JSONRPC $MYDIR dpkg -i $JSONRPC } @@ -119,6 +118,9 @@ EOFSCP # Function corrects and installs the Tacker-server debian package function blessPackage () { + pushd "${MYDIR}/${MYREPO}/deb_dist" + SERVER=$(echo python-tacker_*_all.deb) + popd DEBFILE="${MYDIR}/${MYREPO}/deb_dist/${SERVER}" TMPDIR=$(mktemp -d /tmp/deb.XXXXXX) || exit 1 OUTPUT=$(basename "$DEBFILE") @@ -146,9 +148,9 @@ diff -ruN a/DEBIAN/control b/DEBIAN/control EOFDC cd "$MYDIR" echo "Patching deb..." - dpkg -b "$TMPDIR" "${MYDIR}/${OUTPUT}" + dpkg -b "$TMPDIR" "${MYDIR}/${SERVER}" rm -r "$TMPDIR" - dpkg -i "${MYDIR}/${OUTPUT}" + dpkg -i "${MYDIR}/${SERVER}" } # Function deploys Tacker-server (installs missing mandatory files: upstart, default) @@ -212,21 +214,11 @@ function deployTackerClient() { dpkg --purge python-tackerclient git clone -b 'SFC_refactor' https://github.com/trozet/python-tackerclient.git $CLIREPO cd $CLIREPO -# patch -p 1 < configure_tacker.pp << EOF @@ -289,7 +287,7 @@ function orchestarte () { class { 'tacker': package_ensure => 'absent', client_package_ensure => 'absent', - bind_host => '${mgmt_addr}', + bind_port => '${bind_port}', keystone_password => '${myPassword}', keystone_tenant => '${service_tenant}', auth_uri => '${auth_uri}', @@ -304,7 +302,6 @@ function orchestarte () { class { 'tacker::db::mysql': password => '${myPassword}', - host => '${sql_host}', allowed_hosts => ${allowed_hosts}, } @@ -327,11 +324,12 @@ export OS_NO_CACHE='true' export OS_TENANT_NAME='${service_tenant}' export OS_PROJECT_NAME='${service_tenant}' export OS_USERNAME='tacker' -export OS_PASSWORD='tacker' +export OS_PASSWORD='${myPassword}' export OS_AUTH_URL='${auth_uri}' export OS_DEFAULT_DOMAIN='default' export OS_AUTH_STRATEGY='keystone' -export OS_REGION_NAME='RegionOne' +export OS_REGION_NAME='${myRegion}' +export TACKER_ENDPOINT_TYPE='internalURL' EOFRC chmod +x tackerc } @@ -346,12 +344,24 @@ function populate_rc() { myaddr=$(ifconfig br-fw-admin | sed -n '/inet addr/s/.*addr.\([^ ]*\) .*/\1/p') for anode in $clusternodes ; do if [ "$anode" != "$myaddr" ] ; then - echo "populating seetings to $anode" - sshpass -p "r00tme" scp ${SSH_OPTIONS[@]} tackerc $anode:tackerc + echo "Populating seetings to $anode" + scp ${SSH_OPTIONS[@]} tackerc $anode:tackerc fi done } + +#Configure ODL so that it allows the coexistence between Netvirt and SFC +function coexistence() { + curl -i -u admin:admin -H 'Content-type: application/json' -X PUT \ + -d '{"netvirt-providers-config":{"table-offset":"1"}}' \ + http://${mgmt_addr}:${odl_port}/restconf/config/netvirt-providers-config:netvirt-providers-config + + curl -i -u admin:admin -H 'Content-type: application/json' -X PUT \ + -d '{"sfc-of-renderer-config":{"sfc-of-table-offset":"150","sfc-of-app-egress-table-offset":"11"}}' \ + http://${mgmt_addr}:${odl_port}/restconf/config/sfc-of-renderer:sfc-of-renderer-config +} + envSetup deployTackerClient deployJsonrpclib @@ -361,6 +371,7 @@ deployTackerServer populate_client orchestarte populate_rc +coexistence remove_repo "$MYREPO" remove_repo "$DEPREPO"