Adding the maas deployment script. This will deploy the maas in a
[joid.git] / ci / 02-maasdeploy.sh
1 #!/bin/bash
2 #placeholder for deployment script.
3 set -ex
4
5 case "$1" in
6     'intelpod5' )
7         cp intel/pod5/maas/deployment.yaml ./deployment.yaml
8         ;;
9     * )
10         cp intel/pod5/maas/deployment.yaml ./deployment.yaml
11         ;;
12 esac
13
14 echo "... Deployment of maas Started ...."
15 sudo apt-add-repository ppa:maas-deployers/stable -y
16 sudo apt-get update -y
17 sudo apt-get install maas-deployer -y
18 if [ ! -e /home/ubuntu/.ssh/id_rsa ]; then
19     ssh-keygen -N '' -f /home/ubuntu/.ssh/id_rsa
20 fi
21 sudo adduser ubuntu libvirtd
22 cat /home/ubuntu/.ssh/id_rsa.pub > /home/ubuntu/.ssh/authorized_keys
23 maas-deployer -c deployment.yaml -d --force
24 echo "... Deployment of maas finish ...."
25
26 maas_ip=`grep " ip_address" deployment.yaml | cut -d ":"  -f 2`
27
28 #echo "... Deployment of opnfv release Started ...."
29 python deploy.py $maas_ip
30 #echo "... Deployment of opnfv release finished ...."
31