From e480f431181ffa50b9b0fa8cd3173c15e43c085b Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Thu, 28 Dec 2023 19:38:37 +0500 Subject: [PATCH 1/2] Update Json. --- .../tasks/modify_alertmanager_secret.yml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml index 73989fd2..6d67b957 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -2,25 +2,25 @@ ansible.builtin.set_fact: modified_alertmanager_secret_content: > {{ (fetched_alertmanager_secret.resources[0].data['alertmanager.yaml'] | b64decode | from_yaml) | combine({ - 'receivers': [ + "receivers": [ { - 'name': receiver_name, - 'webhook_configs': [{ - 'url': receiver_url + "name": "receiver_name", + "webhook_configs": [{ + "url": "receiver_url" }] } ], - 'route': { - 'receiver': receiver_name, - 'routes': [ + "route": {[ + "receiver": "receiver_name", + "routes": [ { - 'receiver': receiver_name, - 'match': { - 'severity': 'info | warning | critical' + "receiver": "receiver_name", + "match": { + "severity": "info | warning | critical" } } ] - } + }] }, recursive=True) }} - name: Update CR status to AlertmanagerConfigModified From 8eeafd607a6b6a125dc6d394c3b899967f3bda53 Mon Sep 17 00:00:00 2001 From: Zain Siddiqui <64101827+John2020-cyber@users.noreply.github.com> Date: Thu, 28 Dec 2023 22:51:15 +0500 Subject: [PATCH 2/2] Update modify_alertmanager_secret.yml --- .../tasks/modify_alertmanager_secret.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml index 6d67b957..b6d4ddef 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -10,7 +10,7 @@ }] } ], - "route": {[ + "route": { "receiver": "receiver_name", "routes": [ { @@ -20,7 +20,7 @@ } } ] - }] + } }, recursive=True) }} - name: Update CR status to AlertmanagerConfigModified