chore: move nova to offline-install
diff --git a/roles/openstack_helm_nova/defaults/main.yml b/roles/openstack_helm_nova/defaults/main.yml
index c0415ad..0cc3af0 100644
--- a/roles/openstack_helm_nova/defaults/main.yml
+++ b/roles/openstack_helm_nova/defaults/main.yml
@@ -1,37 +1,29 @@
----
-# .. vim: foldmarker=[[[,]]]:foldmethod=marker
-
-# .. Copyright (C) 2022 VEXXHOST, Inc.
-# .. SPDX-License-Identifier: Apache-2.0
-
-# Default variables
-# =================
-
-# .. contents:: Sections
-# :local:
-
-
-# .. envvar:: openstack_helm_nova_values [[[
+# Copyright (c) 2023 VEXXHOST, Inc.
#
-# Overrides for Helm chart values
-openstack_helm_nova_values: {}
-
- # ]]]
-# .. envvar:: openstack_helm_nova_ssh_key [[[
+# 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_nova_helm_release_name: nova
+openstack_helm_nova_helm_chart_path: "{{ role_path }}/../../charts/nova/"
+openstack_helm_nova_helm_chart_ref: /usr/local/src/nova
+
+openstack_helm_nova_helm_release_namespace: openstack
+openstack_helm_nova_helm_values: {}
+
# Private SSH key used for cold & live migration
openstack_helm_nova_ssh_key: "{{ undef(hint='You must specifiy an SSH key for Nova.') }}"
- # ]]]
-# .. envvar:: openstack_helm_nova_flavors [[[
-#
# List of flavors to provision inside Nova
openstack_helm_nova_flavors: []
- # ]]]
-# .. envvar:: openstack_helm_nova_ingress_annotations [[[
-#
-# Ingress annotations
+# List of annotations to apply to the Ingress
openstack_helm_nova_ingress_annotations: {}
-
- # ]]]
diff --git a/roles/openstack_helm_nova/meta/main.yml b/roles/openstack_helm_nova/meta/main.yml
index e249695..40c681d 100644
--- a/roles/openstack_helm_nova/meta/main.yml
+++ b/roles/openstack_helm_nova/meta/main.yml
@@ -25,5 +25,11 @@
dependencies:
- role: defaults
- - role: atmosphere
+ - role: openstack_helm_endpoints
+ vars:
+ openstack_helm_endpoints_chart: nova
+ - role: upload_helm_chart
+ vars:
+ upload_helm_chart_src: "{{ openstack_helm_nova_helm_chart_path }}"
+ upload_helm_chart_dest: "{{ openstack_helm_nova_helm_chart_ref }}"
- role: openstacksdk
diff --git a/roles/openstack_helm_nova/tasks/main.yml b/roles/openstack_helm_nova/tasks/main.yml
index 93949c2..ccf3602 100644
--- a/roles/openstack_helm_nova/tasks/main.yml
+++ b/roles/openstack_helm_nova/tasks/main.yml
@@ -12,11 +12,27 @@
# 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: nova
+- 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_nova_helm_release_name }}"
+ namespace: "{{ openstack_helm_nova_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_nova_helm_release_name }}"
+ namespace: "{{ openstack_helm_nova_helm_release_namespace }}"
- name: Generate public key for SSH private key
become: false
@@ -50,38 +66,14 @@
state: absent
- name: Deploy Helm chart
- kubernetes.core.k8s:
- state: present
- definition:
- - apiVersion: v1
- kind: Secret
- metadata:
- name: atmosphere-nova
- namespace: openstack
- stringData:
- values.yaml: "{{ _openstack_helm_nova_values | to_nice_yaml }}"
-
- - apiVersion: helm.toolkit.fluxcd.io/v2beta1
- kind: HelmRelease
- metadata:
- name: nova
- namespace: openstack
- spec:
- interval: 60s
- chart:
- spec:
- chart: nova
- version: 0.2.32
- sourceRef:
- kind: HelmRepository
- name: openstack-helm
- install:
- disableWait: true
- upgrade:
- disableWait: true
- valuesFrom:
- - kind: Secret
- name: atmosphere-nova
+ run_once: true
+ kubernetes.core.helm:
+ name: "{{ openstack_helm_nova_helm_release_name }}"
+ chart_ref: "{{ openstack_helm_nova_helm_chart_ref }}"
+ release_namespace: "{{ openstack_helm_nova_helm_release_namespace }}"
+ create_namespace: true
+ kubeconfig: /etc/kubernetes/admin.conf
+ values: "{{ _openstack_helm_nova_helm_values | combine(openstack_helm_nova_helm_values, recursive=True) }}"
- name: Create Ingress
ansible.builtin.include_role:
diff --git a/roles/openstack_helm_nova/vars/main.yml b/roles/openstack_helm_nova/vars/main.yml
index b8658c2..f1e668b 100644
--- a/roles/openstack_helm_nova/vars/main.yml
+++ b/roles/openstack_helm_nova/vars/main.yml
@@ -12,8 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-_openstack_helm_nova_values: "{{ __openstack_helm_nova_values | combine(openstack_helm_nova_values, recursive=True) }}"
-__openstack_helm_nova_values:
+_openstack_helm_nova_helm_values:
endpoints: "{{ openstack_helm_endpoints }}"
labels:
agent: