From d414588a47db3e19622504a5cbc4706711900015 Mon Sep 17 00:00:00 2001 From: Kenichi Omichi Date: Sun, 3 May 2020 12:42:26 -0700 Subject: [PATCH] Azure: Rename apply-rg_2.sh to apply-rg.sh (#6049) apply-rg.sh was for Azure command version 1("azure" command) and the command is old and version 2("az" command) is officially used today. apply-rg_2.sh was for the version 2. In addition, the README[1] says we need to run apply-rg.sh for applying templates. This renames apply-rg_2.sh to apply-rg.sh for common usages of the version 2. [1]: https://github.com/kubernetes-sigs/kubespray/tree/master/contrib/azurerm#generating-and-applying --- contrib/azurerm/apply-rg.sh | 23 ++++++++--------------- contrib/azurerm/apply-rg_2.sh | 19 ------------------- contrib/azurerm/clear-rg.sh | 10 +++------- contrib/azurerm/clear-rg_2.sh | 14 -------------- 4 files changed, 11 insertions(+), 55 deletions(-) delete mode 100755 contrib/azurerm/apply-rg_2.sh delete mode 100755 contrib/azurerm/clear-rg_2.sh diff --git a/contrib/azurerm/apply-rg.sh b/contrib/azurerm/apply-rg.sh index efa330bb5..2348169d4 100755 --- a/contrib/azurerm/apply-rg.sh +++ b/contrib/azurerm/apply-rg.sh @@ -9,18 +9,11 @@ if [ "$AZURE_RESOURCE_GROUP" == "" ]; then exit 1 fi -if az &>/dev/null; then - echo "azure cli 2.0 found, using it instead of 1.0" - ./apply-rg_2.sh "$AZURE_RESOURCE_GROUP" -elif azure &>/dev/null; then - 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 +ansible-playbook generate-templates.yml + +az deployment group create --template-file ./.generated/network.json -g $AZURE_RESOURCE_GROUP +az deployment group create --template-file ./.generated/storage.json -g $AZURE_RESOURCE_GROUP +az deployment group create --template-file ./.generated/availability-sets.json -g $AZURE_RESOURCE_GROUP +az deployment group create --template-file ./.generated/bastion.json -g $AZURE_RESOURCE_GROUP +az deployment group create --template-file ./.generated/masters.json -g $AZURE_RESOURCE_GROUP +az deployment group create --template-file ./.generated/minions.json -g $AZURE_RESOURCE_GROUP diff --git a/contrib/azurerm/apply-rg_2.sh b/contrib/azurerm/apply-rg_2.sh deleted file mode 100755 index 2348169d4..000000000 --- a/contrib/azurerm/apply-rg_2.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -set -e - -AZURE_RESOURCE_GROUP="$1" - -if [ "$AZURE_RESOURCE_GROUP" == "" ]; then - echo "AZURE_RESOURCE_GROUP is missing" - exit 1 -fi - -ansible-playbook generate-templates.yml - -az deployment group create --template-file ./.generated/network.json -g $AZURE_RESOURCE_GROUP -az deployment group create --template-file ./.generated/storage.json -g $AZURE_RESOURCE_GROUP -az deployment group create --template-file ./.generated/availability-sets.json -g $AZURE_RESOURCE_GROUP -az deployment group create --template-file ./.generated/bastion.json -g $AZURE_RESOURCE_GROUP -az deployment group create --template-file ./.generated/masters.json -g $AZURE_RESOURCE_GROUP -az deployment group create --template-file ./.generated/minions.json -g $AZURE_RESOURCE_GROUP diff --git a/contrib/azurerm/clear-rg.sh b/contrib/azurerm/clear-rg.sh index 64fea1f16..a20045537 100755 --- a/contrib/azurerm/clear-rg.sh +++ b/contrib/azurerm/clear-rg.sh @@ -9,10 +9,6 @@ if [ "$AZURE_RESOURCE_GROUP" == "" ]; then exit 1 fi -if az &>/dev/null; then - echo "azure cli 2.0 found, using it instead of 1.0" - ./clear-rg_2.sh "$AZURE_RESOURCE_GROUP" -else - ansible-playbook generate-templates.yml - azure group deployment create -g "$AZURE_RESOURCE_GROUP" -f ./.generated/clear-rg.json -m Complete -fi +ansible-playbook generate-templates.yml + +az group deployment create -g "$AZURE_RESOURCE_GROUP" --template-file ./.generated/clear-rg.json --mode Complete diff --git a/contrib/azurerm/clear-rg_2.sh b/contrib/azurerm/clear-rg_2.sh deleted file mode 100755 index a20045537..000000000 --- a/contrib/azurerm/clear-rg_2.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -set -e - -AZURE_RESOURCE_GROUP="$1" - -if [ "$AZURE_RESOURCE_GROUP" == "" ]; then - echo "AZURE_RESOURCE_GROUP is missing" - exit 1 -fi - -ansible-playbook generate-templates.yml - -az group deployment create -g "$AZURE_RESOURCE_GROUP" --template-file ./.generated/clear-rg.json --mode Complete