4 changed files with 55 additions and 0 deletions
@ -0,0 +1,5 @@
|
||||
--- |
||||
|
||||
- hosts: all |
||||
roles: |
||||
- role: tobiko-collect-report |
@ -0,0 +1,7 @@
|
||||
--- |
||||
tobiko_report_dir: "{{ zuul_work_dir }}/report" |
||||
|
||||
zuul_work_dir: "{{ zuul.project.src_dir }}" |
||||
|
||||
zuul_output_dir: "{{ ansible_user_dir }}/zuul-output" |
||||
zuul_use_fetch_output: "{{ zuul_site_use_fetch_output|default(false) }}" |
@ -0,0 +1,42 @@
|
||||
--- |
||||
|
||||
- name: Set Tobiko log path for multiple nodes |
||||
set_fact: |
||||
log_path: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}/tobiko" |
||||
when: groups['all'] | length > 1 |
||||
|
||||
- name: Set Tobiko log path for single node |
||||
set_fact: |
||||
log_path: "{{ zuul.executor.log_root }}/tobiko" |
||||
when: log_path is not defined |
||||
|
||||
- name: Ensure local report dir |
||||
file: |
||||
path: "{{ log_path }}" |
||||
state: directory |
||||
mode: 0755 |
||||
delegate_to: localhost |
||||
|
||||
- name: Ensure zuul-output report dir |
||||
file: |
||||
path: "{{ zuul_output_dir }}/logs/tobiko" |
||||
state: directory |
||||
mode: 0755 |
||||
when: zuul_use_fetch_output |
||||
|
||||
- name: Copy Tobiko logs # noqa risky-file-permissions |
||||
copy: |
||||
dest: "{{ zuul_output_dir }}/logs/tobiko/" |
||||
src: "{{ tobiko_report_dir }}/" |
||||
remote_src: true |
||||
when: zuul_use_fetch_output |
||||
|
||||
- name: Collect Tobiko logs |
||||
synchronize: |
||||
dest: "{{ log_path }}" |
||||
mode: pull |
||||
src: "{{ tobiko_report_dir }}/" |
||||
verify_host: true |
||||
owner: no |
||||
group: no |
||||
when: not zuul_use_fetch_output |
Loading…
Reference in new issue