From fac9ac16404e37c841d9e7a4ba36651424ca3f17 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 28 Dec 2024 09:26:05 -0500 Subject: [PATCH 1/5] Update docs/configuring-playbook-synapse-auto-compressor.md: add the common section "Extending the configuration" Signed-off-by: Suguru Hirahara --- docs/configuring-playbook-synapse-auto-compressor.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/configuring-playbook-synapse-auto-compressor.md b/docs/configuring-playbook-synapse-auto-compressor.md index 8af611fae..1b3c7690b 100644 --- a/docs/configuring-playbook-synapse-auto-compressor.md +++ b/docs/configuring-playbook-synapse-auto-compressor.md @@ -14,6 +14,14 @@ Add the following configuration to your `inventory/host_vars/matrix.example.com/ matrix_synapse_auto_compressor_enabled: true ``` +### Extending the configuration + +There are some additional things you may wish to configure about the component. + +Take a look at: + +- `roles/custom/matrix-synapse-auto-compressor/defaults/main.yml` for some variables that you can customize via your `vars.yml` file + ## Installing After configuring the playbook, run it with [playbook tags](playbook-tags.md) as below: From 931e6e2dcecec549155c4c5d13d539236b990bc0 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Thu, 30 Jan 2025 16:13:10 +0900 Subject: [PATCH 2/5] Update docs/configuring-playbook-synapse-auto-compressor.md: add the common section "Troubleshooting" Signed-off-by: Suguru Hirahara --- docs/configuring-playbook-synapse-auto-compressor.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/configuring-playbook-synapse-auto-compressor.md b/docs/configuring-playbook-synapse-auto-compressor.md index 1b3c7690b..419c781ac 100644 --- a/docs/configuring-playbook-synapse-auto-compressor.md +++ b/docs/configuring-playbook-synapse-auto-compressor.md @@ -46,3 +46,7 @@ Sometimes it can be helpful to execute compression as you'd like, avoiding to wa If you want to execute it immediately, log in to the server with SSH and run `systemctl start matrix-synapse-auto-compressor`. This will not return until the compression is done, so it can possibly take a long time. Consider using [tmux](https://en.wikipedia.org/wiki/Tmux) if your SSH connection is unstable. + +## Troubleshooting + +As with all other services, you can find the logs in [systemd-journald](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html) by logging in to the server with SSH and running `journalctl -fu matrix-synapse-auto-compressor`. From b0c73c8378aab45cd073b53e98bff7a0c9bd4edd Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Thu, 30 Jan 2025 16:19:12 +0900 Subject: [PATCH 3/5] Update docs for backup-borg and synapse-auto-compressor: use the common descriptions Signed-off-by: Suguru Hirahara --- docs/configuring-playbook-backup-borg.md | 10 +++++++--- docs/configuring-playbook-synapse-auto-compressor.md | 12 +++++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/docs/configuring-playbook-backup-borg.md b/docs/configuring-playbook-backup-borg.md index 702e72613..9f219ffc4 100644 --- a/docs/configuring-playbook-backup-borg.md +++ b/docs/configuring-playbook-backup-borg.md @@ -95,9 +95,9 @@ backup_borg_retention_keep_monthly: 12 backup_borg_retention_keep_yearly: 2 ``` -### Edit the backup schedule (optional) +### Edit the schedule (optional) -By default the backup will run 4 a.m. every day based on the `backup_borg_schedule` variable. It is defined in the format of systemd timer calendar. +By default the task will run 4 a.m. every day based on the `backup_borg_schedule` variable. It is defined in the format of systemd timer calendar. To edit the schedule, add the following configuration to your `vars.yml` file (adapt to your needs): @@ -134,7 +134,11 @@ The shortcut commands with the [`just` program](just.md) are also available: `ju `just install-all` is useful for maintaining your setup quickly ([2x-5x faster](../CHANGELOG.md#2x-5x-performance-improvements-in-playbook-runtime) than `just setup-all`) when its components remain unchanged. If you adjust your `vars.yml` to remove other components, you'd need to run `just setup-all`, or these components will still remain installed. Note these shortcuts run the `ensure-matrix-users-created` tag too. -## Manually start a backup +## Usage + +After installation, `backup-borg` will run automatically every day at `04:00:00` (as defined in `backup_borg_schedule` by default). + +### Manually start the task Sometimes it can be helpful to run the backup as you'd like, avoiding to wait until 4 a.m., like when you test your configuration. diff --git a/docs/configuring-playbook-synapse-auto-compressor.md b/docs/configuring-playbook-synapse-auto-compressor.md index 419c781ac..959765531 100644 --- a/docs/configuring-playbook-synapse-auto-compressor.md +++ b/docs/configuring-playbook-synapse-auto-compressor.md @@ -14,6 +14,16 @@ Add the following configuration to your `inventory/host_vars/matrix.example.com/ matrix_synapse_auto_compressor_enabled: true ``` +### Edit the schedule (optional) + +By default the task will run 0 a.m. every day based on the `matrix_synapse_auto_compressor_calendar` variable. It is defined in the format of systemd timer calendar. + +To edit the schedule, add the following configuration to your `vars.yml` file (adapt to your needs): + +```yaml +matrix_synapse_auto_compressor_calendar: "*-*-* 00:00:00" +``` + ### Extending the configuration There are some additional things you may wish to configure about the component. @@ -39,7 +49,7 @@ The shortcut commands with the [`just` program](just.md) are also available: `ju After installation, `synapse_auto_compressor` will run automatically every day at `00:00:00` (as defined in `matrix_synapse_auto_compressor_calendar` by default). -## Manually execute compression +### Manually start the task Sometimes it can be helpful to execute compression as you'd like, avoiding to wait until 00:00, like when you test your configuration. From 08e34a4a6fb8db87a81afaa88ec7a6f5cf1759c3 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 1 Feb 2025 01:24:55 +0900 Subject: [PATCH 4/5] Rename "matrix_synapse_auto_compressor_calendar" to "matrix_synapse_auto_compressor_schedule" for consistency Signed-off-by: Suguru Hirahara --- docs/configuring-playbook-synapse-auto-compressor.md | 6 +++--- .../matrix-synapse-auto-compressor/defaults/main.yml | 2 +- .../tasks/validate_config.yml | 9 +++++++++ .../templates/matrix-synapse-auto-compressor.timer.j2 | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/configuring-playbook-synapse-auto-compressor.md b/docs/configuring-playbook-synapse-auto-compressor.md index 959765531..988be65c3 100644 --- a/docs/configuring-playbook-synapse-auto-compressor.md +++ b/docs/configuring-playbook-synapse-auto-compressor.md @@ -16,12 +16,12 @@ matrix_synapse_auto_compressor_enabled: true ### Edit the schedule (optional) -By default the task will run 0 a.m. every day based on the `matrix_synapse_auto_compressor_calendar` variable. It is defined in the format of systemd timer calendar. +By default the task will run 0 a.m. every day based on the `matrix_synapse_auto_compressor_schedule` variable. It is defined in the format of systemd timer calendar. To edit the schedule, add the following configuration to your `vars.yml` file (adapt to your needs): ```yaml -matrix_synapse_auto_compressor_calendar: "*-*-* 00:00:00" +matrix_synapse_auto_compressor_schedule: "*-*-* 00:00:00" ``` ### Extending the configuration @@ -47,7 +47,7 @@ The shortcut commands with the [`just` program](just.md) are also available: `ju ## Usage -After installation, `synapse_auto_compressor` will run automatically every day at `00:00:00` (as defined in `matrix_synapse_auto_compressor_calendar` by default). +After installation, `synapse_auto_compressor` will run automatically every day at `00:00:00` (as defined in `matrix_synapse_auto_compressor_schedule` by default). ### Manually start the task diff --git a/roles/custom/matrix-synapse-auto-compressor/defaults/main.yml b/roles/custom/matrix-synapse-auto-compressor/defaults/main.yml index e80ce35f0..212213d64 100644 --- a/roles/custom/matrix-synapse-auto-compressor/defaults/main.yml +++ b/roles/custom/matrix-synapse-auto-compressor/defaults/main.yml @@ -56,7 +56,7 @@ matrix_synapse_auto_compressor_database_name: 'synapse' matrix_synapse_auto_compressor_synapse_database: 'postgres://{{ matrix_synapse_auto_compressor_database_username | urlencode() }}:{{ matrix_synapse_auto_compressor_database_password | urlencode() }}@{{ matrix_synapse_auto_compressor_database_hostname }}:{{ matrix_synapse_auto_compressor_database_port }}/{{ matrix_synapse_auto_compressor_database_name }}' # systemd calendar configuration for the compressor job -matrix_synapse_auto_compressor_calendar: "*-*-* 00:00:00" +matrix_synapse_auto_compressor_schedule: "*-*-* 00:00:00" # The number of state groups to work on at once. # All of the entries from state_groups_state are requested from the database for state groups that are worked on. diff --git a/roles/custom/matrix-synapse-auto-compressor/tasks/validate_config.yml b/roles/custom/matrix-synapse-auto-compressor/tasks/validate_config.yml index b0dbfab06..1d1405044 100644 --- a/roles/custom/matrix-synapse-auto-compressor/tasks/validate_config.yml +++ b/roles/custom/matrix-synapse-auto-compressor/tasks/validate_config.yml @@ -1,4 +1,13 @@ --- +- name: (Deprecation) Catch and report renamed settings + ansible.builtin.fail: + msg: >- + Your configuration contains a variable, which now has a different name. + Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`). + when: "item.old in vars" + with_items: + - "old": "matrix_synapse_auto_compressor_calendar" + "new": "matrix_synapse_auto_compressor_schedule" - name: Fail if required matrix-synapse-auto-compressor settings not defined ansible.builtin.fail: diff --git a/roles/custom/matrix-synapse-auto-compressor/templates/matrix-synapse-auto-compressor.timer.j2 b/roles/custom/matrix-synapse-auto-compressor/templates/matrix-synapse-auto-compressor.timer.j2 index 1d7b16d33..82c235c80 100644 --- a/roles/custom/matrix-synapse-auto-compressor/templates/matrix-synapse-auto-compressor.timer.j2 +++ b/roles/custom/matrix-synapse-auto-compressor/templates/matrix-synapse-auto-compressor.timer.j2 @@ -3,7 +3,7 @@ Description=Synapse State Auto Compressor Timer [Timer] Unit=matrix-synapse-auto-compressor.service -OnCalendar={{ matrix_synapse_auto_compressor_calendar }} +OnCalendar={{ matrix_synapse_auto_compressor_schedule }} [Install] WantedBy=timers.target From 1bb21388c5cabadaf727078502b7f2af4fc4c5a9 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Thu, 30 Jan 2025 16:25:02 +0900 Subject: [PATCH 5/5] Update docs/configuring-playbook-backup-borg.md: add the common section "Troubleshooting" Signed-off-by: Suguru Hirahara --- docs/configuring-playbook-backup-borg.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/configuring-playbook-backup-borg.md b/docs/configuring-playbook-backup-borg.md index 9f219ffc4..aca22c2f6 100644 --- a/docs/configuring-playbook-backup-borg.md +++ b/docs/configuring-playbook-backup-borg.md @@ -145,3 +145,7 @@ Sometimes it can be helpful to run the backup as you'd like, avoiding to wait un If you want to run it immediately, log in to the server with SSH and run `systemctl start matrix-backup-borg`. This will not return until the backup is done, so it can possibly take a long time. Consider using [tmux](https://en.wikipedia.org/wiki/Tmux) if your SSH connection is unstable. + +## Troubleshooting + +As with all other services, you can find the logs in [systemd-journald](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html) by logging in to the server with SSH and running `journalctl -fu backup-borg`.