| # Copyright (c) 2022 VEXXHOST, Inc. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| # not use this file except in compliance with the License. You may obtain |
| # a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| # 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: |
| name: "{{ prometheus_pushgateway_helm_release_name }}" |
| chart_ref: "{{ prometheus_pushgateway_helm_chart_ref }}" |
| release_namespace: "{{ prometheus_pushgateway_helm_release_namespace }}" |
| create_namespace: true |
| kubeconfig: /etc/kubernetes/admin.conf |
| values: "{{ _prometheus_pushgateway_helm_values | combine(prometheus_pushgateway_helm_values, recursive=True) }}" |