- name: Set log path for a change when: zuul.change is defined set_fact: log_path: "{{ zuul.change[-2:] }}/{{ zuul.change }}/{{ zuul.patchset }}/{{ zuul.pipeline }}/{{ zuul.job }}/{{ zuul.build[:7] }}" - name: Set log path for a ref update when: zuul.newrev is defined set_fact: log_path: "{{ zuul.newrev[-2:] }}/{{ zuul.newrev }}/{{ zuul.pipeline }}/{{ zuul.job }}/{{ zuul.build[:7] }}" - name: Create log directories file: path: "{{zuul_logserver_root}}/{{ log_path }}" state: directory recurse: yes mode: 0775 - name: Upload logs to log server synchronize: src: "{{ zuul.executor.log_root }}/" dest: "{{zuul_logserver_root}}/{{ log_path }}/" rsync_opts: - "--exclude=job-output.txt" no_log: true # After this point there are no more logs - name: gzip console log delegate_to: localhost archive: path: "{{ zuul.executor.log_root }}/job-output.txt" - name: Upload console log synchronize: src: "{{ zuul.executor.log_root }}/job-output.txt.gz" dest: "{{zuul_logserver_root}}/{{ log_path }}/job-output.txt.gz" verify_host: true