From c31cd37164ae3e24c70a9de078d8f637386ce8ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= Date: Wed, 5 Jun 2019 17:00:29 +0200 Subject: [PATCH] upload-logs-swift: option for disabling the indexer Our company-internal Swift setup apparently has troubles with user-provided index files. Given that Swift can be configured to create indexes on its own, we can skip creating these files altogether and save some negligible storage space in the process. One can enable Swift's native indexes by something like: openstack container set $container --property web-listings=true This feature does not play well with containers auto-created by Zuul because Zuul doesn't know (and cannot know) how to configure them. But given that the code already supports this feature and that it's just a matter of propagating an Ansible option, and because it fixes a real issue in my Zuul deployment, I think that it makes sense to support this. Change-Id: I952cb2d4a263b07396bc5af60a9753394af3e42b --- roles/upload-logs-swift/README.rst | 7 +++++++ roles/upload-logs-swift/defaults/main.yaml | 1 + roles/upload-logs-swift/tasks/main.yaml | 1 + 3 files changed, 9 insertions(+) diff --git a/roles/upload-logs-swift/README.rst b/roles/upload-logs-swift/README.rst index d5d3a4972..17c661e40 100644 --- a/roles/upload-logs-swift/README.rst +++ b/roles/upload-logs-swift/README.rst @@ -53,3 +53,10 @@ This uploads logs to an OpenStack Object Store (Swift) container. :default: Generated by the role `set-zuul-log-path-fact` Prepend this path to the object names when uploading. + +.. zuul:rolevar:: zuul_log_create_indexes + :default: true + + Whether to create `index.html` files with directory indexes. If set + to false, Swift containers can be marked with a `Web-Listings=true` + property to activate Swift's own directory indexing. diff --git a/roles/upload-logs-swift/defaults/main.yaml b/roles/upload-logs-swift/defaults/main.yaml index 846ed0459..27893357b 100644 --- a/roles/upload-logs-swift/defaults/main.yaml +++ b/roles/upload-logs-swift/defaults/main.yaml @@ -1,3 +1,4 @@ zuul_log_partition: false zuul_log_container: logs zuul_log_container_public: true +zuul_log_create_indexes: true diff --git a/roles/upload-logs-swift/tasks/main.yaml b/roles/upload-logs-swift/tasks/main.yaml index f1d44ecd7..b66b1b023 100644 --- a/roles/upload-logs-swift/tasks/main.yaml +++ b/roles/upload-logs-swift/tasks/main.yaml @@ -24,6 +24,7 @@ container: "{{ zuul_log_container }}" public: "{{ zuul_log_container_public }}" prefix: "{{ zuul_log_path }}" + indexes: "{{ zuul_log_create_indexes }}" files: - "{{ zuul.executor.log_root }}/" delete_after: "{{zuul_log_delete_after | default(omit) }}"