Adrià Vilanova MartÃnez | 0643f4f | 2024-07-13 12:27:28 +0200 | [diff] [blame] | 1 | Upload logs to a static webserver |
| 2 | |
| 3 | This uploads logs to a static server using SSH. The server must have |
| 4 | been previously added to the inventory; this can be done with the |
| 5 | :zuul:role:`add-fileserver` role; see that role's documentation for a |
| 6 | description of the site_logs secret in this example post-run playbook: |
| 7 | |
| 8 | .. code-block:: yaml |
| 9 | |
| 10 | - hosts: localhost |
| 11 | roles: |
| 12 | - role: add-fileserver |
| 13 | fileserver: "{{ site_logs }}" |
| 14 | |
| 15 | - hosts: "{{ site_logs.fqdn }}" |
| 16 | gather_facts: False |
| 17 | roles: |
| 18 | - role: upload-logs |
| 19 | zuul_log_url: "http://logs.example.org" |
| 20 | |
| 21 | **Role Variables** |
| 22 | |
| 23 | .. zuul:rolevar:: zuul_log_url |
| 24 | |
| 25 | Base URL where logs are to be found. |
| 26 | |
| 27 | .. zuul:rolevar:: zuul_logserver_root |
| 28 | :default: /srv/static/logs |
| 29 | |
| 30 | The root path to the logs on the logserver. |
| 31 | |
| 32 | .. zuul:rolevar:: zuul_log_compress |
| 33 | :default: false |
| 34 | |
| 35 | When enabled, the console logs Zuul produces will be compressed |
| 36 | before uploading. You may need additional configuration for your web |
| 37 | server to view these files. |
| 38 | |
| 39 | .. zuul:rolevar:: zuul_log_verbose |
| 40 | :default: false |
| 41 | |
| 42 | The synchronize task in this role outputs a lot of information. By |
| 43 | default, no_log is set to avoid overwhelming a reader of the logs. |
| 44 | Set this to true to disable that behavior if it becomes necessary |
| 45 | to debug this role. |
| 46 | |
| 47 | .. zuul:rolevar:: zuul_site_upload_logs |
| 48 | :default: true |
| 49 | |
| 50 | Controls when logs are uploaded. true, the default, means always upload |
| 51 | logs. false means never upload logs. 'failure' means to only upload logs |
| 52 | when the job has failed. |
| 53 | |
| 54 | .. note:: Intended to be set by admins via site-variables. |
| 55 | |
| 56 | .. zuul:rolevar:: zuul_log_path_shard_build |
| 57 | :default: False |
| 58 | |
| 59 | This var is consumed by set-zuul-log-path-fact which upload-logs |
| 60 | calls into. If you set this you will get log paths prefixed with the |
| 61 | first three characters of the build uuid. This will improve log file |
| 62 | sharding. |
| 63 | |
| 64 | More details can be found at |
| 65 | :zuul:rolevar:`set-zuul-log-path-fact.zuul_log_path_shard_build`. |