You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
489 B

  1. #!/usr/bin/env bash
  2. set -e
  3. AZURE_RESOURCE_GROUP="$1"
  4. if [ "$AZURE_RESOURCE_GROUP" == "" ]; then
  5. echo "AZURE_RESOURCE_GROUP is missing"
  6. exit 1
  7. fi
  8. # check if azure cli 2.0 exists else use azure cli 1.0
  9. if az &>/dev/null; then
  10. ansible-playbook generate-inventory_2.yml -e azure_resource_group="$AZURE_RESOURCE_GROUP"
  11. elif azure &>/dev/null; then
  12. ansible-playbook generate-inventory.yml -e azure_resource_group="$AZURE_RESOURCE_GROUP"
  13. else
  14. echo "Azure cli not found"
  15. fi