Skip to content

Commit

Permalink
fix: reinstall prometheus_pushgateway when <2.0.0 (#1319)
Browse files Browse the repository at this point in the history
Reinstall prometheus_pushgateway helm when existing release <2.0.0
Related-To: #1282
Related-To: #1308

Reviewed-by: Mohammed Naser <[email protected]>
  • Loading branch information
ricolin authored Jun 7, 2024
1 parent 435dafb commit 6cf5e5f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions roles/prometheus_pushgateway/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@
# License for the specific language governing permissions and limitations
# under the License.

- name: Gather information prometheus_pushgateway
run_once: true
kubernetes.core.helm_info:
name: "{{ prometheus_pushgateway_helm_release_name }}"
release_namespace: "{{ prometheus_pushgateway_helm_release_namespace }}"
register: result

- name: Uninstall Helm chart
run_once: true
kubernetes.core.helm:
name: "{{ prometheus_pushgateway_helm_release_name }}"
release_namespace: "{{ prometheus_pushgateway_helm_release_namespace }}"
state: absent
wait: true
when: "'status' in result and result.status.status is match('deployed') and (result.status.chart | replace(prometheus_pushgateway_helm_release_name + '-','')) is version('2.0.0', operator='lt', strict=True)" # noqa: yaml[line-length]

- name: Deploy Helm chart
run_once: true
kubernetes.core.helm:
Expand Down

0 comments on commit 6cf5e5f

Please sign in to comment.