summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorNarinder Gupta <narinder.gupta@canonical.com>2017-08-14 13:57:21 -0500
committerNarinder Gupta <narinder.gupta@canonical.com>2017-08-14 13:57:21 -0500
commit320c0ccb146a27ecaa9338e0f51de3eee64602c9 (patch)
treef2390b73f26b342f5545a9a76a9bd6782ea1ada8 /ci
parent7d911eb5fcf4066a11ff34761d44a22c4fc7d877 (diff)
modified to have better logic and by default fallback to amd64.
Change-Id: I161c544130b512a3715973f10a27335c29c8bd86 Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
Diffstat (limited to 'ci')
-rwxr-xr-xci/03-maasdeploy.sh29
1 files changed, 13 insertions, 16 deletions
diff --git a/ci/03-maasdeploy.sh b/ci/03-maasdeploy.sh
index f79ea5bf..1c19a63c 100755
--- a/ci/03-maasdeploy.sh
+++ b/ci/03-maasdeploy.sh
@@ -12,20 +12,17 @@ if [ ! -e $HOME/.ssh/id_rsa ]; then
fi
NODE_ARCTYPE=`arch`
-NODE_ARC="amd64/generic"
-NODE_ARCHES="amd64"
-if [ "x86_64" == "$NODE_ARCTYPE" ]; then
- NODE_ARC="amd64/generic"
-elif [ "ppc64le" == "$NODE_ARCTYPE" ]; then
- NODE_ARC='ppc64el'
+if [ "ppc64le" == "$NODE_ARCTYPE" ]; then
+ NODE_ARCHES="ppc64el"
elif [ "aarch64" == "$NODE_ARCTYPE" ]; then
- NODE_ARC="arm64/generic"
NODE_ARCHES="arm64"
else
- NODE_ARC=$NODE_ARCTYPE
+ NODE_ARCHES="amd64"
fi
+NODE_ARC="$NODE_ARCHES/generic"
+
# Install the packages needed
echo_info "Installing and upgrading required packages"
sudo apt-get install software-properties-common -y
@@ -475,21 +472,21 @@ addnodes(){
POWER_PASS=`cat labconfig.json | jq ".lab.racks[].nodes[$units].power.pass" | cut -d \" -f 2 `
NODE_ARCTYPE=`cat labconfig.json | jq ".lab.racks[].nodes[$units].architecture" | cut -d \" -f 2 `
- if [ "x86_64" == "$NODE_ARCTYPE" ]; then
- NODE_ARC="amd64/generic"
- elif [ "ppc64le" == "$NODE_ARCTYPE" ]; then
- NODE_ARC='ppc64el'
+ if [ "ppc64le" == "$NODE_ARCTYPE" ]; then
+ NODE_ARCHES="ppc64el"
elif [ "aarch64" == "$NODE_ARCTYPE" ]; then
- NODE_ARC="arm64/generic"
+ NODE_ARCHES="arm64"
else
- NODE_ARC=$NODE_ARCTYPE
+ NODE_ARCHES="amd64"
fi
+ NODE_ARC="$NODE_ARCHES/generic"
+
echo_info "Creating node $NODE_NAME"
maas $PROFILE machines create autodetect_nodegroup='yes' name=$NODE_NAME \
hostname=$NODE_NAME power_type=$POWER_TYPE power_parameters_power_address=$POWER_IP \
- power_parameters_power_user=$POWER_USER power_parameters_power_pass=$POWER_PASS mac_addresses=$MAC_ADDRESS \
- architecture=$NODE_ARC
+ power_parameters_power_user=$POWER_USER power_parameters_power_pass=$POWER_PASS \
+ mac_addresses=$MAC_ADDRESS architecture=$NODE_ARC
done
fi