zuul-jobs/roles/fetch-output/tasks/main.yaml
Clark Boylan d49893f894 Partial address ansible-lint E208
- replaces ignore with a warn, which displays issue without affecting
  the linting outcome (allowing gradual fixing)
- bumps linter to enable the warn_list feature
- fixes a set of issues, others will be fixed in follow-up

Change-Id: I7d6f8c156b06f68f681943e88860930968e7c9f9
2020-09-29 10:29:01 +01:00

41 lines
1.0 KiB
YAML

- name: Set log path for multiple nodes
set_fact:
log_path: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}"
when: groups['all'] | length > 1
- name: Set log path for single node
set_fact:
log_path: "{{ zuul.executor.log_root }}"
when: log_path is not defined
- name: Ensure local output dirs
delegate_to: localhost
file:
path: "{{ zj_output_dir }}"
state: directory
mode: 0755
with_items:
- "{{ log_path }}"
- "{{ zuul.executor.work_root }}/artifacts"
- "{{ zuul.executor.work_root }}/docs"
loop_control:
loop_var: zj_output_dir
- name: Collect logs, artifacts and docs
synchronize:
dest: "{{ zj_output.dest }}/"
mode: pull
src: "{{ zuul_output_dir }}/{{ zj_output.src }}/"
verify_host: true
owner: false
group: false
loop:
- dest: "{{ log_path }}"
src: "logs"
- dest: "{{ zuul.executor.work_root }}/artifacts"
src: "artifacts"
- dest: "{{ zuul.executor.work_root }}/docs"
src: "docs"
loop_control:
loop_var: zj_output