Thank you for your response, after running the below code am receiving a 
new error.

Below is the error:

TASK [Create VM with defaults] 
*************************************************
task path: /etc/ansible/playbooks/azurestorage.yml:10
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: ubuntu
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo 
/tmp/ansible-tmp-1477387147.54-45261078249986 `" && echo 
ansible-tmp-1477387147.54-45261078249986="` echo 
/tmp/ansible-tmp-1477387147.54-45261078249986 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpiax_gt TO /tmp/ansible-tmp-1477387147.54-
45261078249986/azure_rm_storageaccount
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x 
/tmp/ansible-tmp-1477387147.54-45261078249986/ 
/tmp/ansible-tmp-1477387147.54-45261078249986/azure_rm_storageaccount && 
sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python 
/tmp/ansible-tmp-1477387147.54-45261078249986/azure_rm_storageaccount; rm 
-rf "/tmp/ansible-tmp-1477387147.54-45261078249986/" > /dev/null 2>&1 && 
sleep 0'
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, 
"invocation": {"module_args": {"account_type": "Standard_LRS", "ad_user": 
null, "append_tags": true, "client_id": 
"VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "custom_domain": null, "force": false
, "kind": "Storage", "location": null, "name": "testaccount001", "password": 
null, "profile": null, "resource_group": "Testing", "secret": 
"VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "state": "present", "subscription_id"
: "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "tags": null, "tenant": 
"VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"}, "module_name": 
"azure_rm_storageaccount"}, "msg": "Parameter error: resource group Testing 
not found"}

But i have a resource group with the name "testing" below is the screen 
shot, Please let me know if am missing something.



Thanks,
Girish

On Tuesday, October 25, 2016 at 5:13:30 AM UTC+5:30, Alexander H. Laughlin 
wrote:
>
> Hello,
>
> I believe something like the below would solve your problem:
>
> ---
>
> - hosts: localhost
>
>  connection: local
>
>  vars:
>
>     subscription_id: XXXXXXXXXXXXXXXXXXXXXXXXXX
>
>     Client_id: XXXXXXXXXXXXXXXXXXXXXXXXXXXXxxx
>
>     Serect_key: XXXXXXXXXXXXXXXXXXXXXXXXXX
>
>     Tenent_id: XXXXXXXXXXXXXXXXXXXXXXXXXX
>
>  tasks:
>
>    - name: Create VM with defaults
>
>      azure_rm_storageaccount:
>
>          resource_group: Testing
>
>          name: testaccount001
>
>          account_type: Standard_LRS
>
>          subscription_id: "{{ subscription_id }}"
>
>          client_id: "{{ Client_id }}"
>
>          secret: "{{ Serect_key }}"
>
>          tenant: "{{ Tenent_id }}"
>
> ...
>
>
> Relevant documentation. 
> <https://docs.ansible.com/ansible/azure_rm_storageaccount_module.html#notes>
>
> Cheers mate!
>
> On Monday, October 24, 2016 at 12:22:53 PM UTC-7, Girish Kumar Mayigowda 
> wrote:
>>
>> Hi,
>>
>> I am trying to create a storage account and below is the play book and 
>> the error, please let me know what am missing.
>> i have created a file credentials.ini under etc/home/.azure
>>
>> ---
>> - hosts: localhost
>>   connection: local
>>   vars:
>>      subscription_id:XXXXXXXXXXXXXXXXXXXXXXXXXX
>>      Client_id: XXXXXXXXXXXXXXXXXXXXXXXXXXXXxxx
>>      Serect_key: XXXXXXXXXXXXXXXXXXXXXXXXXX
>>      Tenent_id: XXXXXXXXXXXXXXXXXXXXXXXXXX
>>   tasks:
>>     - name: Create VM with defaults
>>       azure_rm_storageaccount:
>>           resource_group: Testing
>>           name: testaccount001
>>           account_type: Standard_LRS
>>
>> Below is the error:
>>
>> fatal: [localhost]: FAILED! => {"changed": false, "failed": true, 
>> "invocation": {"module_args": {"account_type": "Standard_LRS", "ad_user": 
>> null, "append_tags": true, "client_id": null, "custom_domain": null, 
>> "force": false, "kind": "Storage", "location": null, "name": 
>> "testaccount001", "password": null, "profile": null, "resource_group": 
>> "Testing", "secret": null, "state": "present", "subscription_id": null, 
>> "tags": null, "tenant": null}, "module_name": "azure_rm_storageaccount"}, 
>> "msg": "Failed to get credentials. Either pass as parameters, set 
>> environment variables, or define a profile in ~/.azure/credentials."}
>>
>>
>> Thanks!
>>
>>
>>
>>

-- 
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/8a2dd411-ffca-4512-9c39-792f36f93d88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to