modified the disk
[joid.git] / ci / 02-maasdeploy.sh
index ca76539..4d3fdb0 100755 (executable)
@@ -14,8 +14,6 @@ sudo apt-get update -y
 sudo apt-get dist-upgrade -y
 sudo apt-get install openssh-server git maas-deployer juju juju-deployer maas-cli python-pip python-openstackclient gsutil -y
 
-cp maas/deployment.yaml ./deployment.yaml
-
 #first parameter should be custom and second should be either 
 # absolute location of file (including file name) or url of the 
 # file to download.
@@ -40,7 +38,7 @@ if [ "$1" == "custom" ]; then
         cp ../labconfig/default/deployment.yaml ./
         cp ../labconfig/default/labconfig.yaml ./
     fi
-    labname=`grep "lab_location" labconfig.yaml | cut -d ':' -f 2 | sed -e 's/ //'`
+    labname=`grep "maas_name" deployment.yaml | cut -d ':' -f 2 | sed -e 's/ //'`
 else
     case "$1" in
         'intelpod5' )
@@ -59,10 +57,14 @@ else
             python deploy.py
             ;;
         'orangepod1' )
-            cp maas/orange/pod1/deployment.yaml ./deployment.yaml
+            cp ../labconfig/orange/pod1/labconfig.yaml ./
+            #to be removed later once converted for all labs.
+            python deploy.py
             ;;
         'orangepod2' )
-            cp maas/orange/pod2/deployment.yaml ./deployment.yaml
+            cp ../labconfig/orange/pod1/labconfig.yaml ./
+            #to be removed later once converted for all labs.
+            python deploy.py
             ;;
         'attvirpod1' )
             cp maas/att/virpod1/deployment.yaml ./deployment.yaml
@@ -75,7 +77,7 @@ else
             ;;
         * )
             virtinstall=1
-            labname = "default"
+            labname="default"
             ./cleanvm.sh
             cp ../labconfig/default/deployment.yaml ./
             ;;
@@ -176,13 +178,13 @@ crnodevlanint() {
      done
  }
 
-#convert labconfig file to deployment.yaml to consume by MAAS.
-#python deploy.py
-
 #just make sure the ssh keys added into maas for the current user
 sed --i "s@/home/ubuntu@$HOME@g" ./deployment.yaml
 sed --i "s@qemu+ssh://ubuntu@qemu+ssh://$USER@g" ./deployment.yaml
 
+cp ./deployment.yaml ~/.juju/
+cp ./deployconfig.yaml ~/.juju/
+
 sudo maas-deployer -c deployment.yaml -d --force
 
 sudo chown $USER:$USER environments.yaml
@@ -234,13 +236,11 @@ fi
 case "$labname" in
     'intelpod5' )
         maas refresh
-        enableautomodebyname eth4 AUTO "10.5.12.0/24" compute || true
-        enableautomodebyname eth4 AUTO "10.5.12.0/24" control || true
+        enableautomode eth4 AUTO "10.5.12.0/24" || true
         ;;
     'intelpod6' )
         maas refresh
-        enableautomodebyname eth4 AUTO "10.6.12.0/24" compute || true
-        enableautomodebyname eth4 AUTO "10.6.12.0/24" control || true
+        enableautomode eth4 AUTO "10.6.12.0/24" || true
         ;;
     'intelpod9' )
         maas refresh
@@ -255,17 +255,15 @@ case "$labname" in
         ;;
     'orangepod1' )
         maas refresh
-        enableautomodebyname eth2 DHCP "192.168.21.0/24" compute || true
-        enableautomodebyname eth3 AUTO "192.168.11.0/24" compute || true
-        enableautomodebyname eth2 DHCP "192.168.21.0/24" control || true
-        enableautomodebyname eth3 AUTO "192.168.11.0/24" control || true
+        enableautomode eth2 DHCP "192.168.21.0/24" || true
+        enableautomode eth3 AUTO "192.168.11.0/24" || true
         ;;
     'orangepod2' )
         maas refresh
-        enableautomodebyname eth4 DHCP "192.168.22.0/24" compute || true
-        enableautomodebyname eth5 AUTO "192.168.12.0/24" compute || true
-        enableautomodebyname eth2 DHCP "192.168.22.0/24" control || true
-        enableautomodebyname eth3 AUTO "192.168.12.0/24" control || true
+        enableautomode eth4 DHCP "192.168.22.0/24" || true
+        enableautomode eth2 DHCP "192.168.22.0/24" || true
+        enableautomode eth5 AUTO "192.168.12.0/24" || true
+        enableautomode eth3 AUTO "192.168.12.0/24" || true
         ;;
     'attvirpod1' )
         enableautomodebyname eth1 AUTO "192.168.10.0/24" control || true