ansible azure storage bug

19 views
Skip to first unread message

Niloofar Radafshar

unread,
Dec 21, 2017, 12:05:57 PM12/21/17
to Ansible Project
Hi,

I am using ansible 2.4.2 and azure_rm_storageaccount module is throwing an error:

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: msrest.exceptions.SerializationError: Unable to build a model: <SkuName.standard_lrs: 'Standard_LRS'> is not valid value for enum <enum 'SkuName'>, DeserializationError: <SkuName.standard_lrs: 'Standard_LRS'> is not valid value for enum <enum 'SkuName'>
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_ewI7GE/ansible_module_azure_rm_storageaccount.py\", line 462, in <module>\n    main()\n  File \"/tmp/ansible_ewI7GE/ansible_module_azure_rm_storageaccount.py\", line 459, in main\n    AzureRMStorageAccount()\n  File \"/tmp/ansible_ewI7GE/ansible_module_azure_rm_storageaccount.py\", line 204, in __init__\n    supports_check_mode=True)\n  File \"/tmp/ansible_ewI7GE/ansible_modlib.zip/ansible/module_utils/azure_rm_common.py\", line 285, in __init__\n  File \"/tmp/ansible_ewI7GE/ansible_module_azure_rm_storageaccount.py\", line 240, in exec_module\n    self.results['state'] = self.create_account()\n  File \"/tmp/ansible_ewI7GE/ansible_module_azure_rm_storageaccount.py\", line 416, in create_account\n    poller = self.storage_client.storage_accounts.create(self.resource_group, self.name, parameters)\n  File \"/usr/local/lib/python2.7/dist-packages/azure/mgmt/storage/v2017_06_01/operations/storage_accounts_operations.py\", line 159, in create\n    body_content = self._serialize.body(parameters, 'StorageAccountCreateParameters')\n  File \"/usr/local/lib/python2.7/dist-packages/msrest/serialization.py\", line 466, in body\n    SerializationError, \"Unable to build a model: \"+str(err), err)\n  File \"/usr/local/lib/python2.7/dist-packages/msrest/exceptions.py\", line 48, in raise_with_traceback\n    raise error\nmsrest.exceptions.SerializationError: Unable to build a model: <SkuName.standard_lrs: 'Standard_LRS'> is not valid value for enum <enum 'SkuName'>, DeserializationError: <SkuName.standard_lrs: 'Standard_LRS'> is not valid value for enum <enum 'SkuName'>\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 0}

is there any ansible version that this module was actually working?

below is my playbook:
- name: Create Azure VM
  hosts: localhost
  connection: local
  tasks:
  - name: Create storage account
    azure_rm_storageaccount:
       resource_group: awx
       name: testaccount2018
       type: Standard_LRS


your help is greatly appreciated.

Thank you,
Niloofar

Patrick Laimbock

unread,
Dec 21, 2017, 5:13:19 PM12/21/17
to ansible...@googlegroups.com
On 21-12-17 18:05, Niloofar Radafshar wrote:
> Hi,
>
> I am using ansible 2.4.2 and azure_rm_storageaccount module is throwing
> an error:
>
> An exception occurred during task execution. To see the full traceback,
> use -vvv. The error was: msrest.exceptions.SerializationError: Unable to
> build a model: <SkuName.standard_lrs: 'Standard_LRS'> is not valid value
> for enum <enum 'SkuName'>, DeserializationError: <SkuName.standard_lrs:
> 'Standard_LRS'> is not valid value for enum <enum 'SkuName'>

[snip]

> is there any ansible version that this module was actually working?
>
> below is my playbook:
> - name: Create Azure VM
>   hosts: localhost
>   connection: local
>   tasks:
>   - name: Create storage account
>     azure_rm_storageaccount:
>        resource_group: awx
>        name: testaccount2018
>        type: Standard_LRS

Do you have the azure-sdk-for-python installed? The Ansible Azure
modules use the SDK to talk to the Azure Resource Manager.
See https://github.com/Azure/azure-sdk-for-python

Getting Started with Azure:
http://docs.ansible.com/ansible/latest/guide_azure.html

Cheers,
Patrick
Reply all
Reply to author
Forward
0 new messages