From a3c64bda1acf6dfa628c3f95866d7db9259e0275 Mon Sep 17 00:00:00 2001 From: Josh Meisels Date: Mon, 27 Mar 2017 22:13:05 -0700 Subject: [PATCH] Handle vm_size choice in "Create an Instance" step Use the variable passed in that the user chose for vm_size. --- roles/cloud-azure/tasks/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/cloud-azure/tasks/main.yml b/roles/cloud-azure/tasks/main.yml index dfdde2e5..7c6f1fc9 100644 --- a/roles/cloud-azure/tasks/main.yml +++ b/roles/cloud-azure/tasks/main.yml @@ -80,7 +80,8 @@ virtual_network: algo_net name: "{{ azure_server_name }}" 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: Environment: Algo ssh_public_keys: @@ -91,6 +92,8 @@ sku: '16.04-LTS' version: latest 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: ip_address: "{{ azure_rm_virtualmachine.ansible_facts.azure_vm.properties.networkProfile.networkInterfaces[0].properties.ipConfigurations[0].properties.publicIPAddress.properties.ipAddress }}"