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