mirror of
https://github.com/trailofbits/algo.git
synced 2025-08-15 09:13:01 +02:00
Add new Azure regions and allow user to select VM size (#332)
* Update Azure Region List Included several additional regions in the Azure list. In a future version we may want to ask users to choose a continent, then present region options since this list is getting long. * Add VM size selection Added prompt for user to choose VM size. Useful because the default size is not available in all regions, and there are cheaper sizes. * Handle vm_size choice in "Create an Instance" step Use the variable passed in that the user chose for vm_size. * Differentiate Basic A0 and Standard A0 * Remove vm_size D1 since it's being deprecated * Fix syntax issue - missing semicolons * Remove note to self comment * Remove changes to let user select VM size Removing my previous additions that let the user select their Azure VM size. * Hard code VM size to cheapest size Remove my usage of a variable for VM size. Update to use the Basic_A0, which is the cheapest size of VM.
This commit is contained in:
parent
9313561617
commit
0a20018e21
2 changed files with 29 additions and 2 deletions
27
algo
27
algo
|
@ -94,7 +94,7 @@ Name the vpn server:
|
||||||
azure_server_name=${azure_server_name:-algo}
|
azure_server_name=${azure_server_name:-algo}
|
||||||
|
|
||||||
read -p "
|
read -p "
|
||||||
What region should the server be located in?
|
What region should the server be located in? (https://azure.microsoft.com/en-us/regions/)
|
||||||
1. South Central US
|
1. South Central US
|
||||||
2. Central US
|
2. Central US
|
||||||
3. North Europe
|
3. North Europe
|
||||||
|
@ -109,6 +109,19 @@ Name the vpn server:
|
||||||
12. West Central US
|
12. West Central US
|
||||||
13. UK South
|
13. UK South
|
||||||
14. UK West
|
14. UK West
|
||||||
|
15. West US
|
||||||
|
16. Brazil South
|
||||||
|
17. Canada Central
|
||||||
|
18. Central India
|
||||||
|
19. East Asia
|
||||||
|
20. Germany Central
|
||||||
|
21. Germany Northeast
|
||||||
|
22. Korea Central
|
||||||
|
23. Korea South
|
||||||
|
24. North Central US
|
||||||
|
25. South India
|
||||||
|
26. West India
|
||||||
|
|
||||||
Enter the number of your desired region:
|
Enter the number of your desired region:
|
||||||
[1]: " -r azure_region
|
[1]: " -r azure_region
|
||||||
azure_region=${azure_region:-1}
|
azure_region=${azure_region:-1}
|
||||||
|
@ -128,6 +141,18 @@ Enter the number of your desired region:
|
||||||
12) region="westcentralus" ;;
|
12) region="westcentralus" ;;
|
||||||
13) region="uksouth" ;;
|
13) region="uksouth" ;;
|
||||||
14) region="ukwest" ;;
|
14) region="ukwest" ;;
|
||||||
|
15) region="westus" ;;
|
||||||
|
16) region="brazilsouth" ;;
|
||||||
|
17) region="canadacentral" ;;
|
||||||
|
18) region="centralindia" ;;
|
||||||
|
19) region="eastasia" ;;
|
||||||
|
20) region="germanycentral" ;;
|
||||||
|
21) region="germanynortheast" ;;
|
||||||
|
22) region="koreacentral" ;;
|
||||||
|
23) region="koreasouth" ;;
|
||||||
|
24) region="northcentralus" ;;
|
||||||
|
25) region="southindia" ;;
|
||||||
|
26) region="westindia" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
ROLES="azure vpn cloud"
|
ROLES="azure vpn cloud"
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
virtual_network: algo_net
|
virtual_network: algo_net
|
||||||
name: "{{ azure_server_name }}"
|
name: "{{ azure_server_name }}"
|
||||||
ssh_password_enabled: false
|
ssh_password_enabled: false
|
||||||
vm_size: Standard_D1
|
vm_size: Basic_A0
|
||||||
tags:
|
tags:
|
||||||
Environment: Algo
|
Environment: Algo
|
||||||
ssh_public_keys:
|
ssh_public_keys:
|
||||||
|
@ -91,6 +91,8 @@
|
||||||
sku: '16.04-LTS'
|
sku: '16.04-LTS'
|
||||||
version: latest
|
version: latest
|
||||||
register: azure_rm_virtualmachine
|
register: azure_rm_virtualmachine
|
||||||
|
|
||||||
|
# To-do: Add error handling - if vm_size requested is not available, can we fall back to another, ideally with a prompt?
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
ip_address: "{{ azure_rm_virtualmachine.ansible_facts.azure_vm.properties.networkProfile.networkInterfaces[0].properties.ipConfigurations[0].properties.publicIPAddress.properties.ipAddress }}"
|
ip_address: "{{ azure_rm_virtualmachine.ansible_facts.azure_vm.properties.networkProfile.networkInterfaces[0].properties.ipConfigurations[0].properties.publicIPAddress.properties.ipAddress }}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue