From 95e7a5076c823ca03945fb85a270c73c41c83da2 Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Tue, 9 Jan 2024 19:47:48 +0500 Subject: [PATCH 01/31] Fix for hubSpoke task --- roles/grafana_cloud_operator/tasks/grafana_oncall_hub_spoke.yml | 1 + .../grafana_cloud_operator/tasks/grafana_oncall_standalone.yml | 1 + .../grafana_cloud_operator/tasks/modify_alertmanager_secret.yml | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) 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..125672b2 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 }}" + mode: {{" gco_cr.spec.provisionMode "}} 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..9179039c 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 }}" + mode: {{" gco_cr.spec.provisionMode "}} - 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..8856887b 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -41,7 +41,7 @@ - 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' + when: gco_cr.spec.provisionMode == '{{ mode }}' - name: Create a new SyncSet for each cluster to patch alertmanager-main secret kubernetes.core.k8s: From e0519efecc2f810761da52869d8406f4c4fdc605 Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Tue, 9 Jan 2024 19:51:15 +0500 Subject: [PATCH 02/31] Fix --- roles/grafana_cloud_operator/tasks/grafana_oncall_hub_spoke.yml | 2 +- .../grafana_cloud_operator/tasks/grafana_oncall_standalone.yml | 2 +- 2 files changed, 2 insertions(+), 2 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 125672b2..74ec576f 100644 --- a/roles/grafana_cloud_operator/tasks/grafana_oncall_hub_spoke.yml +++ b/roles/grafana_cloud_operator/tasks/grafana_oncall_hub_spoke.yml @@ -113,7 +113,7 @@ receiver_url: "{{ item.grafana_details.link }}" namespace: "{{ item.cluster.namespace }}" cluster_name: "{{ item.cluster.name }}" - mode: {{" gco_cr.spec.provisionMode "}} + mode: "{{ gco_cr.spec.provisionMode }}" 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 9179039c..89acd7b1 100644 --- a/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml +++ b/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml @@ -83,7 +83,7 @@ vars: receiver_name: "{{ cluster_name }}" receiver_url: "{{ grafana_integration_response.json.link }}" - mode: {{" gco_cr.spec.provisionMode "}} + mode: "{{ gco_cr.spec.provisionMode }}" - name: Re-encode modified alertmanager content for cluster ansible.builtin.set_fact: From 604a5414e5e01544c64070b583a9c9928f54b695 Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Tue, 9 Jan 2024 19:54:12 +0500 Subject: [PATCH 03/31] fix --- .../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 8856887b..247b7530 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -41,7 +41,7 @@ - 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 == '{{ mode }}' + when: gco_cr.spec.provisionMode == {{ mode }} - name: Create a new SyncSet for each cluster to patch alertmanager-main secret kubernetes.core.k8s: @@ -67,5 +67,5 @@ alertmanager.yaml: "{{ encoded_alertmanager_secret_content }}" when: - create_integration_for | length > 0 - - gco_cr.spec.provisionMode == 'hubAndSpoke' + - gco_cr.spec.provisionMode == {{ mode }} register: syncset_creation_results From b5eac352fcf480543e5daf2ba2e654ab9b3cca04 Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Tue, 9 Jan 2024 19:59:20 +0500 Subject: [PATCH 04/31] Fix --- .../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 247b7530..1987ea84 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -41,7 +41,7 @@ - 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 == {{ mode }} + when: gco_cr.spec.provisionMode == 'mode' - name: Create a new SyncSet for each cluster to patch alertmanager-main secret kubernetes.core.k8s: @@ -67,5 +67,5 @@ alertmanager.yaml: "{{ encoded_alertmanager_secret_content }}" when: - create_integration_for | length > 0 - - gco_cr.spec.provisionMode == {{ mode }} + - gco_cr.spec.provisionMode == 'mode' register: syncset_creation_results From aaf2127806d085bcb2fc2d975eeea96d6511376b Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Tue, 9 Jan 2024 20:09:27 +0500 Subject: [PATCH 05/31] Update condition --- .../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 1987ea84..0ee4b227 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -41,7 +41,7 @@ - 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 == 'mode' + when: mode == 'hubAndSpoke' - name: Create a new SyncSet for each cluster to patch alertmanager-main secret kubernetes.core.k8s: @@ -67,5 +67,5 @@ alertmanager.yaml: "{{ encoded_alertmanager_secret_content }}" when: - create_integration_for | length > 0 - - gco_cr.spec.provisionMode == 'mode' + - mode == 'hubAndSpoke' register: syncset_creation_results From 1290485314f6e76c9ce23eadc744aeea526eb407 Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Tue, 9 Jan 2024 20:51:47 +0500 Subject: [PATCH 06/31] Update --- .../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 0ee4b227..c5300755 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -41,7 +41,7 @@ - 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: mode == 'hubAndSpoke' + when: 'mode == hubAndSpoke' - name: Create a new SyncSet for each cluster to patch alertmanager-main secret kubernetes.core.k8s: @@ -67,5 +67,5 @@ alertmanager.yaml: "{{ encoded_alertmanager_secret_content }}" when: - create_integration_for | length > 0 - - mode == 'hubAndSpoke' + - 'mode == hubAndSpoke' register: syncset_creation_results From 4b17836cc1f368ace00a1559f11b1097d9a440bd Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Tue, 9 Jan 2024 21:13:16 +0500 Subject: [PATCH 07/31] Update --- .../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 c5300755..ef3b0762 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -41,7 +41,7 @@ - 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: 'mode == hubAndSpoke' + when: 'mode == "hubAndSpoke"' - name: Create a new SyncSet for each cluster to patch alertmanager-main secret kubernetes.core.k8s: @@ -67,5 +67,5 @@ alertmanager.yaml: "{{ encoded_alertmanager_secret_content }}" when: - create_integration_for | length > 0 - - 'mode == hubAndSpoke' + - 'mode == "hubAndSpoke"' register: syncset_creation_results From 694af305ddb7198e4a8597ad3a3ccf55ade39722 Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Tue, 9 Jan 2024 21:22:08 +0500 Subject: [PATCH 08/31] Add debug msg --- .../tasks/modify_alertmanager_secret.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml index ef3b0762..585fc0bd 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -38,6 +38,12 @@ reason: "AlertmanagerConfigModified" message: "Decoded and modified the alertmanager secret configuration" +- name: Display mode string coming in the value + ansible.builtin.debug: + msg: + - 'mode' + - gco_cr.spec.provisionMode + - name: Re-encode modified alertmanager content for cluster ansible.builtin.set_fact: encoded_alertmanager_secret_content: "{{ modified_alertmanager_secret_content | to_nice_yaml | b64encode }}" From c45f71b471fe9e7fae7612e45caff3894552678a Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Tue, 9 Jan 2024 21:25:35 +0500 Subject: [PATCH 09/31] update --- .../grafana_cloud_operator/tasks/modify_alertmanager_secret.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml index 585fc0bd..4b2cdfb7 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -40,7 +40,7 @@ - name: Display mode string coming in the value ansible.builtin.debug: - msg: + msg: - 'mode' - gco_cr.spec.provisionMode From a061593f023409179ed4d06a922d9a721ed4b9fd Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Tue, 9 Jan 2024 21:32:43 +0500 Subject: [PATCH 10/31] Debug msg --- .../tasks/modify_alertmanager_secret.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml index 4b2cdfb7..29da3423 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -40,9 +40,7 @@ - name: Display mode string coming in the value ansible.builtin.debug: - msg: - - 'mode' - - gco_cr.spec.provisionMode + msg: "gco_cr.spec.provisionMode" - name: Re-encode modified alertmanager content for cluster ansible.builtin.set_fact: From d99134feaf77b987bd81fe5de2b8e52d3c6e732d Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Tue, 9 Jan 2024 21:42:31 +0500 Subject: [PATCH 11/31] Update --- .../grafana_cloud_operator/tasks/modify_alertmanager_secret.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml index 29da3423..66093464 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -40,7 +40,7 @@ - name: Display mode string coming in the value ansible.builtin.debug: - msg: "gco_cr.spec.provisionMode" + msg: "{{mode}}" - name: Re-encode modified alertmanager content for cluster ansible.builtin.set_fact: From 1b67fb6c2e1674ceaabd12f031e166bd2b452f6c Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Tue, 9 Jan 2024 21:51:08 +0500 Subject: [PATCH 12/31] update --- .../grafana_cloud_operator/tasks/modify_alertmanager_secret.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml index 66093464..46e58f02 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -40,7 +40,7 @@ - name: Display mode string coming in the value ansible.builtin.debug: - msg: "{{mode}}" + msg: {{mode}} - name: Re-encode modified alertmanager content for cluster ansible.builtin.set_fact: From 634831268b4ce1b2974c7e5fa00a3bf8600f7893 Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Tue, 9 Jan 2024 21:53:30 +0500 Subject: [PATCH 13/31] Updates --- .../grafana_cloud_operator/tasks/modify_alertmanager_secret.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml index 46e58f02..e7910fbb 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -40,7 +40,7 @@ - name: Display mode string coming in the value ansible.builtin.debug: - msg: {{mode}} + msg: "'{{mode}}'" - name: Re-encode modified alertmanager content for cluster ansible.builtin.set_fact: From d731f3f9f6ff8467cf8ee51c3a671000f6d83b88 Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Wed, 10 Jan 2024 00:16:49 +0500 Subject: [PATCH 14/31] Test --- .../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 e7910fbb..149a1f87 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -39,8 +39,8 @@ message: "Decoded and modified the alertmanager secret configuration" - name: Display mode string coming in the value - ansible.builtin.debug: - msg: "'{{mode}}'" + debug: + var: mode - name: Re-encode modified alertmanager content for cluster ansible.builtin.set_fact: From 8d6b46f7faa120d343cc522a75e3ddd93d498a8a Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Wed, 10 Jan 2024 00:18:42 +0500 Subject: [PATCH 15/31] Update --- .../grafana_cloud_operator/tasks/modify_alertmanager_secret.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml index 149a1f87..7b4acdd4 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -39,7 +39,7 @@ message: "Decoded and modified the alertmanager secret configuration" - name: Display mode string coming in the value - debug: + ansible.builtin.debug: var: mode - name: Re-encode modified alertmanager content for cluster From 47d4ab0f4dfba927a09e1a99a05c1052eb247d5e Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Wed, 10 Jan 2024 14:17:36 +0500 Subject: [PATCH 16/31] Update --- .../tasks/grafana_oncall_hub_spoke.yml | 2 +- .../tasks/grafana_oncall_standalone.yml | 6 +++++- roles/grafana_cloud_operator/tasks/main.yml | 4 ++++ 3 files changed, 10 insertions(+), 2 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 74ec576f..1869c267 100644 --- a/roles/grafana_cloud_operator/tasks/grafana_oncall_hub_spoke.yml +++ b/roles/grafana_cloud_operator/tasks/grafana_oncall_hub_spoke.yml @@ -113,7 +113,7 @@ receiver_url: "{{ item.grafana_details.link }}" namespace: "{{ item.cluster.namespace }}" cluster_name: "{{ item.cluster.name }}" - mode: "{{ gco_cr.spec.provisionMode }}" +# mode: "{{ gco_cr.spec.provisionMode }}" 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 89acd7b1..6d86478a 100644 --- a/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml +++ b/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml @@ -78,12 +78,16 @@ reason: "GrafanaIntegrationSuccess" message: "Grafana integration created successfully" +- name: Display mode string coming in the value + ansible.builtin.debug: + var: mode + - name: Modify Alertmanager secret ansible.builtin.include_tasks: modify_alertmanager_secret.yml vars: receiver_name: "{{ cluster_name }}" receiver_url: "{{ grafana_integration_response.json.link }}" - mode: "{{ gco_cr.spec.provisionMode }}" +# mode: "{{ gco_cr.spec.provisionMode }}" - name: Re-encode modified alertmanager content for cluster ansible.builtin.set_fact: diff --git a/roles/grafana_cloud_operator/tasks/main.yml b/roles/grafana_cloud_operator/tasks/main.yml index 7b112b32..e0e56b94 100644 --- a/roles/grafana_cloud_operator/tasks/main.yml +++ b/roles/grafana_cloud_operator/tasks/main.yml @@ -5,7 +5,11 @@ - name: Execute tasks for hub and spoke topology ansible.builtin.include_tasks: grafana_oncall_hub_spoke.yml when: gco_cr.spec.provisionMode == 'hubAndSpoke' + vars: + mode: go_cr.spec.provisionMode - name: Execute tasks for standalone topology ansible.builtin.include_tasks: grafana_oncall_standalone.yml when: gco_cr.spec.provisionMode == 'standalone' + vars: + mode: go_cr.spec.provisionMode \ No newline at end of file From db7647b3cd4b06b4e78c38d1ce05d40d82244285 Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Wed, 10 Jan 2024 14:19:13 +0500 Subject: [PATCH 17/31] Update --- roles/grafana_cloud_operator/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/grafana_cloud_operator/tasks/main.yml b/roles/grafana_cloud_operator/tasks/main.yml index e0e56b94..ac6768e3 100644 --- a/roles/grafana_cloud_operator/tasks/main.yml +++ b/roles/grafana_cloud_operator/tasks/main.yml @@ -12,4 +12,4 @@ ansible.builtin.include_tasks: grafana_oncall_standalone.yml when: gco_cr.spec.provisionMode == 'standalone' vars: - mode: go_cr.spec.provisionMode \ No newline at end of file + mode: go_cr.spec.provisionMode From 45be97a06378c7d97945d579a2be229f588bd122 Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Wed, 10 Jan 2024 14:28:20 +0500 Subject: [PATCH 18/31] Update --- roles/grafana_cloud_operator/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/grafana_cloud_operator/tasks/main.yml b/roles/grafana_cloud_operator/tasks/main.yml index ac6768e3..d453b2d0 100644 --- a/roles/grafana_cloud_operator/tasks/main.yml +++ b/roles/grafana_cloud_operator/tasks/main.yml @@ -6,10 +6,10 @@ ansible.builtin.include_tasks: grafana_oncall_hub_spoke.yml when: gco_cr.spec.provisionMode == 'hubAndSpoke' vars: - mode: go_cr.spec.provisionMode + mode: gco_cr.spec.provisionMode - name: Execute tasks for standalone topology ansible.builtin.include_tasks: grafana_oncall_standalone.yml when: gco_cr.spec.provisionMode == 'standalone' vars: - mode: go_cr.spec.provisionMode + mode: gco_cr.spec.provisionMode From 1dcee232cc995ca945c43fb331534b5a0e674c70 Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Wed, 10 Jan 2024 14:36:41 +0500 Subject: [PATCH 19/31] Update --- roles/grafana_cloud_operator/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/grafana_cloud_operator/tasks/main.yml b/roles/grafana_cloud_operator/tasks/main.yml index d453b2d0..6f3316af 100644 --- a/roles/grafana_cloud_operator/tasks/main.yml +++ b/roles/grafana_cloud_operator/tasks/main.yml @@ -6,10 +6,10 @@ ansible.builtin.include_tasks: grafana_oncall_hub_spoke.yml when: gco_cr.spec.provisionMode == 'hubAndSpoke' vars: - mode: gco_cr.spec.provisionMode + mode: {{ gco_cr.spec.provisionMode }} - name: Execute tasks for standalone topology ansible.builtin.include_tasks: grafana_oncall_standalone.yml when: gco_cr.spec.provisionMode == 'standalone' vars: - mode: gco_cr.spec.provisionMode + mode: {{ gco_cr.spec.provisionMode }} From e1ac494c6199dde41e6f23fae39d5374cc549076 Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Wed, 10 Jan 2024 14:39:04 +0500 Subject: [PATCH 20/31] Update --- roles/grafana_cloud_operator/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/grafana_cloud_operator/tasks/main.yml b/roles/grafana_cloud_operator/tasks/main.yml index 6f3316af..c4f502f2 100644 --- a/roles/grafana_cloud_operator/tasks/main.yml +++ b/roles/grafana_cloud_operator/tasks/main.yml @@ -6,10 +6,10 @@ ansible.builtin.include_tasks: grafana_oncall_hub_spoke.yml when: gco_cr.spec.provisionMode == 'hubAndSpoke' vars: - mode: {{ gco_cr.spec.provisionMode }} + mode: "{{ gco_cr.spec.provisionMode }}" - name: Execute tasks for standalone topology ansible.builtin.include_tasks: grafana_oncall_standalone.yml when: gco_cr.spec.provisionMode == 'standalone' vars: - mode: {{ gco_cr.spec.provisionMode }} + mode: "{{ gco_cr.spec.provisionMode }}" From 2c857214e55507fe4554df53e2e9f3c704e267c3 Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Wed, 10 Jan 2024 14:54:06 +0500 Subject: [PATCH 21/31] Update --- roles/grafana_cloud_operator/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/grafana_cloud_operator/tasks/main.yml b/roles/grafana_cloud_operator/tasks/main.yml index c4f502f2..47e32333 100644 --- a/roles/grafana_cloud_operator/tasks/main.yml +++ b/roles/grafana_cloud_operator/tasks/main.yml @@ -6,10 +6,10 @@ ansible.builtin.include_tasks: grafana_oncall_hub_spoke.yml when: gco_cr.spec.provisionMode == 'hubAndSpoke' vars: - mode: "{{ gco_cr.spec.provisionMode }}" + mode: hubAndSpoke - name: Execute tasks for standalone topology ansible.builtin.include_tasks: grafana_oncall_standalone.yml when: gco_cr.spec.provisionMode == 'standalone' vars: - mode: "{{ gco_cr.spec.provisionMode }}" + mode: standalone From 80e220b0cd73aa812605c90b759a16d23f00e484 Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Wed, 10 Jan 2024 15:03:35 +0500 Subject: [PATCH 22/31] Update --- .../tasks/modify_alertmanager_secret.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml index 7b4acdd4..24cb3808 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -38,14 +38,10 @@ reason: "AlertmanagerConfigModified" message: "Decoded and modified the alertmanager secret configuration" -- name: Display mode string coming in the value - ansible.builtin.debug: - var: mode - - 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: 'mode == "hubAndSpoke"' + when: mode == "hubAndSpoke" - name: Create a new SyncSet for each cluster to patch alertmanager-main secret kubernetes.core.k8s: @@ -71,5 +67,5 @@ alertmanager.yaml: "{{ encoded_alertmanager_secret_content }}" when: - create_integration_for | length > 0 - - 'mode == "hubAndSpoke"' + - mode == "hubAndSpoke" register: syncset_creation_results From b2d34a1105a59c48676d058a8c536f6c91082a83 Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Wed, 10 Jan 2024 16:34:05 +0500 Subject: [PATCH 23/31] Debugging --- .../tasks/grafana_oncall_standalone.yml | 8 ++++---- roles/grafana_cloud_operator/tasks/main.yml | 8 ++++---- .../tasks/modify_alertmanager_secret.yml | 4 ++++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml b/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml index 6d86478a..a1eedf1b 100644 --- a/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml +++ b/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml @@ -78,16 +78,16 @@ reason: "GrafanaIntegrationSuccess" message: "Grafana integration created successfully" -- name: Display mode string coming in the value - ansible.builtin.debug: - var: mode +# - name: Display mode string coming in the value +# ansible.builtin.debug: +# var: mode - name: Modify Alertmanager secret ansible.builtin.include_tasks: modify_alertmanager_secret.yml vars: receiver_name: "{{ cluster_name }}" receiver_url: "{{ grafana_integration_response.json.link }}" -# mode: "{{ gco_cr.spec.provisionMode }}" + mode: "standalone" - name: Re-encode modified alertmanager content for cluster ansible.builtin.set_fact: diff --git a/roles/grafana_cloud_operator/tasks/main.yml b/roles/grafana_cloud_operator/tasks/main.yml index 47e32333..0003b71d 100644 --- a/roles/grafana_cloud_operator/tasks/main.yml +++ b/roles/grafana_cloud_operator/tasks/main.yml @@ -5,11 +5,11 @@ - name: Execute tasks for hub and spoke topology ansible.builtin.include_tasks: grafana_oncall_hub_spoke.yml when: gco_cr.spec.provisionMode == 'hubAndSpoke' - vars: - mode: hubAndSpoke + # vars: + # mode: hubAndSpoke - name: Execute tasks for standalone topology ansible.builtin.include_tasks: grafana_oncall_standalone.yml when: gco_cr.spec.provisionMode == 'standalone' - vars: - mode: standalone + # vars: + # mode: standalone diff --git a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml index 24cb3808..59370ec3 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -38,6 +38,10 @@ reason: "AlertmanagerConfigModified" message: "Decoded and modified the alertmanager secret configuration" +- name: Display mode string coming in the value + ansible.builtin.debug: + var: mode + - name: Re-encode modified alertmanager content for cluster ansible.builtin.set_fact: encoded_alertmanager_secret_content: "{{ modified_alertmanager_secret_content | to_nice_yaml | b64encode }}" From cdf00807b1dabf44700e1d72ca1486b1a12a4f68 Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Wed, 10 Jan 2024 19:36:24 +0500 Subject: [PATCH 24/31] test --- roles/grafana_cloud_operator/defaults/main.yml | 3 +++ .../tasks/grafana_oncall_standalone.yml | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/roles/grafana_cloud_operator/defaults/main.yml b/roles/grafana_cloud_operator/defaults/main.yml index a4c80a75..a7662ccf 100644 --- a/roles/grafana_cloud_operator/defaults/main.yml +++ b/roles/grafana_cloud_operator/defaults/main.yml @@ -23,3 +23,6 @@ grafana_cloud_operator_alertmanager_secret_name: alertmanager-main # SyncSet details grafana_cloud_operator_syncset_namespace: grafana-cloud-operator + +#Mode +mode: standalone diff --git a/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml b/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml index a1eedf1b..ad819405 100644 --- a/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml +++ b/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml @@ -78,9 +78,9 @@ reason: "GrafanaIntegrationSuccess" message: "Grafana integration created successfully" -# - name: Display mode string coming in the value -# ansible.builtin.debug: -# var: mode +- name: Display mode string coming in the value + ansible.builtin.debug: + var: mode - name: Modify Alertmanager secret ansible.builtin.include_tasks: modify_alertmanager_secret.yml From ea952aaa0aaede3df1d9b717ac01277daf137710 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 10 Jan 2024 10:27:48 +0100 Subject: [PATCH 25/31] Update stakater/.github action to v0.0.60 (#38) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 0f6834e8..3fdb7d95 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -7,7 +7,7 @@ on: jobs: qa: - uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.55 + uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.60 with: MD_CONFIG: .github/md_config.json DOC_SRC: README.md From 15a80e22085a7768692fc6a4dbf0d29ee7c2a3c9 Mon Sep 17 00:00:00 2001 From: stakater-github-root Date: Wed, 10 Jan 2024 09:29:27 +0000 Subject: [PATCH 26/31] [skip-ci] Update artifacts --- Makefile | 2 +- ...fana-cloud-ansible-operator.clusterserviceversion.yaml | 8 ++++---- charts/grafana-oncall/Chart.yaml | 4 ++-- charts/grafana-oncall/values.yaml | 2 +- config/manager/kustomization.yaml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 20aa745e..c3958f55 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ endif # To re-generate a bundle for another specific version without changing the standard setup, you can: # - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2) # - use environment variables to overwrite this value (e.g export VERSION=0.0.2) -VERSION ?= 0.0.27 +VERSION ?= 0.0.28 # CHANNELS define the bundle channels used in the bundle. # Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable") diff --git a/bundle/manifests/grafana-cloud-ansible-operator.clusterserviceversion.yaml b/bundle/manifests/grafana-cloud-ansible-operator.clusterserviceversion.yaml index e1fbc140..dee6b881 100644 --- a/bundle/manifests/grafana-cloud-ansible-operator.clusterserviceversion.yaml +++ b/bundle/manifests/grafana-cloud-ansible-operator.clusterserviceversion.yaml @@ -28,10 +28,10 @@ metadata: } ] capabilities: Basic Install - createdAt: "2024-01-08T05:15:20Z" + createdAt: "2024-01-10T09:29:11Z" operators.operatorframework.io/builder: operator-sdk-v1.31.0 operators.operatorframework.io/project_layout: ansible.sdk.operatorframework.io/v1 - name: grafana-cloud-ansible-operator.v0.0.27 + name: grafana-cloud-ansible-operator.v0.0.28 namespace: placeholder spec: apiservicedefinitions: {} @@ -236,7 +236,7 @@ spec: env: - name: ANSIBLE_GATHERING value: explicit - image: ghcr.io/stakater/grafana-cloud-ansible-operator:v0.0.27 + image: ghcr.io/stakater/grafana-cloud-ansible-operator:v0.0.28 livenessProbe: httpGet: path: /healthz @@ -329,4 +329,4 @@ spec: provider: name: Stakater url: www.stakater.com - version: 0.0.27 + version: 0.0.28 diff --git a/charts/grafana-oncall/Chart.yaml b/charts/grafana-oncall/Chart.yaml index cf4cea1a..b50b6568 100644 --- a/charts/grafana-oncall/Chart.yaml +++ b/charts/grafana-oncall/Chart.yaml @@ -8,10 +8,10 @@ sources: - https://github.com/stakater/grafana-cloud-ansible-operator # Helm chart Version -version: 0.0.27 +version: 0.0.28 # Application version to be deployed -appVersion: 0.0.27 +appVersion: 0.0.28 # Maintainers maintainers: diff --git a/charts/grafana-oncall/values.yaml b/charts/grafana-oncall/values.yaml index 4bb28c4a..e8ea5f01 100644 --- a/charts/grafana-oncall/values.yaml +++ b/charts/grafana-oncall/values.yaml @@ -6,7 +6,7 @@ image: repository: ghcr.io/stakater/grafana-cloud-ansible-operator pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: v0.0.27 + tag: v0.0.28 imagePullSecrets: - name: saap-dockerconfigjson diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index aaf8264e..1c8dca94 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -5,4 +5,4 @@ kind: Kustomization images: - name: controller newName: ghcr.io/stakater/grafana-cloud-ansible-operator - newTag: v0.0.27 + newTag: v0.0.28 From 93fd703eec849f452f824adee578c283ee527194 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 10 Jan 2024 15:29:19 +0100 Subject: [PATCH 27/31] Update stakater/.github action to v0.0.62 (#41) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 3fdb7d95..d0fce2e0 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -7,7 +7,7 @@ on: jobs: qa: - uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.60 + uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.62 with: MD_CONFIG: .github/md_config.json DOC_SRC: README.md From 559e3e7d230831fef204b016026b126d41167ecf Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Wed, 10 Jan 2024 19:48:20 +0500 Subject: [PATCH 28/31] revert --- .github/workflows/pull_request.yml | 2 +- Makefile | 2 +- .../grafana-cloud-ansible-operator.clusterserviceversion.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index d0fce2e0..0f6834e8 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -7,7 +7,7 @@ on: jobs: qa: - uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.62 + uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.55 with: MD_CONFIG: .github/md_config.json DOC_SRC: README.md diff --git a/Makefile b/Makefile index c3958f55..20aa745e 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ endif # To re-generate a bundle for another specific version without changing the standard setup, you can: # - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2) # - use environment variables to overwrite this value (e.g export VERSION=0.0.2) -VERSION ?= 0.0.28 +VERSION ?= 0.0.27 # CHANNELS define the bundle channels used in the bundle. # Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable") diff --git a/bundle/manifests/grafana-cloud-ansible-operator.clusterserviceversion.yaml b/bundle/manifests/grafana-cloud-ansible-operator.clusterserviceversion.yaml index dee6b881..4b37f94c 100644 --- a/bundle/manifests/grafana-cloud-ansible-operator.clusterserviceversion.yaml +++ b/bundle/manifests/grafana-cloud-ansible-operator.clusterserviceversion.yaml @@ -31,7 +31,7 @@ metadata: createdAt: "2024-01-10T09:29:11Z" operators.operatorframework.io/builder: operator-sdk-v1.31.0 operators.operatorframework.io/project_layout: ansible.sdk.operatorframework.io/v1 - name: grafana-cloud-ansible-operator.v0.0.28 + name: grafana-cloud-ansible-operator.v0.0.27 namespace: placeholder spec: apiservicedefinitions: {} @@ -236,7 +236,7 @@ spec: env: - name: ANSIBLE_GATHERING value: explicit - image: ghcr.io/stakater/grafana-cloud-ansible-operator:v0.0.28 + image: ghcr.io/stakater/grafana-cloud-ansible-operator:v0.0.27 livenessProbe: httpGet: path: /healthz From 0c9d550e81287206c2e43a877bb516a1748763be Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Wed, 10 Jan 2024 19:49:03 +0500 Subject: [PATCH 29/31] revert --- .../grafana-cloud-ansible-operator.clusterserviceversion.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundle/manifests/grafana-cloud-ansible-operator.clusterserviceversion.yaml b/bundle/manifests/grafana-cloud-ansible-operator.clusterserviceversion.yaml index 4b37f94c..5d15d146 100644 --- a/bundle/manifests/grafana-cloud-ansible-operator.clusterserviceversion.yaml +++ b/bundle/manifests/grafana-cloud-ansible-operator.clusterserviceversion.yaml @@ -28,7 +28,7 @@ metadata: } ] capabilities: Basic Install - createdAt: "2024-01-10T09:29:11Z" + createdAt: "2024-01-08T05:15:20Z" operators.operatorframework.io/builder: operator-sdk-v1.31.0 operators.operatorframework.io/project_layout: ansible.sdk.operatorframework.io/v1 name: grafana-cloud-ansible-operator.v0.0.27 From 4efda7dcbbc156d004de56049506516b1cc1c88e Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Wed, 10 Jan 2024 19:50:44 +0500 Subject: [PATCH 30/31] Update --- .../grafana-cloud-ansible-operator.clusterserviceversion.yaml | 2 +- charts/grafana-oncall/Chart.yaml | 4 ++-- charts/grafana-oncall/values.yaml | 2 +- config/manager/kustomization.yaml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bundle/manifests/grafana-cloud-ansible-operator.clusterserviceversion.yaml b/bundle/manifests/grafana-cloud-ansible-operator.clusterserviceversion.yaml index 5d15d146..e1fbc140 100644 --- a/bundle/manifests/grafana-cloud-ansible-operator.clusterserviceversion.yaml +++ b/bundle/manifests/grafana-cloud-ansible-operator.clusterserviceversion.yaml @@ -329,4 +329,4 @@ spec: provider: name: Stakater url: www.stakater.com - version: 0.0.28 + version: 0.0.27 diff --git a/charts/grafana-oncall/Chart.yaml b/charts/grafana-oncall/Chart.yaml index b50b6568..cf4cea1a 100644 --- a/charts/grafana-oncall/Chart.yaml +++ b/charts/grafana-oncall/Chart.yaml @@ -8,10 +8,10 @@ sources: - https://github.com/stakater/grafana-cloud-ansible-operator # Helm chart Version -version: 0.0.28 +version: 0.0.27 # Application version to be deployed -appVersion: 0.0.28 +appVersion: 0.0.27 # Maintainers maintainers: diff --git a/charts/grafana-oncall/values.yaml b/charts/grafana-oncall/values.yaml index e8ea5f01..4bb28c4a 100644 --- a/charts/grafana-oncall/values.yaml +++ b/charts/grafana-oncall/values.yaml @@ -6,7 +6,7 @@ image: repository: ghcr.io/stakater/grafana-cloud-ansible-operator pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: v0.0.28 + tag: v0.0.27 imagePullSecrets: - name: saap-dockerconfigjson diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 1c8dca94..aaf8264e 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -5,4 +5,4 @@ kind: Kustomization images: - name: controller newName: ghcr.io/stakater/grafana-cloud-ansible-operator - newTag: v0.0.28 + newTag: v0.0.27 From 44896ddbc3e7a250a3ab4e3eb75eeec93a3968e1 Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Wed, 10 Jan 2024 19:53:48 +0500 Subject: [PATCH 31/31] update --- roles/grafana_cloud_operator/defaults/main.yml | 4 ++-- .../tasks/grafana_oncall_standalone.yml | 3 +-- .../tasks/modify_alertmanager_secret.yml | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/roles/grafana_cloud_operator/defaults/main.yml b/roles/grafana_cloud_operator/defaults/main.yml index a7662ccf..f1c1c78b 100644 --- a/roles/grafana_cloud_operator/defaults/main.yml +++ b/roles/grafana_cloud_operator/defaults/main.yml @@ -24,5 +24,5 @@ grafana_cloud_operator_alertmanager_secret_name: alertmanager-main # SyncSet details grafana_cloud_operator_syncset_namespace: grafana-cloud-operator -#Mode -mode: standalone +# Mode +grafana_cloud_operator_mode: standalone diff --git a/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml b/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml index ad819405..a8524e72 100644 --- a/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml +++ b/roles/grafana_cloud_operator/tasks/grafana_oncall_standalone.yml @@ -80,14 +80,13 @@ - name: Display mode string coming in the value ansible.builtin.debug: - var: mode + var: grafana_cloud_operator_mode - name: Modify Alertmanager secret ansible.builtin.include_tasks: modify_alertmanager_secret.yml vars: receiver_name: "{{ cluster_name }}" receiver_url: "{{ grafana_integration_response.json.link }}" - 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 59370ec3..8c976995 100644 --- a/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml +++ b/roles/grafana_cloud_operator/tasks/modify_alertmanager_secret.yml @@ -40,12 +40,12 @@ - name: Display mode string coming in the value ansible.builtin.debug: - var: mode + var: grafana_cloud_operator_mode - 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: mode == "hubAndSpoke" + when: grafana_cloud_operator_mode == "hubAndSpoke" - name: Create a new SyncSet for each cluster to patch alertmanager-main secret kubernetes.core.k8s: @@ -71,5 +71,5 @@ alertmanager.yaml: "{{ encoded_alertmanager_secret_content }}" when: - create_integration_for | length > 0 - - mode == "hubAndSpoke" + - grafana_cloud_operator_mode == "hubAndSpoke" register: syncset_creation_results