blob: 617c92b82ffee7acd42ea33cc918a7b954f03688 [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.
Rico Lind020bc22023-11-01 01:57:03 +080014#
Mohammed Naserb7b97d62022-03-12 16:30:00 -050015
guilhermesteinmullerd5340622023-01-24 17:57:10 +000016- name: Uninstall the legacy HelmRelease
17 run_once: true
18 block:
19 - name: Suspend the existing HelmRelease
Mohammed Naserf0314a82023-04-11 18:53:30 +000020 failed_when: false
guilhermesteinmullerd5340622023-01-24 17:57:10 +000021 kubernetes.core.k8s:
22 state: patched
23 api_version: helm.toolkit.fluxcd.io/v2beta1
24 kind: HelmRelease
Mohammed Naser2145fc32023-01-29 23:23:03 +000025 name: "{{ cinder_helm_release_name }}"
26 namespace: "{{ cinder_helm_release_namespace }}"
guilhermesteinmullerd5340622023-01-24 17:57:10 +000027 definition:
28 spec:
29 suspend: true
30
31 - name: Remove the existing HelmRelease
Mohammed Naserf0314a82023-04-11 18:53:30 +000032 failed_when: false
guilhermesteinmullerd5340622023-01-24 17:57:10 +000033 kubernetes.core.k8s:
34 state: absent
35 api_version: helm.toolkit.fluxcd.io/v2beta1
36 kind: HelmRelease
Mohammed Naser2145fc32023-01-29 23:23:03 +000037 name: "{{ cinder_helm_release_name }}"
38 namespace: "{{ cinder_helm_release_namespace }}"
Mohammed Naserb7b97d62022-03-12 16:30:00 -050039
Rico Lind020bc22023-11-01 01:57:03 +080040- name: Generate Helm values
41 ansible.builtin.set_fact:
42 _cinder_helm_values: "{{ __cinder_helm_values }}"
43
44- name: Append Helm values (Staffeln)
45 when: atmosphere_staffeln_enabled is defined
46 ansible.builtin.set_fact:
47 _neutron_helm_values: "{{ _cinder_helm_values | combine(__cinder_staffeln_helm_values, recursive=True) }}"
48
Mohammed Naserb7b97d62022-03-12 16:30:00 -050049- name: Deploy Helm chart
guilhermesteinmullerd5340622023-01-24 17:57:10 +000050 run_once: true
51 kubernetes.core.helm:
Mohammed Naser2145fc32023-01-29 23:23:03 +000052 name: "{{ cinder_helm_release_name }}"
53 chart_ref: "{{ cinder_helm_chart_ref }}"
54 release_namespace: "{{ cinder_helm_release_namespace }}"
guilhermesteinmullerd5340622023-01-24 17:57:10 +000055 create_namespace: true
56 kubeconfig: /etc/kubernetes/admin.conf
Mohammed Naser2145fc32023-01-29 23:23:03 +000057 values: "{{ _cinder_helm_values | combine(cinder_helm_values, recursive=True) }}"
Mohammed Naserb7b97d62022-03-12 16:30:00 -050058
59- name: Create Ingress
60 ansible.builtin.include_role:
61 name: openstack_helm_ingress
62 vars:
63 openstack_helm_ingress_endpoint: volumev3
64 openstack_helm_ingress_service_name: cinder-api
65 openstack_helm_ingress_service_port: 8776
Mohammed Naser2145fc32023-01-29 23:23:03 +000066 openstack_helm_ingress_annotations: "{{ _cinder_ingress_annotations | combine(cinder_ingress_annotations) }}"