Skip to content

Instantly share code, notes, and snippets.

@Adron
Created August 17, 2019 01:21
Show Gist options
  • Save Adron/f99ab85c58d341199de69ec85d101d7d to your computer and use it in GitHub Desktop.
Save Adron/f99ab85c58d341199de69ec85d101d7d to your computer and use it in GitHub Desktop.
A Build Script for Packer on Azure
GROUPNAME="adrons-images"
LOCATION="westus2"
STORAGENAME="adronsimagestorage"
IMAGECASSANDRA="basecassandra"
echo 'Deleting existing image.'
az image delete -g $GROUPNAME -n $IMAGECASSANDRA
echo 'Creating the managed resource group for images.'
az group create --name $GROUPNAME --location $LOCATION
echo 'Creating the storage account for image storage.'
az storage account create \
--name $STORAGENAME --resource-group $GROUPNAME \
--location $LOCATION \
--sku Standard_LRS \
--kind Storage
echo 'Building Apache cluster node image.'
packer build -var 'imagename='$IMAGECASSANDRA node-cassandra.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment