DEV-518: added silences step

feature/SC-55
friedrich goerz 3 years ago
parent 35e580f264
commit 4f4f8be81a

@ -3,6 +3,41 @@
### tags: ### tags:
### check_elastic_cluster ### check_elastic_cluster
- hosts: prometheus
vars:
start: '{{ ansible_date_time.epoch }}'
tasks:
- set_fact:
startsAt: "{{ '%Y-%m-%d %H:%M:%S' | strftime(start) }}"
endsAt: "{{ '%Y-%m-%d %H:%M:%S' | strftime( ( start | int ) + 3600 |int ) }}"
- name: "set fact"
set_fact:
silence:
matchers:
- name: env
value: dev
isRegex: false
isEqual: true
startsAt: '{{ startsAt }}'
endsAt: '{{ endsAt }}'
createdBy: patchday-automatism
comment: patchday
id:
- name: "Schedule silences for stage..."
uri:
url: "https://{{ stage }}-prometheus-01-alertmanager.smardigo.digital/api/v2/silences"
method: POST
status_code: [200]
headers:
Content-Type: application/json
body_format: json
body: '{{ silence | to_json }}'
ignore_errors: yes
- hosts: elastic - hosts: elastic
serial: 1 serial: 1
become: yes become: yes

Loading…
Cancel
Save