blob: 3b180ac1dd75367490d917bc87488b0d8e920908 [file] [log] [blame]
Mohammed Naserb7b97d62022-03-12 16:30:00 -05001# Copyright (c) 2022 VEXXHOST, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
Rico Lin6cf5e5f2024-06-07 09:41:12 +080015- name: Gather information prometheus_pushgateway
16 run_once: true
17 kubernetes.core.helm_info:
18 name: "{{ prometheus_pushgateway_helm_release_name }}"
19 release_namespace: "{{ prometheus_pushgateway_helm_release_namespace }}"
20 register: result
21
22- name: Uninstall Helm chart
23 run_once: true
24 kubernetes.core.helm:
25 name: "{{ prometheus_pushgateway_helm_release_name }}"
26 release_namespace: "{{ prometheus_pushgateway_helm_release_namespace }}"
27 state: absent
28 wait: true
29 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]
30
okozachenko120338139652023-01-28 01:46:46 +110031- name: Deploy Helm chart
32 run_once: true
33 kubernetes.core.helm:
okozachenko12037af0d412023-01-28 02:04:54 +110034 name: "{{ prometheus_pushgateway_helm_release_name }}"
35 chart_ref: "{{ prometheus_pushgateway_helm_chart_ref }}"
36 release_namespace: "{{ prometheus_pushgateway_helm_release_namespace }}"
okozachenko120338139652023-01-28 01:46:46 +110037 create_namespace: true
38 kubeconfig: /etc/kubernetes/admin.conf
okozachenko12037af0d412023-01-28 02:04:54 +110039 values: "{{ _prometheus_pushgateway_helm_values | combine(prometheus_pushgateway_helm_values, recursive=True) }}"