From 68dec9ecc5b907812aa059cf4b1e164a8fa7ed8c Mon Sep 17 00:00:00 2001
From: "Andrea Frittoli (andreaf)" <andrea.frittoli@gmail.com>
Date: Mon, 18 Dec 2017 16:06:41 +0000
Subject: [PATCH] Dereference symlinks when staging artefacts

If an artefact is a symlink, dereference it before coying it as
just copying the link may render it broken one the staged folder
is synced to the executor.

Change-Id: I5ad4dfccbc1389da3afc53f3c866d3475e006db6
---
 roles/stage-output/tasks/main.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/roles/stage-output/tasks/main.yaml b/roles/stage-output/tasks/main.yaml
index e6ce01f61..fefc674ff 100644
--- a/roles/stage-output/tasks/main.yaml
+++ b/roles/stage-output/tasks/main.yaml
@@ -44,7 +44,7 @@
 - name: Copy text files to staging folder
   # remote_src copy does not work recursively, synchronise is restricted by
   # zuul, using command
-  command: cp -pR {{ item.source}} {{ stage_dir }}/{{ item.dest }}
+  command: cp -pRL {{ item.source}} {{ stage_dir }}/{{ item.dest }}
   with_items: "{{ all_sources }}"
 
 # NOTE(andreaf) The ansible module does not support recursive archive, so