From 851ba9ea4d69e00e21814f7b8c31beac1fb1d61b Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Fri, 21 Jul 2017 17:06:14 -0400 Subject: [PATCH] Support multi node jobs for tox logs It is possible somebody may want to run tox jobs over multiple nodes. Check to see if more then one node is in our inventory, if so then add the inventory_hostname to the log path. Change-Id: Icd0532cb415fdae42eae6d2269d5a0be5fcdf98a Signed-off-by: Paul Belanger --- playbooks/tox/post.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/playbooks/tox/post.yaml b/playbooks/tox/post.yaml index e9d2bf9f7..282fbe05e 100644 --- a/playbooks/tox/post.yaml +++ b/playbooks/tox/post.yaml @@ -9,14 +9,25 @@ use_regex: yes register: result + - name: Set tox log path for multiple nodes + set_fact: + log_path: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}/tox" + when: groups['all'] | length > 1 + + - name: Set tox log path for single node + set_fact: + log_path: "{{ zuul.executor.log_root }}/tox" + when: log_path is not defined + - name: Ensure local tox dir file: - path: "{{ zuul.executor.log_root }}/tox" + path: "{{ log_path }}" state: directory + delegate_to: localhost - name: Collect tox logs synchronize: - dest: "{{ zuul.executor.log_root }}/tox" + dest: "{{ log_path }}" mode: pull src: "{{ item.path }}/log/" verify_host: true