2016-12-12 16:21:56 +00: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-07-19 09:00:27 +00:00
|
|
|
# check if azure cli 2.0 exists else use azure cli 1.0
|
2017-08-20 10:55:13 +00:00
|
|
|
if az &>/dev/null; then
|
2017-07-19 09:00:27 +00:00
|
|
|
ansible-playbook generate-inventory_2.yml -e azure_resource_group="$AZURE_RESOURCE_GROUP"
|
2017-08-20 10:55:13 +00:00
|
|
|
elif azure &>/dev/null; then
|
2017-07-19 09:00:27 +00:00
|
|
|
ansible-playbook generate-inventory.yml -e azure_resource_group="$AZURE_RESOURCE_GROUP"
|
|
|
|
else
|
|
|
|
echo "Azure cli not found"
|
|
|
|
fi
|