summaryrefslogtreecommitdiffstats
path: root/ci/02-maasdeploy.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ci/02-maasdeploy.sh')
-rwxr-xr-xci/02-maasdeploy.sh32
1 files changed, 29 insertions, 3 deletions
diff --git a/ci/02-maasdeploy.sh b/ci/02-maasdeploy.sh
index fb72ccd6..290197c5 100755
--- a/ci/02-maasdeploy.sh
+++ b/ci/02-maasdeploy.sh
@@ -60,12 +60,13 @@ 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 openssh-server git maas-deployer juju juju-deployer maas-cli -y
+sudo apt-get install openssh-server git maas-deployer juju juju-deployer maas-cli python-pip -y
+sudo pip install shyaml
juju init -f
cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
-if [ $virtinstall ]; then
+if [ "$virtinstall" -eq 1 ]; then
sudo virsh net-dumpxml default > default-net-org.xml
sudo sed -i '/dhcp/d' default-net-org.xml
sudo sed -i '/range/d' default-net-org.xml
@@ -74,6 +75,15 @@ if [ $virtinstall ]; then
sudo virsh net-start default
fi
+enableautomode() {
+ listofnodes=`maas maas nodes list | grep system_id | cut -d '"' -f 4`
+
+ for nodes in $listofnodes
+ do
+ maas maas interface link-subnet $nodes $1 mode=AUTO subnet=10.4.9.0/24
+ done
+}
+
sudo maas-deployer -c deployment.yaml -d --force
sudo chown $USER:$USER environments.yaml
@@ -88,8 +98,24 @@ maas maas boot-source update 1 url="http://maas.ubuntu.com/images/ephemeral-v2/d
maas maas boot-resources import
maas maas sshkeys new key="`cat $HOME/.ssh/id_rsa.pub`"
+# Enable interfaces with maas
+case "$1" in
+ 'intelpod5' )
+ ;;
+ 'intelpod6' )
+ enableautomode eth1 || true
+ ;;
+ 'orangepod2' )
+ ;;
+ 'attvirpod1' )
+ ;;
+ 'juniperpod1' )
+ ;;
+esac
+
+
#adding compute and control nodes VM to MAAS for deployment purpose.
-if [ $virtinstall ]; then
+if [ "$virtinstall" -eq 1 ]; then
# create two more VMs to do the deployment.
sudo virt-install --connect qemu:///system --name node1-control --ram 8192 --vcpus 4 --disk size=120,format=qcow2,bus=virtio,io=native,pool=default --network bridge=virbr0,model=virtio --boot network,hd,menu=off --noautoconsole --vnc --print-xml | tee node1-control