5 #need to put mutiple cases here where decide this bundle to deploy by default use the odl bundle.
6 # Below parameters are the default and we can according the release
15 opnfvrel=`grep release: deploy.yaml | cut -d ":" -f2`
16 openstack=`grep openstack: deploy.yaml | cut -d ":" -f2`
17 opnfvtype=`grep type: deploy.yaml | cut -d ":" -f2`
18 opnfvlab=`grep lab: deploy.yaml | cut -d ":" -f2`
19 opnfvsdn=`grep sdn: deploy.yaml | cut -d ":" -f2`
22 usage() { echo "Usage: $0 [-s <nosdn|odl|opencontrail>]
25 [-l <default|intelpod5>]
26 [-r <a|b>]" 1>&2 exit 1; }
28 while getopts ":s:t:o:l:h:r:" opt; do
54 sudo apt-add-repository ppa:juju/stable -y
56 sudo apt-get install juju git juju-deployer -y
58 cp environments.yaml ~/.juju/
62 #copy the script which needs to get deployed as part of ofnfv release
63 echo "...... deploying now ......"
64 echo " " >> environments.yaml
65 echo " enable-os-refresh-update: false" >> environments.yaml
66 echo " enable-os-upgrade: false" >> environments.yaml
67 echo " admin-secret: admin" >> environments.yaml
68 echo " default-series: trusty" >> environments.yaml
70 cp environments.yaml ~/.juju/
72 cp ./$opnfvsdn/01-deploybundle.sh ./01-deploybundle.sh
76 ./01-deploybundle.sh $opnfvtype $openstack $opnfvlab
80 while [ $? -eq 0 ]; do
82 echo " still executing the reltionship within charms ..."
83 juju status | grep executing > /dev/null
85 echo "...... deployment finishing ......."
90 echo" " > ./cloud/admin-openrc
91 echo "export OS_USERNAME=$1" >> ./cloud/admin-openrc
92 echo "export OS_PASSWORD=$2" >> ./cloud/admin-openrc
93 echo "export OS_TENANT_NAME=$3" >> ./cloud/admin-openrc
94 echo "export OS_AUTH_URL=$4" >> ./cloud/admin-openrc
95 echo "export OS_REGION_NAME=$5" >> ./cloud/admin-openrc
100 juju status | python -c "import yaml; import sys; print yaml.load(sys.stdin)[\"services\"][\"$1\"][\"units\"][\"$1/$2\"][\"public-address\"]" 2> /dev/null
105 mkdir -m 0700 -p cloud
107 controller_address=$(unitAddress keystone 0)
108 configOpenrc admin openstack admin http://$controller_address:5000/v2.0 Canonical
109 chmod 0600 cloud/admin-openrc
112 if [ "$#" -eq 0 ]; then
113 echo "This installtion will use deploy.yaml"
117 echo "...... deployment started ......"
121 echo "...... deployment finished ......."
123 echo "...... creating OpenRc file for consuming by various user ......."
127 echo "...... finished ......."