added ssl support based on default.
[joid.git] / juju / get-cloud-images
1 #!/bin/bash -e
2
3 folder=/srv/data/
4 sudo mkdir $folder || true
5
6 NODE_ARCTYPE=`arch`
7
8 if  [ "ppc64le" == "$NODE_ARCTYPE" ]; then
9     NODE_ARCHES="ppc64el"
10 elif [ "aarch64" == "$NODE_ARCTYPE" ]; then
11     NODE_ARCHES="arm64"
12 else
13     NODE_ARCHES="amd64"
14 fi
15
16
17 if grep -q 'virt-type: lxd' bundles.yaml; then
18     URLS=" \
19     http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-$NODE_ARCTYPE-lxc.tar.gz \
20     http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-$NODE_ARCHES-root.tar.gz \
21     http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-$NODE_ARCHES-uefi1.img \
22     http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-$NODE_ARCHES-uefi1.img \
23     http://mirror.catn.com/pub/catn/images/qcow2/centos6.4-x86_64-gold-master.img \
24     http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 \
25     http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-$NODE_ARCTYPE-disk.img \
26 fi
27
28 for URL in $URLS
29 do
30 FILENAME=${URL##*/}
31 if [ -f $folder/$FILENAME ];
32 then
33     echo "$FILENAME already downloaded."
34 else
35     wget  -O  $folder/$FILENAME $URL
36 fi
37 done
38
39 echo "To download Windows image get there : https://cloudbase.it/windows-cloud-images/"