2016-12-13 00:21:56 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
AZURE_RESOURCE_GROUP="$1"
|
|
|
|
|
|
|
|
if [ "$AZURE_RESOURCE_GROUP" == "" ]; then
|
|
|
|
echo "AZURE_RESOURCE_GROUP is missing"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-08-20 18:55:13 +08:00
|
|
|
if az &>/dev/null; then
|
2017-07-19 17:00:27 +08:00
|
|
|
echo "azure cli 2.0 found, using it instead of 1.0"
|
|
|
|
./apply-rg_2.sh "$AZURE_RESOURCE_GROUP"
|
2017-08-20 18:55:13 +08:00
|
|
|
elif azure &>/dev/null; then
|
2017-07-19 17:00:27 +08:00
|
|
|
ansible-playbook generate-templates.yml
|
|
|
|
|
|
|
|
azure group deployment create -f ./.generated/network.json -g $AZURE_RESOURCE_GROUP
|
|
|
|
azure group deployment create -f ./.generated/storage.json -g $AZURE_RESOURCE_GROUP
|
|
|
|
azure group deployment create -f ./.generated/availability-sets.json -g $AZURE_RESOURCE_GROUP
|
|
|
|
azure group deployment create -f ./.generated/bastion.json -g $AZURE_RESOURCE_GROUP
|
|
|
|
azure group deployment create -f ./.generated/masters.json -g $AZURE_RESOURCE_GROUP
|
|
|
|
azure group deployment create -f ./.generated/minions.json -g $AZURE_RESOURCE_GROUP
|
|
|
|
else
|
|
|
|
echo "Azure cli not found"
|
|
|
|
fi
|