X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=ci%2F02-maasdeploy.sh;h=c90a4eb2d77883b7eb526cd28ee59bbfad89067b;hb=refs%2Fchanges%2F91%2F2191%2F1;hp=2df7c0a85644ab0fc6431d75abc1263aabb8f2ea;hpb=d63001c410ec8502802c6f2be9edd70fb102ac75;p=joid.git diff --git a/ci/02-maasdeploy.sh b/ci/02-maasdeploy.sh index 2df7c0a8..c90a4eb2 100755 --- a/ci/02-maasdeploy.sh +++ b/ci/02-maasdeploy.sh @@ -18,18 +18,16 @@ case "$1" in esac echo "... Deployment of maas Started ...." -sudo apt-add-repository ppa:maas-deployers/stable -y -sudo apt-get update -y -sudo apt-get install maas-deployer -y -if [ ! -e /home/ubuntu/.ssh/id_rsa ]; then - ssh-keygen -N '' -f /home/ubuntu/.ssh/id_rsa +if [ ! -e $HOME/.ssh/id_rsa ]; then + ssh-keygen -N '' -f $HOME/.ssh/id_rsa fi -sudo adduser ubuntu libvirtd -if [ ! 'virsh pool-list | grep default' ]; then +if [ ! -e /var/lib/libvirt/images ]; then - virsh pool-define /dev/stdin < default @@ -38,18 +36,30 @@ if [ ! 'virsh pool-list | grep default' ]; then EOF - virsh pool-start default - virsh pool-autostart default + sudo virsh pool-start default + sudo virsh pool-autostart default fi -cat /home/ubuntu/.ssh/id_rsa.pub >> /home/ubuntu/.ssh/authorized_keys +sudo apt-add-repository ppa:maas-deployers/stable -y +sudo apt-add-repository ppa:juju/stable -y +sudo apt-add-repository ppa:maas/stable -y +sudo apt-get update -y +sudo apt-get install git maas-deployer juju juju-deployer maas-cli -y +juju init -f + +cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys maas-deployer -c deployment.yaml -d --force + echo "... Deployment of maas finish ...." -maas_ip=`grep " ip_address" deployment.yaml | cut -d ":" -f 2` +maas_ip=`grep " ip_address" deployment.yaml | cut -d " " -f 10` +apikey=`grep maas-oauth: environments.yaml | cut -d "'" -f 2` +maas login maas http://${maas_ip}/MAAS/api/1.0 ${apikey} +maas maas boot-source-selections create 1 os="ubuntu" release="trusty" arches="amd64" subarches="*" labels="*" +maas maas boot-resources import #echo "... Deployment of opnfv release Started ...." -python deploy.py $maas_ip +#python deploy.py $maas_ip #echo "... Deployment of opnfv release finished ...."