From af332a6d7538e0543dee44fbd76bae252dc185a9 Mon Sep 17 00:00:00 2001 From: Tobias Henkel Date: Tue, 31 Jul 2018 10:52:38 +0200 Subject: [PATCH] Allow predefined zuul_log_path during swift upload Some deployments want its own naming schemes like having the project name if zuul.change is defined. To support that only set the zuul_log_path if it's undefined yet. Change-Id: I5f1916bacc12026ce8b4e3f7c7ddeaff6ba7aa06 --- roles/wip-upload-logs-swift/README.rst | 5 +++++ roles/wip-upload-logs-swift/tasks/main.yaml | 1 + 2 files changed, 6 insertions(+) diff --git a/roles/wip-upload-logs-swift/README.rst b/roles/wip-upload-logs-swift/README.rst index 7b216dee8..beb12efbe 100644 --- a/roles/wip-upload-logs-swift/README.rst +++ b/roles/wip-upload-logs-swift/README.rst @@ -46,3 +46,8 @@ This uploads logs to an OpenStack Object Store (Swift) container. If the container is created, should it be created with global read ACLs. If the container already exists, it will not be modified. + +.. zuul:rolevar:: zuul_log_path + :default: Generated by the role `set-zuul-log-path-fact` + + Prepend this path to the object names when uploading. diff --git a/roles/wip-upload-logs-swift/tasks/main.yaml b/roles/wip-upload-logs-swift/tasks/main.yaml index 0c1b229f2..04d454112 100644 --- a/roles/wip-upload-logs-swift/tasks/main.yaml +++ b/roles/wip-upload-logs-swift/tasks/main.yaml @@ -1,6 +1,7 @@ - name: Set zuul-log-path fact include_role: name: set-zuul-log-path-fact + when: zuul_log_path is not defined # Always upload (true), never upload (false) or only on failure ('failure') - when: zuul_site_upload_logs | default(true) | bool or