Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

242 rivejä
14 KiB

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