|
107 | 107 | - _cifmw_kustomize_deploy_olm_osp_operator_sub_out.resources | length == 1 |
108 | 108 | - (_cifmw_kustomize_deploy_olm_osp_operator_sub_out.resources | first)['status']['installPlanRef'] is defined |
109 | 109 |
|
110 | | - - name: Wait for the openstack operators InstallPlan to be finish |
| 110 | + - name: Wait for the openstack operators InstallPlan to be finished |
111 | 111 | vars: |
112 | 112 | _install_plan: >- |
113 | 113 | {{ |
|
319 | 319 | status: "True" |
320 | 320 | wait_timeout: 300 |
321 | 321 |
|
322 | | -- name: Wait until OpenStack operators are deployed and ready |
323 | | - when: not cifmw_kustomize_deploy_generate_crs_only |
| 322 | +- name: Check if the OpenStack initialization CRD exists |
| 323 | + kubernetes.core.k8s_info: |
| 324 | + kubeconfig: "{{ cifmw_openshift_kubeconfig }}" |
| 325 | + api_key: "{{ cifmw_openshift_token | default(omit) }}" |
| 326 | + context: "{{ cifmw_openshift_context | default(omit) }}" |
| 327 | + kind: CustomResourceDefinition |
| 328 | + name: openstacks.operator.openstack.org |
| 329 | + register: _cifmw_kustomize_deploy_olm_osp_operator_openstack_crd_out |
| 330 | + |
| 331 | +- name: Handle OpenStack initialization, if necessary |
| 332 | + when: (_cifmw_kustomize_deploy_olm_osp_operator_openstack_crd_out.resources | length) > 0 |
| 333 | + block: |
| 334 | + - name: Generate OpenStack initialization kustomization file |
| 335 | + ansible.builtin.copy: |
| 336 | + content: >- |
| 337 | + {{ |
| 338 | + lookup( |
| 339 | + 'kubernetes.core.kustomize', |
| 340 | + dir=cifmw_kustomize_deploy_openstack_source_files |
| 341 | + ) |
| 342 | + }} |
| 343 | + dest: "{{ cifmw_kustomize_deploy_openstack_dest_file }}" |
| 344 | + mode: "0644" |
| 345 | + |
| 346 | + - name: Openstack initialization resources |
| 347 | + when: not cifmw_kustomize_deploy_generate_crs_only |
| 348 | + block: |
| 349 | + - name: Apply the kustomized OpenStack initialization CRs |
| 350 | + kubernetes.core.k8s: |
| 351 | + kubeconfig: "{{ cifmw_openshift_kubeconfig }}" |
| 352 | + api_key: "{{ cifmw_openshift_token | default(omit) }}" |
| 353 | + context: "{{ cifmw_openshift_context | default(omit) }}" |
| 354 | + state: present |
| 355 | + wait: true |
| 356 | + src: "{{ cifmw_kustomize_deploy_openstack_dest_file }}" |
| 357 | + check_mode: >- |
| 358 | + {{ |
| 359 | + cifmw_kustomize_deploy_check_mode | |
| 360 | + default(false, true) |
| 361 | + }} |
| 362 | +
|
| 363 | + - name: Wait until OpenStack operators are deployed and ready (new install paradigm) |
| 364 | + when: not cifmw_kustomize_deploy_generate_crs_only |
| 365 | + kubernetes.core.k8s_info: |
| 366 | + kubeconfig: "{{ cifmw_openshift_kubeconfig }}" |
| 367 | + kind: Openstack |
| 368 | + namespace: openstack-operators |
| 369 | + name: openstack |
| 370 | + wait: true |
| 371 | + wait_condition: |
| 372 | + type: Ready |
| 373 | + status: "True" |
| 374 | + wait_timeout: 600 |
| 375 | + check_mode: >- |
| 376 | + {{ |
| 377 | + cifmw_kustomize_deploy_check_mode | |
| 378 | + default(false, true) |
| 379 | + }} |
| 380 | +
|
| 381 | +- name: Wait until OpenStack operators are deployed and ready (old install paradigm) |
| 382 | + when: |
| 383 | + - not cifmw_kustomize_deploy_generate_crs_only |
| 384 | + - (_cifmw_kustomize_deploy_olm_osp_operator_openstack_crd_out.resources | length) == 0 |
324 | 385 | kubernetes.core.k8s_info: |
325 | 386 | kubeconfig: "{{ cifmw_openshift_kubeconfig }}" |
326 | 387 | kind: Deployment |
|
0 commit comments