Ansible repository with playbooks to manage azure objects
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

45 строки
2.1 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 | default({}, true)) }}"
  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: Create 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. access_tier: "{{ sa.access_tier | default('Hot', true) }}"
  31. account_type: "{{ sa.account_type | default('StandardSSD_LRS', true) }}"
  32. blob_cors: "{{ sa.blob_cors | default(omit, true) }}"
  33. force_delete_nonempty: "{{ sa.force_delete_nonempty | default(false, true) }}"
  34. https_only: "{{ sa.https_only | default(true, true) }}"
  35. kind: "{{ sa.kind | default('StorageV2', true) }}"
  36. location: "{{ sa.location | default(omit, true) }}"
  37. resource_group: "{{ sa.resource_group }}"
  38. state: "present"
  39. tags: "{{ sa.tags | default(omit, true) }}"
  40. append_tags: "{{ sa.append_tags | default(false, true) }}"
  41. register: createsa
  42. ...