From 859aa2969a89bd252a6b4cce5b4ff297df72fa93 Mon Sep 17 00:00:00 2001 From: Tobias Henkel Date: Tue, 31 Jul 2018 15:32:05 +0200 Subject: [PATCH] Add delete_after to swift upload role The module used by the swift upload supports setting the x-delete-after header. However this is not plumbed through the role so do that. Change-Id: I9404a1c00062e4bb60d00a25b29897d4606df737 --- roles/wip-upload-logs-swift/README.rst | 6 ++++++ roles/wip-upload-logs-swift/tasks/main.yaml | 1 + 2 files changed, 7 insertions(+) diff --git a/roles/wip-upload-logs-swift/README.rst b/roles/wip-upload-logs-swift/README.rst index beb12efbe..7f0411f47 100644 --- a/roles/wip-upload-logs-swift/README.rst +++ b/roles/wip-upload-logs-swift/README.rst @@ -47,6 +47,12 @@ 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_delete_after + :default: 15552000 + + Number of seconds to delete objects after upload. Default is 6 months + (15552000 seconds) and if set to 0 X-Delete-After will not be set. + .. zuul:rolevar:: zuul_log_path :default: Generated by the role `set-zuul-log-path-fact` diff --git a/roles/wip-upload-logs-swift/tasks/main.yaml b/roles/wip-upload-logs-swift/tasks/main.yaml index 04d454112..90eee2f6a 100644 --- a/roles/wip-upload-logs-swift/tasks/main.yaml +++ b/roles/wip-upload-logs-swift/tasks/main.yaml @@ -26,6 +26,7 @@ prefix: "{{ zuul_log_path }}" files: - "{{ zuul.executor.log_root }}/" + delete_after: "{{zuul_log_delete_after | default(omit) }}" register: upload_results - name: Return log URL to Zuul