azure_rm_deployment error ansible 2.1.1.0 __init__() takes exactly 1 argument (2 given)

Hi All,

I’m trying to deploy an Azure template using the azure_rm_deployment module.

ubuntu 14.04 TLS
ansible 2.1.1.0
azure 2.0.0rc5

I get the below error:

`

TASK [ansible-azure-provisioner : Deploying your Azure Jumphox] ***
task path: /var/lib/awx/projects/9__ansible_cloudfirst_master/roles/internal/ansible-azure-provisioner/tasks/main.yml:11
<40.118.63.1> ESTABLISH LOCAL CONNECTION FOR USER: awx
<40.118.63.1> EXEC /bin/sh -c ‘( umask 77 && mkdir -p “echo $HOME/.ansible/tmp/ansible-tmp-1470747867.04-122827512832920” && echo ansible-tmp-1470747867.04-122827512832920=“echo $HOME/.ansible/tmp/ansible-tmp-1470747867.04-122827512832920” ) && sleep 0’
<40.118.63.1> PUT /tmp/tmpxr0A6K TO /var/lib/awx/.ansible/tmp/ansible-tmp-1470747867.04-122827512832920/azure_rm_deployment
<40.118.63.1> EXEC /bin/sh -c ‘LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1470747867.04-122827512832920/azure_rm_deployment; rm -rf “/var/lib/awx/.ansible/tmp/ansible-tmp-1470747867.04-122827512832920/” > /dev/null 2>&1 && sleep 0’
fatal: [40.118.63.1]: FAILED! => {“changed”: false, “failed”: true, “invocation”: {“module_name”: “azure_rm_deployment”}, “module_stderr”: "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl
.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.\n SNIMissingWarning\n/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.\n InsecurePlatformWarning\nTraceback (most recent call last):\n File "/tmp/ansible_Qp3l_v/ansible_module_azure_rm_deployment.py", line 660, in \n main()\n File "/tmp/ansible_Qp3l_v/ansible_module_azure_rm_deployment.py", line 656, in main\n AzureRMDeploymentManager()\n File "/tmp/ansible_Qp3l_v/ansible_module_azure_rm_deployment.py", line 438, in init\n supports_check_mode=False)\n File "/tmp/ansible_Qp3l_v/ansible_modlib.zip/ansible/module_utils/azure_rm_common.py", line 192, in init\n File "/tmp/ansible_Qp3l_v/ansible_module_azure_rm_deployment.py", line 449, in exec_module\n deployment = self.deploy_template()\n File "/tmp/ansible_Qp3l_v/ansible_module_azure_rm_deployment.py", line 493, in deploy_template\n self.rm_client.resource_groups.create_or_update(self.resource_group_name, params)\n File "/tmp/ansible_Qp3l_v/ansible_modlib.zip/ansible/module_utils/azure_rm_common.py", line 596, in rm_client\n File "/usr/local/lib/python2.7/dist-packages/azure/mgmt/resource/resources/resource_management_client.py", line 141, in init\n self._serialize = Serializer(client_models)\nTypeError: init() takes exactly 1 argument (2 given)\n", “module_stdout”: “”, “msg”: “MODULE FAILURE”, “parsed”: false}

`

Any idea? I’ve installed urllib3[secure] no luck

MG

Could you please share an example playbook? We’re using this module without issues.

Hi Trond,

thank you for your reply, it turns out to be the msrest, we were using 0.4.0 and it only works with 0.4.1.

I’ve updated it and it works now fine.

BR

Nice. There was a lot of version mess around those modules for a while, glad you figured it out.