Ansible repository with playbooks to manage azure objects
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

37 wiersze
1.6 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: Delete storage account
  22. azure_rm_storageaccount:
  23. ad_user: "{{ azure_ad_user | default(omit) }}"
  24. password: "{{ azure_password | default(omit) }}"
  25. subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}"
  26. client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}"
  27. secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}"
  28. tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}"
  29. name: "{{ sa.name }}"
  30. force_delete_nonempty: "{{ sa.force_delete_nonempty | default(false, true) }}"
  31. resource_group: "{{ sa.resource_group }}"
  32. state: "absent"
  33. register: deletedsa
  34. ...