diff --git a/roles/deployment/cluster/tasks/create_data_context.yml b/roles/deployment/cluster/tasks/create_data_context.yml index ea38378c..a8f1deb6 100644 --- a/roles/deployment/cluster/tasks/create_data_context.yml +++ b/roles/deployment/cluster/tasks/create_data_context.yml @@ -24,8 +24,8 @@ loop_var: data_context register: result failed_when: - - result.status != 200 - - "'already exists' not in result.json.message | default('')" + - "{{ (result | map(attribute='results') | map(attribute='status') | reject('eq', 200) | length) > 0 }}" + - "{{ (result | map(attribute='results') | map(attribute='json') | map(attribute='message') | reject('regex', 'already exists') | length) > 0 }}" when: - cluster.data_contexts is iterable - "'HDFS' in cluster.services"