From d225f52ba27315b0bca62c196741a86bd981a37a Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 28 Dec 2024 10:35:19 -0500 Subject: [PATCH 1/3] Update docs/configuring-playbook-alertmanager-receiver.md: add the common section "Extending the configuration" Signed-off-by: Suguru Hirahara --- docs/configuring-playbook-alertmanager-receiver.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/configuring-playbook-alertmanager-receiver.md b/docs/configuring-playbook-alertmanager-receiver.md index 2184821fb..84be123f6 100644 --- a/docs/configuring-playbook-alertmanager-receiver.md +++ b/docs/configuring-playbook-alertmanager-receiver.md @@ -66,8 +66,6 @@ matrix_alertmanager_receiver_config_matrix_room_mapping: some-room-name: "!qporfwt:{{ matrix_domain }}" ``` -See `roles/custom/matrix-alertmanager-receiver/defaults/main.yml` for additional configuration variables. - ### Adjusting the matrix-alertmanager-receiver URL (optional) By tweaking the `matrix_alertmanager_receiver_hostname` and `matrix_alertmanager_receiver_path_prefix` variables, you can easily make the service available at a **different hostname and/or path** than the default one. @@ -84,6 +82,15 @@ If you've changed the default hostname, you may need to create a CNAME record fo When setting, replace `example.com` with your own. +### Extending the configuration + +There are some additional things you may wish to configure about the component. + +Take a look at: + +- `roles/custom/matrix-alertmanager-receiver/defaults/main.yml` for some variables that you can customize via your `vars.yml` file +- `roles/custom/matrix-alertmanager-receiver/templates/config.yml.j2` for the component's default configuration. You can override settings (even those that don't have dedicated playbook variables) using the `matrix_alertmanager_receiver_configuration_extension_yaml` variable + ## Installing After configuring the playbook and potentially [adjusting your DNS records](#adjusting-dns-records), run the playbook with [playbook tags](playbook-tags.md) as below: From 42f38dae07f1ecfa531aec5362a09a4ed3f5713d Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 25 Jan 2025 11:51:30 +0900 Subject: [PATCH 2/3] Update docs/configuring-playbook-alertmanager-receiver.md: add the common section "Troubleshooting" The configuration was copied from main.yml. Signed-off-by: Suguru Hirahara --- docs/configuring-playbook-alertmanager-receiver.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/configuring-playbook-alertmanager-receiver.md b/docs/configuring-playbook-alertmanager-receiver.md index 84be123f6..1d64b1af7 100644 --- a/docs/configuring-playbook-alertmanager-receiver.md +++ b/docs/configuring-playbook-alertmanager-receiver.md @@ -130,3 +130,16 @@ route: ``` where `URL_HERE` looks like `https://matrix.example.com/matrix-alertmanager-receiver-RANDOM_VALUE_HERE/alert/some-room-name` or `https://matrix.example.com/matrix-alertmanager-receiver-RANDOM_VALUE_HERE/alert/!qporfwt:example.com`. + +## 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-alertmanager-receiver`. + +### Increase logging verbosity + +The default logging level for this component is `info`. If you want to increase the verbosity, add the following configuration to your `vars.yml` file and re-run the playbook: + +```yaml +# Valid values: error, warn, info, debug +matrix_alertmanager_receiver_container_process_argument_log_level: debug +``` From 21b5963f63f19524bcc5cec223e59e521e599a30 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 25 Jan 2025 12:03:42 +0900 Subject: [PATCH 3/3] Update files for the matrix-alertmanager-receiver: rename config.yml.j2 to config.yaml.j2 in order to improve consistency Signed-off-by: Suguru Hirahara --- docs/configuring-playbook-alertmanager-receiver.md | 2 +- roles/custom/matrix-alertmanager-receiver/defaults/main.yml | 2 +- .../templates/{config.yml.j2 => config.yaml.j2} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename roles/custom/matrix-alertmanager-receiver/templates/{config.yml.j2 => config.yaml.j2} (100%) diff --git a/docs/configuring-playbook-alertmanager-receiver.md b/docs/configuring-playbook-alertmanager-receiver.md index 1d64b1af7..eee2dd0a5 100644 --- a/docs/configuring-playbook-alertmanager-receiver.md +++ b/docs/configuring-playbook-alertmanager-receiver.md @@ -89,7 +89,7 @@ There are some additional things you may wish to configure about the component. Take a look at: - `roles/custom/matrix-alertmanager-receiver/defaults/main.yml` for some variables that you can customize via your `vars.yml` file -- `roles/custom/matrix-alertmanager-receiver/templates/config.yml.j2` for the component's default configuration. You can override settings (even those that don't have dedicated playbook variables) using the `matrix_alertmanager_receiver_configuration_extension_yaml` variable +- `roles/custom/matrix-alertmanager-receiver/templates/config.yaml.j2` for the component's default configuration. You can override settings (even those that don't have dedicated playbook variables) using the `matrix_alertmanager_receiver_configuration_extension_yaml` variable ## Installing diff --git a/roles/custom/matrix-alertmanager-receiver/defaults/main.yml b/roles/custom/matrix-alertmanager-receiver/defaults/main.yml index 05e9c9705..e3c423340 100644 --- a/roles/custom/matrix-alertmanager-receiver/defaults/main.yml +++ b/roles/custom/matrix-alertmanager-receiver/defaults/main.yml @@ -218,7 +218,7 @@ matrix_alertmanager_receiver_config_templating_resolved_template: |- # # For a more advanced customization, you can extend the default (see `matrix_alertmanager_receiver_configuration_extension_yaml`) # or completely replace this variable with your own template. -matrix_alertmanager_receiver_configuration_yaml: "{{ lookup('template', 'templates/config.yml.j2') }}" +matrix_alertmanager_receiver_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}" matrix_alertmanager_receiver_configuration_extension_yaml: | # Your custom YAML configuration for matrix-alertmanager-receiver goes here. diff --git a/roles/custom/matrix-alertmanager-receiver/templates/config.yml.j2 b/roles/custom/matrix-alertmanager-receiver/templates/config.yaml.j2 similarity index 100% rename from roles/custom/matrix-alertmanager-receiver/templates/config.yml.j2 rename to roles/custom/matrix-alertmanager-receiver/templates/config.yaml.j2