diff --git a/roles/ara-report/README.rst b/roles/ara-report/README.rst index 3bfcd1389..c8504107b 100644 --- a/roles/ara-report/README.rst +++ b/roles/ara-report/README.rst @@ -51,9 +51,7 @@ If ARA is enabled, generates a report or saves a copy of the ARA database. .. _mimetypes: https://opendev.org/opendev/puppet-openstackci/src/commit/5fe1f3d2d5e40c2458721e7dcf8631d62ea2525f/templates/logs.vhost.erb#L24 .. zuul:rolevar:: ara_report_path - :default: ``ara`` - - This path is relative to the root of the log directory. + :default: ``{{ zuul.executor.log_root }}/ara`` When report_type is 'html' directory where the HTML report will be generated. When report_type is 'database', directory where the database is saved. diff --git a/roles/ara-report/defaults/main.yaml b/roles/ara-report/defaults/main.yaml index 6e83c0649..e420b378c 100644 --- a/roles/ara-report/defaults/main.yaml +++ b/roles/ara-report/defaults/main.yaml @@ -19,8 +19,7 @@ ara_report_type: 'html' # Note that when using 'database', an ARA web application can load the database # dynamically. See the ARA documentation for details: # https://ara.readthedocs.io/en/latest/advanced.html#serving-ara-sqlite-databases-over-http -# This path is relative to the root of the log directory. -ara_report_path: 'ara' +ara_report_path: '{{ zuul.executor.log_root }}/ara' # When report_type is 'html', whether to compress the ARA HTML output or not ara_compress_html: true diff --git a/roles/ara-report/tasks/main.yaml b/roles/ara-report/tasks/main.yaml index 8e5742d27..b0463f091 100644 --- a/roles/ara-report/tasks/main.yaml +++ b/roles/ara-report/tasks/main.yaml @@ -7,7 +7,7 @@ - name: Warn if ARA is not installed debug: msg: | - ARA is not installed on the executor node, no report will be available. + ARA is not installed, no report will be available. when: ara_installed.rc != 0 - name: Check that the ARA database exists @@ -36,10 +36,6 @@ It is likely that no report will be available, please verify the execution and the parameters of the role for details. -- name: Prefix the log path with the log root - set_fact: - final_ara_report_path: "{{ zuul.executor.log_root }}/{{ ara_report_path }}" - - when: - ara_installed.rc == 0 - ara_db.stat.exists @@ -48,7 +44,7 @@ # Always generate (true), never (false) or only on failure ('failure') # Additionally cover for edge cases where zuul_success might be undefined - name: Generate ARA HTML output - command: "{{ ara_report_executable }} generate html {{ final_ara_report_path }}" + command: "{{ ara_report_executable }} generate html {{ ara_report_path }}" environment: ARA_DATABASE: "sqlite:///{{ ara_database_path }}" when: ara_report_run | bool or @@ -56,7 +52,7 @@ register: ara_generated - name: Compress ARA HTML output - command: gzip --recursive --best {{ final_ara_report_path }} + command: gzip --recursive --best {{ ara_report_path }} when: - ara_compress_html | bool - not ara_generated is skipped @@ -83,11 +79,11 @@ block: - name: Create the ARA database report directory file: - path: "{{ final_ara_report_path }}" + path: "{{ ara_report_path }}" state: directory - name: Save the ARA database - command: cp {{ ara_database_path }} {{ final_ara_report_path }} + command: cp {{ ara_database_path }} {{ ara_report_path }} - name: Return ARA report zuul_return: data: