Skip to content

Commit 6289b1c

Browse files
author
Samuel Rac
committed
Add debug messages in the reportportal role
1 parent 895836e commit 6289b1c

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

roles/reportportal/tasks/main.yaml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
# License for the specific language governing permissions and limitations
1515
# under the License.
1616

17+
- name: Debug - Run reportportal role
18+
ansible.builtin.debug:
19+
msg: "Run reportportal role"
20+
1721
- name: Check if mandatory variables are defined and not empty
1822
ansible.builtin.assert:
1923
that:
@@ -23,11 +27,20 @@
2327
- cifmw_reportportal_project is defined and cifmw_reportportal_project | length > 0
2428
- cifmw_reportportal_droute_client_url is defined and cifmw_reportportal_droute_client_url | length > 0
2529

30+
- name: Debug - Mandatory variables check passed
31+
ansible.builtin.debug:
32+
msg: "All mandatory variables are defined and not empty"
33+
2634
- name: Make sure the droute directory exists
2735
ansible.builtin.file:
2836
path: "{{ cifmw_reportportal_droute_dir }}"
2937
state: directory
3038
mode: "0755"
39+
register: reportportal_droute_dir_result
40+
41+
- name: Debug - droute directory
42+
ansible.builtin.debug:
43+
msg: "droute directory path: {{ cifmw_reportportal_droute_dir }}, state: {{ reportportal_droute_dir_result.state | default('unknown') }}"
3144

3245
- name: Get the Data router client
3346
vars:
@@ -43,13 +56,24 @@
4356
dest: "{{ cifmw_reportportal_droute_dir }}"
4457
backup: true
4558
mode: "0755"
59+
register: reportportal_get_url_result
60+
when: not cifmw_reportportal_dry_run | bool
61+
62+
- name: Debug - Data router client download
63+
ansible.builtin.debug:
64+
msg: "Downloaded from {{ _droute_url }} to {{ cifmw_reportportal_droute_dir }}, changed: {{ reportportal_get_url_result.changed | default(false) }}"
4665
when: not cifmw_reportportal_dry_run | bool
4766

4867
- name: Create the metadata file
4968
ansible.builtin.template:
5069
src: metadata.json.j2
5170
dest: "{{ cifmw_reportportal_metadata_file }}"
5271
mode: "0755"
72+
register: reportportal_metadata_file_result
73+
74+
- name: Debug - Metadata file creation
75+
ansible.builtin.debug:
76+
msg: "Metadata file created at {{ cifmw_reportportal_metadata_file }}, changed: {{ reportportal_metadata_file_result.changed | default(false) }}"
5377

5478
- name: Send the results via Data router client call
5579
ansible.builtin.command:
@@ -62,10 +86,15 @@
6286
--username={{ cifmw_reportportal_datarouter_username }}
6387
--password={{ cifmw_reportportal_datarouter_password }}
6488
--url={{ cifmw_reportportal_datarouter_url }}
65-
register: droute_result
89+
register: reportportal_droute_result
90+
when: not cifmw_reportportal_dry_run | bool
91+
92+
- name: Debug - Data router client command execution
93+
ansible.builtin.debug:
94+
msg: "Executed droute command, return code: {{ reportportal_droute_result.rc | default('N/A') }}"
6695
when: not cifmw_reportportal_dry_run | bool
6796

6897
- name: Log droute result
6998
ansible.builtin.debug:
70-
var: droute_result.stdout
99+
var: reportportal_droute_result.stdout
71100
when: not cifmw_reportportal_dry_run | bool

0 commit comments

Comments
 (0)