I'd suggest double checking that you have the same versions of the azure pip module that the documents say is required.
I'm guessing the error vm_id=vm_dict['properties']['vmId'],\nKeyError: 'vmId'\n" means its looking for something called vmId and not finding it. I'm not familiar with the azure stuff unfortunately. Hope this helps, Jon On Friday, April 7, 2017 at 2:22:18 PM UTC+1, [email protected] wrote: > > Hi, > > Not sure yet if what I have here is a bug or not, so thought I'd ask > first. I'm seeing a strange failure out of azure_rm_virtualmachine in the > latest ansible devel. The working playbook looks as follows: > - name: Create VM and attach NIC > azure_rm_virtualmachine: > resource_group: '{{ rg }}' > name: '{{service_name}}-vm-{{item}}' > network_interface_names: '{{service_name}}-vm-{{item}}-nic' > storage_account: '{{ env_name }}' > vm_size: Standard_DS1_v2 > admin_username: hoylu > ssh_password_enabled: False > ssh_public_keys: '{{ssh_keys}}' > image: > offer: UbuntuServer > publisher: Canonical > sku: '16.04-LTS' > version: latest > tags: > env: '{{env}}' > service: '{{service}}' > with_sequence: > start=1 > end='{{count}}' > stride=1 > format=%02d > > This code runs. When I then change the tags: section of the playbook task > to a dictionary that looks like the following: > tags: '{{ { "env": env, service: env } }}' > I get an error that looks like this: > "module_stderr": "Traceback (most recent call last):\n File > \"/var/folders/06/zm5r71tj60b4_19wlz7h822m0000gn/T/ansible_GI_w3r/ansible_module_azure_rm_virtualmachine.py\", > > line 1311, in <module>\n main()\n File > \"/var/folders/06/zm5r71tj60b4_19wlz7h822m0000gn/T/ansible_GI_w3r/ansible_module_azure_rm_virtualmachine.py\", > > line 1308, in main\n AzureRMVirtualMachine()\n File > \"/var/folders/06/zm5r71tj60b4_19wlz7h822m0000gn/T/ansible_GI_w3r/ansible_module_azure_rm_virtualmachine.py\", > > line 554, in __init__\n supports_check_mode=True)\n File > \"/var/folders/06/zm5r71tj60b4_19wlz7h822m0000gn/T/ansible_GI_w3r/ansible_modlib.zip/ansible/module_utils/azure_rm_common.py\", > > line 197, in __init__\n File > \"/var/folders/06/zm5r71tj60b4_19wlz7h822m0000gn/T/ansible_GI_w3r/ansible_module_azure_rm_virtualmachine.py\", > > line 797, in exec_module\n > vm_id=vm_dict['properties']['vmId'],\nKeyError: 'vmId'\n", > > This error only happens with the azure_rm_virtualmachine module. The > azure_rm_publicipaddress and azure_rm_networkinterface modules are both > fine with that change. Is there some vagary of azure I'm not aware of > that's biting me here, or does this look like a bug to folks? > > Thanks, > > Marcin > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1d496b95-3a8a-4094-bd63-34c39a8f7a1c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
