chore: move ovs to offline-install
diff --git a/roles/openstack_helm_infra_openvswitch/defaults/main.yml b/roles/openstack_helm_infra_openvswitch/defaults/main.yml
index 3407a49..3bf4a85 100644
--- a/roles/openstack_helm_infra_openvswitch/defaults/main.yml
+++ b/roles/openstack_helm_infra_openvswitch/defaults/main.yml
@@ -1,19 +1,20 @@
----
-# .. vim: foldmarker=[[[,]]]:foldmethod=marker
-
-# .. Copyright (C) 2022 VEXXHOST, Inc.
-# .. SPDX-License-Identifier: Apache-2.0
-
-# Default variables
-# =================
-
-# .. contents:: Sections
-# :local:
-
-
-# .. envvar:: openstack_helm_infra_openvswitch_values [[[
+# Copyright (c) 2023 VEXXHOST, Inc.
#
-# Overrides for Helm chart values
-openstack_helm_infra_openvswitch_values: {}
+# 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.
- # ]]]
+openstack_helm_infra_openvswitch_helm_release_name: infra_openvswitch
+openstack_helm_infra_openvswitch_helm_chart_path: "{{ role_path }}/../../charts/infra_openvswitch/"
+openstack_helm_infra_openvswitch_helm_chart_ref: /usr/local/src/infra_openvswitch
+
+openstack_helm_infra_openvswitch_helm_release_namespace: openstack
+openstack_helm_infra_openvswitch_helm_values: {}
diff --git a/roles/openstack_helm_infra_openvswitch/meta/main.yml b/roles/openstack_helm_infra_openvswitch/meta/main.yml
index 834cb7c..0f2764e 100644
--- a/roles/openstack_helm_infra_openvswitch/meta/main.yml
+++ b/roles/openstack_helm_infra_openvswitch/meta/main.yml
@@ -25,3 +25,10 @@
dependencies:
- role: defaults
+ - role: openstack_helm_endpoints
+ vars:
+ openstack_helm_endpoints_chart: openvswitch
+ - role: upload_helm_chart
+ vars:
+ upload_helm_chart_src: "{{ openstack_helm_infra_openvswitch_helm_chart_path }}"
+ upload_helm_chart_dest: "{{ openstack_helm_infra_openvswitch_helm_chart_ref }}"
diff --git a/roles/openstack_helm_infra_openvswitch/tasks/main.yml b/roles/openstack_helm_infra_openvswitch/tasks/main.yml
index eb3dc2a..b0b2349 100644
--- a/roles/openstack_helm_infra_openvswitch/tasks/main.yml
+++ b/roles/openstack_helm_infra_openvswitch/tasks/main.yml
@@ -12,53 +12,34 @@
# License for the specific language governing permissions and limitations
# under the License.
-- name: Generate OpenStack-Helm endpoints
- ansible.builtin.include_role:
- name: openstack_helm_endpoints
- vars:
- openstack_helm_endpoints_chart: openvswitch
+- name: Uninstall the legacy HelmRelease
+ run_once: true
+ block:
+ - name: Suspend the existing HelmRelease
+ kubernetes.core.k8s:
+ state: patched
+ api_version: helm.toolkit.fluxcd.io/v2beta1
+ kind: HelmRelease
+ name: "{{ openstack_helm_infra_openvswitch_helm_release_name }}"
+ namespace: "{{ openstack_helm_infra_openvswitch_helm_release_namespace }}"
+ definition:
+ spec:
+ suspend: true
+
+ - name: Remove the existing HelmRelease
+ kubernetes.core.k8s:
+ state: absent
+ api_version: helm.toolkit.fluxcd.io/v2beta1
+ kind: HelmRelease
+ name: "{{ openstack_helm_infra_openvswitch_helm_release_name }}"
+ namespace: "{{ openstack_helm_infra_openvswitch_helm_release_namespace }}"
- name: Deploy Helm chart
- kubernetes.core.k8s:
- state: present
- definition:
- - apiVersion: source.toolkit.fluxcd.io/v1beta2
- kind: GitRepository
- metadata:
- name: openstack-helm-infra
- namespace: openstack
- spec:
- interval: 60s
- url: https://github.com/vexxhost/openstack-helm-infra
- ref:
- commit: 24726dffd6f1e5ac91620e92e04a782cb94340e8
-
- - apiVersion: v1
- kind: Secret
- metadata:
- name: atmosphere-openvswitch
- namespace: openstack
- stringData:
- values.yaml: "{{ _openstack_helm_infra_openvswitch_values | combine(openstack_helm_infra_openvswitch_values, recursive=True) | to_nice_yaml }}"
-
- - apiVersion: helm.toolkit.fluxcd.io/v2beta1
- kind: HelmRelease
- metadata:
- name: openvswitch
- namespace: openstack
- spec:
- interval: 60s
- timeout: 60m
- chart:
- spec:
- chart: ./openvswitch
- sourceRef:
- kind: GitRepository
- name: openstack-helm-infra
- install:
- disableWait: true
- upgrade:
- disableWait: true
- valuesFrom:
- - kind: Secret
- name: atmosphere-openvswitch
+ run_once: true
+ kubernetes.core.helm:
+ name: "{{ openstack_helm_infra_openvswitch_helm_release_name }}"
+ chart_ref: "{{ openstack_helm_infra_openvswitch_helm_chart_ref }}"
+ release_namespace: "{{ openstack_helm_infra_openvswitch_helm_release_namespace }}"
+ create_namespace: true
+ kubeconfig: /etc/kubernetes/admin.conf
+ values: "{{ _openstack_helm_infra_openvswitch_helm_values | combine(openstack_helm_infra_openvswitch_helm_values, recursive=True) }}"
diff --git a/roles/openstack_helm_infra_openvswitch/vars/main.yml b/roles/openstack_helm_infra_openvswitch/vars/main.yml
index 67564f6..ef74425 100644
--- a/roles/openstack_helm_infra_openvswitch/vars/main.yml
+++ b/roles/openstack_helm_infra_openvswitch/vars/main.yml
@@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-_openstack_helm_infra_openvswitch_values:
+_openstack_helm_infra_openvswitch_helm_values:
endpoints: "{{ openstack_helm_endpoints }}"
images:
tags: "{{ atmosphere_images | vexxhost.atmosphere.openstack_helm_image_tags('openvswitch') }}"