diff --git a/roles/emit-ara-html/README.rst b/roles/emit-ara-html/README.rst index 75f667af7..389c63b06 100644 --- a/roles/emit-ara-html/README.rst +++ b/roles/emit-ara-html/README.rst @@ -1 +1,14 @@ -Have ara generate html logs if ara and ara data are both present. +Have ARA generate html logs if ARA and ARA data are both present. + +**Role Variables** + +.. zuul:rolevar:: ara_compress_html + + Whether to compress the ARA HTML output or not. + Defaults to ``true``. + +.. tip:: + Make sure the web server is configured to set the required mimetypes_ in + order to serve gzipped content properly. + +.. _mimetypes: https://git.openstack.org/cgit/openstack-infra/puppet-openstackci/tree/templates/logs.vhost.erb?id=5fe1f3d2d5e40c2458721e7dcf8631d62ea2525f#n24 diff --git a/roles/emit-ara-html/defaults/main.yaml b/roles/emit-ara-html/defaults/main.yaml new file mode 100644 index 000000000..29dedca2e --- /dev/null +++ b/roles/emit-ara-html/defaults/main.yaml @@ -0,0 +1,2 @@ +# Whether to compress the ARA HTML output or not +ara_compress_html: true diff --git a/roles/emit-ara-html/tasks/main.yaml b/roles/emit-ara-html/tasks/main.yaml index eca3f7267..58ec43cd6 100644 --- a/roles/emit-ara-html/tasks/main.yaml +++ b/roles/emit-ara-html/tasks/main.yaml @@ -1,14 +1,19 @@ -- name: Check for ara db +- name: Check for ARA db stat: path: "{{ zuul.executor.work_root }}/.ara/ansible.sqlite" register: ara_db_stat -- name: Check for ara install +- name: Check for ARA install command: which ara ignore_errors: yes register: ara_command_type when: ara_db_stat.stat.exists -- name: Generate ara html output +- name: Generate ARA html output command: "ara generate html {{ zuul.executor.log_root }}/ara" when: ara_command_type|succeeded and not ara_command_type|skipped + +- name: Compress ARA html output + archive: + path: "{{ zuul.executor.log_root }}/ara" + when: ara_compress_html | bool