From 34e4ae99949493c8e43c07d39389e1af213e89e8 Mon Sep 17 00:00:00 2001 From: Tehreem Date: Fri, 19 Jan 2024 10:20:27 +0500 Subject: [PATCH] fixing modify alertmanager yaml (#44) * fixing modify alertmanager yaml * fixing lint errors * fixing lint errors * fixing lint errors * fixing lint errors * fixing lint errors * fixing lint errors * fixing lint errors * Revert "fixing lint errors" This reverts commit 04e8315ae2b777679f401873543de66895f0d664. * fixing lint errors * fixing lint errors * fixing lint errors * fixing lint errors * fixing lint errors * fixing lint errors * fixing lint errors * fixing lint errors * removing debug mssg --- .../tasks/grafana_oncall_hub_spoke.yml | 1 + .../tasks/grafana_oncall_standalone.yml | 1 + .../tasks/modify_alertmanager_secret.yml | 8 ++++++-- vocabulary | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/roles/grafana_cloud_operator/tasks/grafana_oncall_hub_spoke.yml b/roles/grafana_cloud_operator/tasks/grafana_oncall_hub_spoke.yml index a4a9d033..f488c47d 100644 --- a/roles/grafana_cloud_operator/tasks/grafana_oncall_hub_spoke.yml +++ b/roles/grafana_cloud_operator/tasks/grafana_oncall_hub_spoke.yml @@ -113,6 +113,7 @@ receiver_url: "{{ item.grafana_details.link }}" namespace: "{{ item.cluster.namespace }}" cluster_name: "{{ item.cluster.name }}" + provision_mode: "hubAndSpoke" loop: "{{ mapped_integrations }}" - name: Update CR status for SyncSet creation diff --git a/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml b/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml index c4c2243a..ffac55fc 100644 --- a/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml +++ b/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml @@ -83,6 +83,7 @@ vars: receiver_name: "{{ cluster_name }}" receiver_url: "{{ grafana_integration_response.json.link }}" + provision_mode: "standalone" - name: Re-encode modified alertmanager content for cluster ansible.builtin.set_fact: diff --git a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml index aed78c55..1c8f3e41 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -41,7 +41,9 @@ - name: Re-encode modified alertmanager content for cluster ansible.builtin.set_fact: encoded_alertmanager_secret_content: "{{ modified_alertmanager_secret_content | to_nice_yaml | b64encode }}" - when: gco_cr.spec.provisionMode == 'hubAndSpoke' + vars: + provision_mode_check: "{{ provision_mode }}" + when: provision_mode_check == "hubAndSpoke" - name: Create a new SyncSet for each cluster to patch alertmanager-main secret kubernetes.core.k8s: @@ -65,7 +67,9 @@ patch: | data: alertmanager.yaml: "{{ encoded_alertmanager_secret_content }}" + vars: + provision_mode_check: "{{ provision_mode }}" when: + - provision_mode_check == "hubAndSpoke" - create_integration_for | length > 0 - - gco_cr.spec.provisionMode == 'hubAndSpoke' register: syncset_creation_results diff --git a/vocabulary b/vocabulary index 4fb42902..107a7ad2 160000 --- a/vocabulary +++ b/vocabulary @@ -1 +1 @@ -Subproject commit 4fb4290235638237f2c987937f943d18ffb0641b +Subproject commit 107a7ad2b7d22887052e6e657c2440f8522ab4d6