summaryrefslogtreecommitdiff
path: root/roles/monitoring/alerta/tasks/main.yml
blob: af7530d8f7c5af49755e8217405b1a0bad80d942 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
- name: create alerta subdirectories
  loop:
  - config
  - postgres
  file:
    path: "{{ alerta_base_path }}/{{ item }}"
    state: directory

- name: install alertad config template
  copy:
    content: |
      DEBUG = {{ '{{' }} 'True' if env.DEBUG else 'False' {{ '}}' }}
      SECRET = "{{ '{{' }} env.SECRET_KEY {{ '}}' }}"
      PLUGINS = ['reject', 'blackout', 'heartbeat']
      DEFAULT_ENVIRONMENT = 'unknown'
      ALLOWED_ENVIRONMENTS = ['unknown', 'chaos-at-.*']
      HEARTBEAT_EVENTS = ['PrometheusAlertmanagerE2eDeadManSwitch']
    dest: "{{ alerta_base_path }}/config/alertad.conf.j2"

- name: install pod manifest
  vars:
    kubernetes_standalone_pod:
      name: "alerta"
      spec: "{{ lookup('template', 'pod-spec.yml.j2') }}"
      mode: "0600"
      config_hash_items:
      - path: "{{ alerta_base_path }}/config/alertad.conf.j2"
        properties:
        - checksum
  include_role:
    name: kubernetes/standalone/pod