Skip to content

Commit

Permalink
Support new OpenStack initialization resource for RHOSO install
Browse files Browse the repository at this point in the history
  • Loading branch information
abays committed Nov 20, 2024
1 parent 231ddc0 commit 7354baa
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 9 deletions.
18 changes: 18 additions & 0 deletions roles/kustomize_deploy/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,24 @@ cifmw_kustomize_deploy_nmstate_dest_file: >-
] | path_join
}}
# openstack init resource
cifmw_kustomize_deploy_openstack_source_files: >-
{{
[
cifmw_kustomize_deploy_architecture_repo_dest_dir,
cifmw_kustomize_deploy_architecture_examples_common_path,
'openstack'
] | path_join
}}
cifmw_kustomize_deploy_openstack_dest_file: >-
{{
[
cifmw_kustomize_deploy_kustomizations_dest_dir,
'openstack.yaml'
] | path_join
}}
# controlsplane resources

cifmw_kustomize_deploy_nncp_source_files: >-
Expand Down
41 changes: 32 additions & 9 deletions roles/kustomize_deploy/tasks/install_operators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -319,26 +319,49 @@
status: "True"
wait_timeout: 300

- name: Generate OpenStack initialization kustomization file
ansible.builtin.copy:
content: >-
{{
lookup(
'kubernetes.core.kustomize',
dir=cifmw_kustomize_deploy_openstack_source_files
)
}}
dest: "{{ cifmw_kustomize_deploy_openstack_dest_file }}"
mode: "0644"

- name: Openstack initialization resources
when: not cifmw_kustomize_deploy_generate_crs_only
block:
- name: Apply the kustomized OpenStack initialization CRs
kubernetes.core.k8s:
kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
api_key: "{{ cifmw_openshift_token | default(omit) }}"
context: "{{ cifmw_openshift_context | default(omit) }}"
state: present
wait: true
src: "{{ cifmw_kustomize_deploy_openstack_dest_file }}"
check_mode: >-
{{
cifmw_kustomize_deploy_check_mode |
default(false, true)
}}
- name: Wait until OpenStack operators are deployed and ready
when: not cifmw_kustomize_deploy_generate_crs_only
kubernetes.core.k8s_info:
kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
kind: Deployment
kind: Openstack
namespace: openstack-operators
label_selectors:
- "{{ item }}"
name: openstack
wait: true
wait_condition:
type: Available
type: Ready
status: "True"
wait_timeout: 600
check_mode: >-
{{
cifmw_kustomize_deploy_check_mode |
default(false, true)
}}
with_items:
- openstack.org/operator-name
# The RabbitMQ operator does not share our openstack.org/operator-name label
# and must be checked independently
- app.kubernetes.io/name=rabbitmq-cluster-operator

0 comments on commit 7354baa

Please sign in to comment.