summaryrefslogtreecommitdiffstats
path: root/juju/get-cloud-images
blob: 3711729c7053c6bb9b05f45f16b33b3b7f3e0683 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash -e

folder=/srv/data/
sudo mkdir $folder || true

if grep -q 'virt-type: lxd' bundles.yaml; then
    URLS=" \
    http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-lxc.tar.gz \
    http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-root.tar.gz "

else
    URLS=" \
    http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img \
    http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img \
    http://mirror.catn.com/pub/catn/images/qcow2/centos6.4-x86_64-gold-master.img \
    http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 \
    http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img "
fi

for URL in $URLS
do
FILENAME=${URL##*/}
if [ -f $folder/$FILENAME ];
then
    echo "$FILENAME already downloaded."
else
    wget  -O  $folder/$FILENAME $URL
fi
done

echo "To download Windows image get there : https://cloudbase.it/windows-cloud-images/"