blob: b951822e5ec924fb8b972507e270b033a8b5834a [file] [log] [blame]
Michiel Piscaer30d8e7b2022-07-08 13:06:27 +00001# 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
guilhermesteinmullerdca72972023-01-24 18:08:10 +000015- name: Uninstall the legacy HelmRelease
16 run_once: true
17 block:
18 - name: Suspend the existing HelmRelease
Mohammed Naserf0314a82023-04-11 18:53:30 +000019 failed_when: false
guilhermesteinmullerdca72972023-01-24 18:08:10 +000020 kubernetes.core.k8s:
21 state: patched
22 api_version: helm.toolkit.fluxcd.io/v2beta1
23 kind: HelmRelease
Mohammed Naser2145fc32023-01-29 23:23:03 +000024 name: "{{ designate_helm_release_name }}"
25 namespace: "{{ designate_helm_release_namespace }}"
guilhermesteinmullerdca72972023-01-24 18:08:10 +000026 definition:
27 spec:
28 suspend: true
29
30 - name: Remove the existing HelmRelease
Mohammed Naserf0314a82023-04-11 18:53:30 +000031 failed_when: false
guilhermesteinmullerdca72972023-01-24 18:08:10 +000032 kubernetes.core.k8s:
33 state: absent
34 api_version: helm.toolkit.fluxcd.io/v2beta1
35 kind: HelmRelease
Mohammed Naser2145fc32023-01-29 23:23:03 +000036 name: "{{ designate_helm_release_name }}"
37 namespace: "{{ designate_helm_release_namespace }}"
Michiel Piscaer30d8e7b2022-07-08 13:06:27 +000038
Mohammed Naser0a13cee2023-03-02 11:28:29 +010039- name: Lookup resources
40 ansible.builtin.import_tasks:
41 file: lookups.yml
42
Michiel Piscaer30d8e7b2022-07-08 13:06:27 +000043- name: Deploy Helm chart
guilhermesteinmullerdca72972023-01-24 18:08:10 +000044 run_once: true
45 kubernetes.core.helm:
Mohammed Naser2145fc32023-01-29 23:23:03 +000046 name: "{{ designate_helm_release_name }}"
47 chart_ref: "{{ designate_helm_chart_ref }}"
48 release_namespace: "{{ designate_helm_release_namespace }}"
guilhermesteinmullerdca72972023-01-24 18:08:10 +000049 create_namespace: true
50 kubeconfig: /etc/kubernetes/admin.conf
Mohammed Naser2145fc32023-01-29 23:23:03 +000051 values: "{{ _designate_helm_values | combine(designate_helm_values, recursive=True) }}"
Michiel Piscaer30d8e7b2022-07-08 13:06:27 +000052
53- name: Create Ingress
54 ansible.builtin.include_role:
55 name: openstack_helm_ingress
56 vars:
Michiel Piscaer4736bea2022-09-13 16:12:33 +020057 openstack_helm_ingress_endpoint: dns
Michiel Piscaer30d8e7b2022-07-08 13:06:27 +000058 openstack_helm_ingress_service_name: designate-api
Mohammed Naserf622bbe2023-03-13 09:41:38 +000059 openstack_helm_ingress_service_port: 9001
Mohammed Naser2145fc32023-01-29 23:23:03 +000060 openstack_helm_ingress_annotations: "{{ designate_ingress_annotations }}"