Handle vm_size choice in "Create an Instance" step

Use the variable passed in that the user chose for vm_size.
This commit is contained in:
Josh Meisels 2017-03-27 22:13:05 -07:00 committed by GitHub
parent 84de52786e
commit a3c64bda1a

View file

@ -80,7 +80,8 @@
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 # I have no idea how to use the variable I created and passed from Algo. Do I need this lookup stuff?
vm_size: "{{ vm_size | default(lookup('env','VM_SIZE')) }}"
tags: tags:
Environment: Algo Environment: Algo
ssh_public_keys: ssh_public_keys:
@ -92,6 +93,8 @@
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 }}"
networkinterface_name: "{{ azure_rm_virtualmachine.ansible_facts.azure_vm.properties.networkProfile.networkInterfaces[0].name }}" networkinterface_name: "{{ azure_rm_virtualmachine.ansible_facts.azure_vm.properties.networkProfile.networkInterfaces[0].name }}"