diff --git a/roles/upload-logs/README.rst b/roles/upload-logs/README.rst index ecc45165d..98dcb43f8 100644 --- a/roles/upload-logs/README.rst +++ b/roles/upload-logs/README.rst @@ -12,3 +12,12 @@ This uploads logs to a static webserver using SSH. :default: /srv/static/logs The root path to the logs on the logserver. + +.. zuul:rolevar:: zuul_site_upload_logs + :default: true + + Controls when logs are uploaded. true, the default, means always upload + logs. false means never upload logs. 'failure' means to only upload logs + when the job has failed. + + .. note:: Intended to be set by admins via site-variables. diff --git a/roles/upload-logs/tasks/main.yaml b/roles/upload-logs/tasks/main.yaml index 11a8abb06..661ce9aec 100644 --- a/roles/upload-logs/tasks/main.yaml +++ b/roles/upload-logs/tasks/main.yaml @@ -2,9 +2,9 @@ include_role: name: set-zuul-log-path-fact -# NOTE(mordred) Temporary hack to only upload logs on failures to work around -# unfortunately timed disk outage. -- when: not zuul_success|bool +# Always upload (true), never upload (false) or only on failure ('failure') +- when: zuul_site_upload_logs | default(true) | bool or + (zuul_site_upload_logs == 'failure' and not zuul_success | bool) block: - name: Create log directories