From 231fe947275e5c18d09364c400c20cb213bae708 Mon Sep 17 00:00:00 2001 From: Kamil Sambor Date: Fri, 5 Jul 2024 11:34:32 +0200 Subject: [PATCH] Modify job to use metadata per cell --- .../ci_fw_vars.yaml | 8 +++ .../pre_deploy_control_plane_hook.yml | 50 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 ci/nova-operator-tempest-multinode/pre_deploy_control_plane_hook.yml diff --git a/ci/nova-operator-tempest-multinode/ci_fw_vars.yaml b/ci/nova-operator-tempest-multinode/ci_fw_vars.yaml index 4deea9704..537cc51a1 100644 --- a/ci/nova-operator-tempest-multinode/ci_fw_vars.yaml +++ b/ci/nova-operator-tempest-multinode/ci_fw_vars.yaml @@ -9,6 +9,14 @@ cifmw_cls_pv_count: 20 cifmw_services_swift_enabled: false +pre_deploy: + - name: 61 HCI pre deploy kustomizations + type: playbook + source: control_plane_hci_pre_deploy.yml + - name: 62 Kustomize ControlPlane + type: playbook + source: pre_deploy_control_plane_hook.yml + # note by default the source for the playbook specified # in the hooks is relative to # https://github.com/openstack-k8s-operators/ci-framework/tree/main/hooks/playbooks diff --git a/ci/nova-operator-tempest-multinode/pre_deploy_control_plane_hook.yml b/ci/nova-operator-tempest-multinode/pre_deploy_control_plane_hook.yml new file mode 100644 index 000000000..5118b360e --- /dev/null +++ b/ci/nova-operator-tempest-multinode/pre_deploy_control_plane_hook.yml @@ -0,0 +1,50 @@ +--- +- name: Kustomize ControlPlane + hosts: "{{ cifmw_target_hook_host | default('localhost') }}" + gather_facts: false + tasks: + - name: Ensure the kustomizations dir exists + ansible.builtin.file: + path: "{{ cifmw_basedir }}/artifacts/manifests/kustomizations/controlplane" + state: directory + + - name: Create kustomization + ansible.builtin.copy: + dest: "{{ cifmw_basedir }}/artifacts/manifests/kustomizations/controlplane/71-controlplane-kustomization.yaml" + content: |- + apiVersion: kustomize.config.k8s.io/v1beta1 + kind: Kustomization + resources: + namespace: {{ cifmw_install_yamls_defaults['NAMESPACE'] }} + patches: + - target: + kind: OpenStackControlPlane + patch: |- + - op: add + path: /spec/nova/template/cellTemplates + value: + cell0: + cellDatabaseAccount: nova-cell0 + hasAPIAccess: true + metadataServiceTemplate: + enabled: false + cell1: + cellDatabaseAccount: nova-cell1 + hasAPIAccess: true + cellMessageBusInstance: rabbitmq-cell1 + cellDatabaseInstance: openstack-cell1 + metadataServiceTemplate: + enabled: true + override: + service: + metadata: + annotations: + metallb.universe.tf/address-pool: internalapi + metallb.universe.tf/allow-shared-ip: internalapi + metallb.universe.tf/loadBalancerIPs: 172.17.0.80 + spec: + type: LoadBalancer + + - op: add + path: /spec/nova/template/metadataServiceTemplate/enabled + value: false