Matrix Docker Ansible eploy
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

247 satır
14 KiB

  1. # SPDX-FileCopyrightText: 2024 - 2025 Slavi Pantaleev
  2. # SPDX-FileCopyrightText: 2024 - 2025 Suguru Hirahara
  3. #
  4. # SPDX-License-Identifier: AGPL-3.0-or-later
  5. ---
  6. # matrix-alertmanager-receiver is a service which receives webhook payloads from Prometheus' Alertmanager and forwards them to a Matrix room.
  7. # Project source code URL: https://github.com/metio/matrix-alertmanager-receiver
  8. matrix_alertmanager_receiver_enabled: true
  9. # renovate: datasource=docker depName=docker.io/metio/matrix-alertmanager-receiver
  10. matrix_alertmanager_receiver_version: 2026.4.29
  11. matrix_alertmanager_receiver_scheme: https
  12. # The hostname at which matrix-alertmanager-receiver is served.
  13. matrix_alertmanager_receiver_hostname: ''
  14. # The path at which matrix-alertmanager-receiver is served.
  15. # This value must either be `/` or not end with a slash (e.g. `/matrix-alertmanager-receiver`).
  16. matrix_alertmanager_receiver_path_prefix: /
  17. matrix_alertmanager_receiver_base_path: "{{ matrix_base_data_path }}/alertmanager-receiver"
  18. matrix_alertmanager_receiver_config_path: "{{ matrix_alertmanager_receiver_base_path }}/config"
  19. matrix_alertmanager_receiver_container_image_self_build: false
  20. matrix_alertmanager_receiver_container_image_self_build_repo: https://github.com/metio/matrix-alertmanager-receiver
  21. matrix_alertmanager_receiver_container_image_self_build_repo_version: "{{ 'main' if matrix_alertmanager_receiver_version == 'main' else matrix_alertmanager_receiver_version }}"
  22. matrix_alertmanager_receiver_container_src_path: "{{ matrix_alertmanager_receiver_base_path }}/container-src"
  23. matrix_alertmanager_receiver_container_image: "{{ matrix_alertmanager_receiver_container_image_registry_prefix }}metio/matrix-alertmanager-receiver:{{ matrix_alertmanager_receiver_container_image_tag }}"
  24. matrix_alertmanager_receiver_container_image_tag: "{{ matrix_alertmanager_receiver_version }}"
  25. matrix_alertmanager_receiver_container_image_registry_prefix: "{{ matrix_alertmanager_receiver_container_image_registry_prefix_upstream }}"
  26. matrix_alertmanager_receiver_container_image_registry_prefix_upstream: "{{ matrix_alertmanager_receiver_container_image_registry_prefix_upstream_default }}"
  27. matrix_alertmanager_receiver_container_image_registry_prefix_upstream_default: "docker.io/"
  28. # The base container network. It will be auto-created by this role if it doesn't exist already.
  29. matrix_alertmanager_receiver_container_network: ''
  30. # A list of additional container networks that the container would be connected to.
  31. # The role does not create these networks, so make sure they already exist.
  32. matrix_alertmanager_receiver_container_additional_networks: "{{ matrix_alertmanager_receiver_container_additional_networks_default + matrix_alertmanager_receiver_container_additional_networks_auto + matrix_alertmanager_receiver_container_additional_networks_custom }}"
  33. matrix_alertmanager_receiver_container_additional_networks_default: []
  34. matrix_alertmanager_receiver_container_additional_networks_auto: []
  35. matrix_alertmanager_receiver_container_additional_networks_custom: []
  36. # Controls whether matrix-alertmanager-receiver metrics should be proxied (exposed) on `matrix.example.com/metrics/matrix-alertmanager-receiver`
  37. matrix_alertmanager_receiver_metrics_proxying_enabled: false
  38. matrix_alertmanager_receiver_metrics_proxying_hostname: ''
  39. matrix_alertmanager_receiver_metrics_proxying_path: /metrics/matrix-alertmanager-receiver
  40. # matrix_alertmanager_receiver_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
  41. # See `../templates/labels.j2` for details.
  42. #
  43. # To inject your own other container labels, see `matrix_alertmanager_receiver_container_labels_additional_labels`.
  44. matrix_alertmanager_receiver_container_labels_traefik_enabled: true
  45. matrix_alertmanager_receiver_container_labels_traefik_docker_network: "{{ matrix_alertmanager_receiver_container_network }}"
  46. matrix_alertmanager_receiver_container_labels_traefik_hostname: "{{ matrix_alertmanager_receiver_hostname }}"
  47. # The path prefix must either be `/` or not end with a slash (e.g. `/matrix-alertmanager-receiver`).
  48. matrix_alertmanager_receiver_container_labels_traefik_path_prefix: "{{ matrix_alertmanager_receiver_path_prefix }}"
  49. matrix_alertmanager_receiver_container_labels_traefik_rule: "Host(`{{ matrix_alertmanager_receiver_container_labels_traefik_hostname }}`){% if matrix_alertmanager_receiver_container_labels_traefik_path_prefix != '/' %} && PathPrefix(`{{ matrix_alertmanager_receiver_container_labels_traefik_path_prefix }}`){% endif %}"
  50. matrix_alertmanager_receiver_container_labels_traefik_priority: 0
  51. matrix_alertmanager_receiver_container_labels_traefik_entrypoints: web-secure
  52. matrix_alertmanager_receiver_container_labels_traefik_tls: "{{ matrix_alertmanager_receiver_container_labels_traefik_entrypoints != 'web' }}"
  53. matrix_alertmanager_receiver_container_labels_traefik_tls_certResolver: default # noqa var-naming
  54. # Controls whether labels will be added that expose metrics (see `matrix_alertmanager_receiver_metrics_proxying_enabled`) for matrix-alertmanager-receiver
  55. matrix_alertmanager_receiver_container_labels_public_metrics_enabled: "{{ matrix_alertmanager_receiver_metrics_enabled and matrix_alertmanager_receiver_metrics_proxying_enabled }}"
  56. matrix_alertmanager_receiver_container_labels_public_metrics_traefik_path: "{{ matrix_alertmanager_receiver_metrics_proxying_path }}"
  57. matrix_alertmanager_receiver_container_labels_public_metrics_traefik_rule: "Host(`{{ matrix_alertmanager_receiver_metrics_proxying_hostname }}`) && Path(`{{ matrix_alertmanager_receiver_container_labels_public_metrics_traefik_path }}`)"
  58. matrix_alertmanager_receiver_container_labels_public_metrics_traefik_priority: 0
  59. matrix_alertmanager_receiver_container_labels_public_metrics_traefik_entrypoints: "{{ matrix_alertmanager_receiver_container_labels_traefik_entrypoints }}"
  60. matrix_alertmanager_receiver_container_labels_public_metrics_traefik_tls: "{{ matrix_alertmanager_receiver_container_labels_public_metrics_traefik_entrypoints != 'web' }}"
  61. matrix_alertmanager_receiver_container_labels_public_metrics_traefik_tls_certResolver: "{{ matrix_alertmanager_receiver_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  62. matrix_alertmanager_receiver_container_labels_public_metrics_middleware_basic_auth_enabled: false
  63. # See: https://doc.traefik.io/traefik/middlewares/http/basicauth/#users
  64. matrix_alertmanager_receiver_container_labels_public_metrics_middleware_basic_auth_users: ''
  65. # matrix_alertmanager_receiver_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
  66. # See `../templates/labels.j2` for details.
  67. #
  68. # Example:
  69. # matrix_alertmanager_receiver_container_labels_additional_labels: |
  70. # my.label=1
  71. # another.label="here"
  72. matrix_alertmanager_receiver_container_labels_additional_labels: ''
  73. # A list of extra arguments to pass to the container
  74. matrix_alertmanager_receiver_container_extra_arguments: []
  75. # Controls the `--log-level` argument passed to the container process.
  76. # Valid values: error, warn, info, debug
  77. matrix_alertmanager_receiver_container_process_argument_log_level: info
  78. # A list of extra arguments to pass to the container process.
  79. matrix_alertmanager_receiver_container_process_extra_arguments: []
  80. # List of systemd services that matrix-alertmanager-receiver-proxy.service depends on
  81. matrix_alertmanager_receiver_systemd_required_services_list: "{{ matrix_alertmanager_receiver_systemd_required_services_list_default + matrix_alertmanager_receiver_systemd_required_services_list_auto + matrix_alertmanager_receiver_systemd_required_services_list_custom }}"
  82. matrix_alertmanager_receiver_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
  83. matrix_alertmanager_receiver_systemd_required_services_list_auto: []
  84. matrix_alertmanager_receiver_systemd_required_services_list_custom: []
  85. # List of systemd services that matrix-alertmanager-receiver-proxy.service wants
  86. matrix_alertmanager_receiver_systemd_wanted_services_list: []
  87. # Controls the `http.port` configuration setting.
  88. matrix_alertmanager_receiver_config_http_port: 12345
  89. # Controls the `http.alerts-path-prefix` configuration setting.
  90. matrix_alertmanager_receiver_config_http_alerts_path_prefix: /alerts
  91. # Controls the `http.metrics-enabled` configuration setting.
  92. matrix_alertmanager_receiver_config_http_metrics_enabled: false
  93. # Controls the `http.metrics-path` configuration setting.
  94. matrix_alertmanager_receiver_config_http_metrics_path: /metrics
  95. # Controls the `matrix.homeserver-url` configuration setting.
  96. matrix_alertmanager_receiver_config_matrix_homeserver_url: ''
  97. # Controls the `matrix.user-id` configuration setting.
  98. matrix_alertmanager_receiver_config_matrix_user_id: "@{{ matrix_alertmanager_receiver_config_matrix_user_id_localpart }}:{{ matrix_domain }}"
  99. matrix_alertmanager_receiver_config_matrix_user_id_localpart: "bot.alertmanager.receiver"
  100. # Controls the `matrix.access-token` configuration setting.
  101. matrix_alertmanager_receiver_config_matrix_access_token: ''
  102. # Controls the `matrix.room-mapping` configuration setting.
  103. #
  104. # Example:
  105. # matrix_alertmanager_receiver_config_matrix_room:
  106. # simple-name: "!qporfwt:example.com"
  107. # another-name: "!aaabaa:example.com"
  108. matrix_alertmanager_receiver_config_matrix_room_mapping: {}
  109. # Controls the `templating.external-url-mapping` configuration setting.
  110. #
  111. # The key is the original value taken from the Alertmanager payload
  112. # The value is the mapped value which will be available as '.ExternalURL' in templates
  113. #
  114. # Example:
  115. # matrix_alertmanager_receiver_config_templating_external_url_mapping:
  116. # "http://alertmanager:9093": https://alertmanager.example.com
  117. # "http://alertmanager:9094": https://another.alertmanager.example.com
  118. matrix_alertmanager_receiver_config_templating_external_url_mapping: {}
  119. # Controls the `templating.generator-url-mapping` configuration setting.
  120. #
  121. # The key is the original value taken from the Alertmanager payload
  122. # The value is the mapped value which will be available as '.ExternalURL' in templates
  123. #
  124. # Example:
  125. # matrix_alertmanager_receiver_config_templating_generator_url_mapping:
  126. # "http://prometheus:8080": https://prometheus.example.com
  127. # "http://prometheus:8081": https://another.prometheus.example.com
  128. matrix_alertmanager_receiver_config_templating_generator_url_mapping: {}
  129. # Controls the `templating.firing-template` configuration setting.
  130. matrix_alertmanager_receiver_config_templating_firing_template: |-
  131. {% raw %}
  132. {{ $color := "yellow" }}
  133. {{ if eq .Alert.Labels.severity "warning" }}
  134. {{ $color = "orange" }}
  135. {{ else if eq .Alert.Labels.severity "critical" }}
  136. {{ $color = "red" }}
  137. {{ end }}
  138. {{ if eq .Alert.Status "resolved" }}
  139. {{ $color = "green" }}
  140. {{ end }}
  141. <p>
  142. <strong><font color="{{ $color }}">{{ .Alert.Status | ToUpper }}</font></strong>
  143. {{ if .Alert.Labels.name }}
  144. {{ .Alert.Labels.name }}
  145. {{ else if .Alert.Labels.alertname }}
  146. {{ .Alert.Labels.alertname }}
  147. {{ end }}
  148. >>
  149. {{ if .Alert.Labels.severity }}
  150. {{ .Alert.Labels.severity | ToUpper }}:
  151. {{ end }}
  152. {{ if .Alert.Annotations.description }}
  153. {{ .Alert.Annotations.description }}
  154. {{ else if .Alert.Annotations.summary }}
  155. {{ .Alert.Annotations.summary }}
  156. {{ end }}
  157. >>
  158. {{ if .Alert.Annotations.runbook_url }}
  159. <a href="{{ .Alert.Annotations.runbook_url }}">Runbook</a> |
  160. {{ end }}
  161. {{ if .Alert.Annotations.dashboard }}
  162. <a href="{{ .Alert.Annotations.dashboard }}">Dashboard</a> |
  163. {{ end }}
  164. <a href="{{ .SilenceURL }}">Silence</a>
  165. </p>
  166. {% endraw %}
  167. # Controls the `templating.resolved-template` configuration setting.
  168. matrix_alertmanager_receiver_config_templating_resolved_template: |-
  169. {% raw %}
  170. <strong><font color="green">{{ .Alert.Status | ToUpper }}</font></strong>
  171. {{ if .Alert.Labels.name }}
  172. {{ .Alert.Labels.name }}
  173. {{ else if .Alert.Labels.alertname }}
  174. {{ .Alert.Labels.alertname }}
  175. {{ end }}
  176. {% endraw %}
  177. # Default matrix-alertmanager-receiver configuration template which covers the generic use case.
  178. # You can customize it by controlling the various variables inside it.
  179. #
  180. # For a more advanced customization, you can extend the default (see `matrix_alertmanager_receiver_configuration_extension_yaml`)
  181. # or completely replace this variable with your own template.
  182. matrix_alertmanager_receiver_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
  183. matrix_alertmanager_receiver_configuration_extension_yaml: |
  184. # Your custom YAML configuration for matrix-alertmanager-receiver goes here.
  185. # This configuration extends the default starting configuration (`matrix_alertmanager_receiver_configuration_yaml`).
  186. #
  187. # You can override individual variables from the default configuration, or introduce new ones.
  188. #
  189. # If you need something more special, you can take full control by
  190. # completely redefining `matrix_alertmanager_receiver_configuration_yaml`.
  191. #
  192. # Example configuration extension follows:
  193. #
  194. # http:
  195. # address: ''
  196. matrix_alertmanager_receiver_configuration_extension: "{{ matrix_alertmanager_receiver_configuration_extension_yaml | from_yaml if matrix_alertmanager_receiver_configuration_extension_yaml | from_yaml is mapping else {} }}"
  197. # Holds the final matrix-alertmanager-receiver configuration (a combination of the default and its extension).
  198. # You most likely don't need to touch this variable. Instead, see `matrix_alertmanager_receiver_configuration_yaml`.
  199. matrix_alertmanager_receiver_configuration: "{{ matrix_alertmanager_receiver_configuration_yaml | from_yaml | combine(matrix_alertmanager_receiver_configuration_extension, recursive=True) }}"
  200. # matrix_alertmanager_receiver_restart_necessary controls whether the service
  201. # will be restarted (when true) or merely started (when false) by the
  202. # systemd service manager role (when conditional restart is enabled).
  203. #
  204. # This value is automatically computed during installation based on whether
  205. # any configuration files, the systemd service file, or the container image changed.
  206. # The default of `false` means "no restart needed" — appropriate when the role's
  207. # installation tasks haven't run (e.g., due to --tags skipping them).
  208. matrix_alertmanager_receiver_restart_necessary: false