From bce7dbc7afe2cc60123fa353b1ea7c099d3a4c48 Mon Sep 17 00:00:00 2001 From: Andy Rajagopalan Date: Sat, 7 Dec 2019 09:50:36 -0800 Subject: [PATCH] add import status task --- roles/bitbucket_dataset_restore/tasks/main.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/roles/bitbucket_dataset_restore/tasks/main.yml b/roles/bitbucket_dataset_restore/tasks/main.yml index cad7f13..d0eab5b 100644 --- a/roles/bitbucket_dataset_restore/tasks/main.yml +++ b/roles/bitbucket_dataset_restore/tasks/main.yml @@ -33,11 +33,21 @@ until: output.status == 200 retries: 6 delay: 15 - failed_when: output.state != 'INITIALISING' - #failed_when: "'INITIALISING' not in output.content" + failed_when: "'INITIALISING' not in output.content" - name: get status of import debug: var=output.json.state +- name: get status of import + debug: var=output.json.id - +- name: get import status + uri: + url: "{{ atl_bitbucket_baseurl }}/rest/api/1.0/migration/imports/{{ output.json.id }}" + user: admin + password: "{{ atl_bitbucket_admin_password }}" + method: get + force_basic_auth: yes + body_format: json + return_content: yes + register: import_status \ No newline at end of file