Ansible repository with playbooks to manage azure objects
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

27 lines
1.0 KiB

  1. ---
  2. - name: Build tags list
  3. set_fact:
  4. tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}"
  5. loop: "{{ lookup('dict', sa.tags) }}"
  6. loop_control:
  7. loop_var: "tag"
  8. - name: Get storage account
  9. azure_rm_storageaccount_info:
  10. ad_user: "{{ azure_ad_user | default(omit) }}"
  11. password: "{{ azure_password | default(omit) }}"
  12. subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}"
  13. client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}"
  14. secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}"
  15. tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}"
  16. resource_group: "{{ sa.resource_group | default(omit) }}"
  17. show_connection_string: "{{ sa.show_connection_string | default(true, true) }}"
  18. tags: "{{ tags_list | default(omit) }}"
  19. name: "{{ sa.name | default(omit) }}"
  20. register: azure_sa_facts
  21. - name: Print storage account
  22. debug:
  23. var: azure_sa_facts.storageaccounts
  24. ...