Hi All, I would like to know details to use Azure modules ( azure_rm_xxxxxx ) . because it failed tasks for azure.
I already have own azure account. I think that I must get some objects ( ad_user / password ) on my azure portal before I write a playbook. I read below. https://azure.microsoft.com/en-us/documentation/articles/automation-credentials/ I set ~/.azure/credentials then I run playbook. --- - name: VM image fact azure_rm_virtualmachineimage_facts: location: eastus publisher: OpenLogic offer: CentOS sku: '7.1' version: '7.1.20160308' It failed. TASK [azure : VM image fact] *************************************************** task path: /home/vagrant/build_host/roles/azure/tasks/test.yml:1 <localhost> ESTABLISH LOCAL CONNECTION FOR USER: vagrant <localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1464532575.87-18674131270164 `" && echo ansible-tmp-1464532575.87-18674131270164="` echo $HOME/.ansible/tmp/ansible-tmp-1464532575.87-18674131270164 `" ) && sleep 0' <localhost> PUT /tmp/tmpxJJVCb TO /home/vagrant/.ansible/tmp/ansible-tmp-1464532575.87-18674131270164/azure_rm_virtualmachineimage_facts <localhost> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1464532575.87-18674131270164/azure_rm_virtualmachineimage_facts; rm -rf "/home/vagrant/.ansible/tmp/ansible-tmp-1464532575.87-18674131270164/" > /dev/null 2>&1 && sleep 0' fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_name": "azure_rm_virtualmachineimage_facts"}, "module_stderr": "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:315: 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. 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:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.\n InsecurePlatformWarning\nTraceback (most recent call last):\n File \"/tmp/ansible_pmEfA1/ansible_module_azure_rm_virtualmachineimage_facts.py\", line 239, in <module>\n main()\n File \"/tmp/ansible_pmEfA1/ansible_module_azure_rm_virtualmachineimage_facts.py\", line 236, in main\n AzureRMVirtualMachineImageFacts()\n File \"/tmp/ansible_pmEfA1/ansible_module_azure_rm_virtualmachineimage_facts.py\", line 149, in __init__\n super(AzureRMVirtualMachineImageFacts, self).__init__(self.module_arg_spec)\n File \"/tmp/ansible_pmEfA1/ansible_modlib.zip/ansible/module_utils/azure_rm_common.py\", line 169, in __init__\n File \"/usr/local/lib/python2.7/dist-packages/msrestazure/azure_active_directory.py\", line 261, in __init__\n self.set_token()\n File \"/usr/local/lib/python2.7/dist-packages/msrestazure/azure_active_directory.py\", line 296, in set_token\n raise_with_traceback(AuthenticationError, \"\", err)\n File \"/usr/local/lib/python2.7/dist-packages/msrest/exceptions.py\", line 50, in raise_with_traceback\n raise error\nmsrest.exceptions.AuthenticationError: , InvalidGrantError: (invalid_grant) AADSTS50034: To sign into this application the account must be added to the management.core.windows.net directory.\r\nTrace ID: cc08968a-517f-4e8b-ac2e-09423825472c\r\nCorrelation ID: 1bd9c2bf-8299-4455-88b1-de3eced3eb80\r\nTimestamp: 2016-05-29 14:36:19Z\n", "module_stdout": "", "msg": "MODULE FAILURE", "parsed": false} PLAY RECAP ********************************************************************* localhost : ok=1 changed=0 unreachable=0 failed=1 Maybe ~/.azure/credentials has problems, but I did not understand. ~/.azure/credentials subscription_id: <my subscription id> ad_user: xxxxxxx password: xxxxxxx Any and all help is appreciated! -- 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAOpn5sTa0VGAczmskNshyaXGbiWLg7cpUgrRvG2HD9f3Adb6zw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.