summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2017-10-13 08:09:13 -0500
committerMonty Taylor <mordred@inaugust.com>2019-01-04 22:03:42 +0000
commit8e46e87cbe99d2190f9132df29988e9f54c82582 (patch)
tree17ad991eec05e8260226d98a8c42c3bdc4f51a52
parent5be1cd99f56e75ba6edf88175c830a9f5fe1bdc2 (diff)
Add role to fetch output from nodes
When jobs put their output into output dirs, it needs to be fetched back to the executors for publication. Change-Id: I3dfbbd4327102b62160713ca782dfa4b13d26924
Notes
Notes (review): Code-Review+2: James E. Blair <corvus@inaugust.com> Code-Review+2: Clark Boylan <cboylan@sapwetik.org> Workflow+1: Clark Boylan <cboylan@sapwetik.org> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Sat, 05 Jan 2019 00:28:14 +0000 Reviewed-on: https://review.openstack.org/511843 Project: openstack-infra/zuul-jobs Branch: refs/heads/master
-rw-r--r--roles/fetch-output/README.rst13
-rw-r--r--roles/fetch-output/defaults/main.yaml1
-rw-r--r--roles/fetch-output/tasks/main.yaml39
3 files changed, 53 insertions, 0 deletions
diff --git a/roles/fetch-output/README.rst b/roles/fetch-output/README.rst
new file mode 100644
index 0000000..9f59a00
--- /dev/null
+++ b/roles/fetch-output/README.rst
@@ -0,0 +1,13 @@
1Collect output from build nodes
2
3This role collects logs, artifacts and docs from subdirs of the
4``zuul_output_dir`` on the remote nodes to equivalent directories
5on the executor so that later parts of the system can publish the
6content to appropriate permanent locations.
7
8**Role Variables**
9
10.. zuul:rolevar:: zuul_output_dir
11 :default: {{ ansible_user_dir }}/zuul-output
12
13 Base directory for collecting job output.
diff --git a/roles/fetch-output/defaults/main.yaml b/roles/fetch-output/defaults/main.yaml
new file mode 100644
index 0000000..3e6da11
--- /dev/null
+++ b/roles/fetch-output/defaults/main.yaml
@@ -0,0 +1 @@
zuul_output_dir: "{{ ansible_user_dir }}/zuul-output"
diff --git a/roles/fetch-output/tasks/main.yaml b/roles/fetch-output/tasks/main.yaml
new file mode 100644
index 0000000..254cccd
--- /dev/null
+++ b/roles/fetch-output/tasks/main.yaml
@@ -0,0 +1,39 @@
1- name: Set log path for multiple nodes
2 set_fact:
3 log_path: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}"
4 when: groups['all'] | length > 1
5
6- name: Set log path for single node
7 set_fact:
8 log_path: "{{ zuul.executor.log_root }}"
9 when: log_path is not defined
10
11- name: Ensure local output dirs
12 file:
13 path: "{{ item }}"
14 state: directory
15 with_items:
16 - "{{ log_path }}"
17 - "{{ zuul.executor.work_dir }}/artifacts"
18 - "{{ zuul.executor.work_dir }}/docs"
19
20- name: Collect log output
21 synchronize:
22 dest: "{{ log_path }}/"
23 mode: pull
24 src: "{{ zuul_output_dir }}/logs/"
25 verify_host: true
26
27- name: Collect artifacts
28 synchronize:
29 dest: "{{ zuul.executor.work_dir }}/artifacts/"
30 mode: pull
31 src: "{{ zuul_output_dir }}/artifacts/"
32 verify_host: true
33
34- name: Collect docs
35 synchronize:
36 dest: "{{ zuul.executor.work_dir }}/docs/"
37 mode: pull
38 src: "{{ zuul_output_dir }}/docs/"
39 verify_host: true