diff --git a/roles/data/tasks/setup_azure.yml b/roles/data/tasks/setup_azure.yml index ccc000bf..5aa8b2b4 100644 --- a/roles/data/tasks/setup_azure.yml +++ b/roles/data/tasks/setup_azure.yml @@ -27,7 +27,7 @@ loop_var: __data_store_azure_location - name: Process Azure role assignments for external data storage locations - azure.azcollection.azure_rm_roleassignment: # This Azure module is not idempotent on removals + azure.azcollection.azure_rm_roleassignment: state: present scope: "{{ __azure_data_location_assignment.scope }}" name: "{{ __azure_data_location_assignment.name }}" @@ -35,4 +35,8 @@ role_definition_id: "{{ __data_store.read_only | default(False) | ternary(__azure_storage_blob_data_reader_uri, __azure_storage_blob_data_owner_uri) }}" loop: "{{ __azure_data_location_storage_assignments }}" loop_control: - loop_var: __azure_data_location_assignment \ No newline at end of file + loop_var: __azure_data_location_assignment + register: __data_azure_assignment_results + until: __data_azure_assignment_results is not failed + retries: 3 + delay: 3 \ No newline at end of file diff --git a/roles/data/tasks/teardown_azure.yml b/roles/data/tasks/teardown_azure.yml index 675c99e5..dc45e414 100644 --- a/roles/data/tasks/teardown_azure.yml +++ b/roles/data/tasks/teardown_azure.yml @@ -28,7 +28,7 @@ when: __data_storage.assignment.delete | default(data__teardown_deletes_assignments) block: - name: Process Azure role assignment removal for external data storage locations - azure.azcollection.azure_rm_roleassignment: # This Azure module is not idempotent on removals + azure.azcollection.azure_rm_roleassignment: state: absent scope: "{{ __azure_data_location_assignment.scope }}" assignee_object_id: "{{ __azure_data_location_assignment.assignee }}"