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
This commit is contained in:
Jan Kundrát 2019-06-05 17:00:29 +02:00
parent 2f2d6ce3f7
commit c31cd37164
3 changed files with 9 additions and 0 deletions

View File

@ -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.

View File

@ -1,3 +1,4 @@
zuul_log_partition: false
zuul_log_container: logs
zuul_log_container_public: true
zuul_log_create_indexes: true

View File

@ -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) }}"