added to workaround MAAS bug where commisoning of node fails. 17/28417/1
authorNarinder Gupta <narinder.gupta@canonical.com>
Fri, 10 Feb 2017 08:50:21 +0000 (02:50 -0600)
committerNarinder Gupta <narinder.gupta@canonical.com>
Fri, 10 Feb 2017 08:50:21 +0000 (02:50 -0600)
Change-Id: I021a0da8c0e6ac5b7c83ee7d8d152dd446d69924
Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
ci/03-maasdeploy.sh
ci/maas-reconfigure-rack.sh [new file with mode: 0644]
ci/maas-reconfigure-region.sh [new file with mode: 0644]

index fa1dbf7..436c266 100755 (executable)
@@ -400,12 +400,20 @@ if [ "$virtinstall" -eq 1 ]; then
     enablesubnetanddhcp
 fi
 
+#reconfigure maas with correct MAAS address.
+#Below code is needed as MAAS have issue in commisoning without restart.
+sudo ./maas-reconfigure-rack.sh $MAAS_IP
+sudo ./maas-reconfigure-region.sh $MAAS_IP
+
 # lets sleep for around 5 more minutes to make sure all images are in sync.
 sleep 300
 
 #lets add the nodes now. Currently works only for virtual deploymnet.
 addnodes
 
+#take another 5 minutes to commision the nodes.
+sleep 300
+
 echo "... Deployment of maas finish ...."
 
 #Added the Qtip public to run the Qtip test after install on bare metal nodes.
diff --git a/ci/maas-reconfigure-rack.sh b/ci/maas-reconfigure-rack.sh
new file mode 100644 (file)
index 0000000..5ebe8b2
--- /dev/null
@@ -0,0 +1,8 @@
+#!/usr/bin/expect
+set MAAS_IP [lindex $argv 0]
+spawn dpkg-reconfigure maas-rack-controller -freadline
+expect "The MAAS cluster controller and nodes need to contact the MAAS region controller API.  Set the URL at which they can reach the MAAS API remotely, e.g. \"http://192.168.1.1/MAAS\". Since nodes must be able to access this URL, localhost or 127.0.0.1 are not useful values here. Ubuntu MAAS API address:"
+send "http://$MAAS_IP:5240/MAAS\r"
+
+# done
+expect eof
diff --git a/ci/maas-reconfigure-region.sh b/ci/maas-reconfigure-region.sh
new file mode 100644 (file)
index 0000000..20ac3e0
--- /dev/null
@@ -0,0 +1,8 @@
+#!/usr/bin/expect
+set MAAS_IP [lindex $argv 0]
+spawn dpkg-reconfigure maas-region-controller -freadline
+expect "Ubuntu MAAS PXE/Provisioning network address:"
+send "$MAAS_IP\r"
+
+# done
+expect eof