Add collect and upload log roles

Change-Id: Id12fb552f81e7eda9992694250582823be2c1a3c
This commit is contained in:
James E. Blair 2017-06-27 15:38:47 -07:00
parent 2f4e7ddaee
commit 47c850f0e3
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,6 @@
- name: Collect logs from remote hosts.
synchronize:
dest: "{{ zuul.executor.log_root }}"
mode: pull
src: "logs/"
no_log: true

View File

@ -0,0 +1,15 @@
- name: Set log path for a change.
when: zuul.change
set_fact:
log_path: "{{ zuul.change[:-2] }}/{{ zuul.change }}/{{ zuul.patchset }}/{{ zuul.pipeline }}/{{ zuul.uuid[:7] }}/"
- name: Set log path for a ref update.
when: zuul.newrev
set_fact:
log_path: "{{ zuul.newrev[:-2] }}/{{ zuul.newrev }}/{{ zuul.pipeline }}/{{ zuul.uuid[:7] }}/"
- name: Upload logs to log server.
synchronize:
src: "{{ zuul.executor.log_root }}"
dest: "{{ log_path }}"
no_log: true