blob: d338ebe8123bea39cf12257f3d57db5c299cbda3 [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
Mohammed Naser94e07e12023-01-18 03:29:39 +000015# NOTE(mnaser): We should get rid of this task eventually as it is suspending
16# the old HelmRelease and removing it to avoid uninstalling the
17# Helm chart.
18- name: Uninstall the legacy HelmRelease
19 run_once: true
20 block:
21 - name: Suspend the existing HelmRelease
22 kubernetes.core.k8s:
23 state: patched
24 api_version: helm.toolkit.fluxcd.io/v2beta1
25 kind: HelmRelease
Mohammed Naser2145fc32023-01-29 23:23:03 +000026 name: "{{ placement_helm_release_name }}"
27 namespace: "{{ placement_helm_release_namespace }}"
Mohammed Naser94e07e12023-01-18 03:29:39 +000028 definition:
29 spec:
30 suspend: true
31
32 - name: Remove the existing HelmRelease
33 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: "{{ placement_helm_release_name }}"
38 namespace: "{{ placement_helm_release_namespace }}"
Mohammed Naserb7b97d62022-03-12 16:30:00 -050039
40- name: Deploy Helm chart
Mohammed Naser94e07e12023-01-18 03:29:39 +000041 run_once: true
42 kubernetes.core.helm:
Mohammed Naser2145fc32023-01-29 23:23:03 +000043 name: "{{ placement_helm_release_name }}"
44 chart_ref: "{{ placement_helm_chart_ref }}"
45 release_namespace: "{{ placement_helm_release_namespace }}"
Mohammed Naser94e07e12023-01-18 03:29:39 +000046 create_namespace: true
47 kubeconfig: /etc/kubernetes/admin.conf
Mohammed Naser2145fc32023-01-29 23:23:03 +000048 values: "{{ _placement_helm_values | combine(placement_helm_values, recursive=True) }}"
Mohammed Naserb7b97d62022-03-12 16:30:00 -050049
50- name: Create Ingress
51 ansible.builtin.include_role:
52 name: openstack_helm_ingress
53 vars:
54 openstack_helm_ingress_endpoint: placement
55 openstack_helm_ingress_service_name: placement-api
56 openstack_helm_ingress_service_port: 8778
Mohammed Naser2145fc32023-01-29 23:23:03 +000057 openstack_helm_ingress_annotations: "{{ placement_ingress_annotations }}"