blob: b3d8f76aa8659e336952d20dd17a63f9687cd712 [file] [log] [blame]
Mohammed Naser54ee9922023-07-22 18:40:25 +00001# Copyright (c) 2023 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
Oleksandr K.d97f1122024-10-29 19:05:25 +010015- name: Replace unnecessary label in ovn-controller daemonset
16 run_once: true
17 when: atmosphere_network_backend == 'ovn'
18 block:
19 - name: Check if ovn_controller DaemonSet exists
20 kubernetes.core.k8s_info:
21 api_version: apps/v1
22 kind: DaemonSet
23 namespace: "{{ ovn_helm_release_namespace }}"
24 name: ovn-controller
25 kubeconfig: /etc/kubernetes/admin.conf
26 register: _ovn_controller_ds_info
27 failed_when: false
28
29 - name: Delete existing ovn controller DaemonSet if type label is found
30 kubernetes.core.k8s:
31 api_version: apps/v1
32 kind: DaemonSet
33 name: ovn-controller
34 namespace: "{{ ovn_helm_release_namespace }}"
35 state: absent
36 kubeconfig: /etc/kubernetes/admin.conf
37 when:
38 - _ovn_controller_ds_info.resources | length > 0
39 - "'type' in _ovn_controller_ds_info.resources[0].spec.selector.matchLabels"
40
Mohammed Naser54ee9922023-07-22 18:40:25 +000041- name: Deploy Helm chart
42 run_once: true
Mohammed Naser1d75a922023-07-23 19:24:49 +000043 when: atmosphere_network_backend == 'ovn'
Mohammed Naser54ee9922023-07-22 18:40:25 +000044 kubernetes.core.helm:
45 name: "{{ ovn_helm_release_name }}"
46 chart_ref: "{{ ovn_helm_chart_ref }}"
47 release_namespace: "{{ ovn_helm_release_namespace }}"
48 create_namespace: true
49 kubeconfig: /etc/kubernetes/admin.conf
50 values: "{{ _ovn_helm_values | combine(ovn_helm_values, recursive=True) }}"