|
9 | 9 | # 2. Foundation resources (Secrets, ConfigMaps, NADs) |
10 | 10 | # 3. Infrastructure CRs (OpenStackVersion, MariaDBAccount, etc.) |
11 | 11 | # 4. OpenStackControlPlane (with infrastructure-only staging) |
12 | | -# 5. GaleraBackup CRs (backup configuration) |
13 | | -# 6. Wait for infrastructure (Galera, OVN, RabbitMQ) to be ready |
| 12 | +# 5. Wait for infrastructure (Galera, OVN, RabbitMQ) to be ready |
| 13 | +# 6. GaleraBackup CRs (backup configuration) |
14 | 14 | # 7. Database restore (create GaleraRestore CRs, exec restore) |
15 | 15 | # 8. RabbitMQ credential restore (restore old secrets to temp ns, copy, create RabbitMQUser CRs) |
16 | 16 | # 9. Resume full deployment (remove staging annotation) |
|
420 | 420 | step_name: "Step 4 (ControlPlane restore)" |
421 | 421 |
|
422 | 422 | # ======================================== |
423 | | - # Step 5: Restore GaleraBackup CRs (Order 40) |
| 423 | + # Step 5: Wait for Infrastructure Ready |
424 | 424 | # ======================================== |
425 | | - - name: Render backup config restore |
426 | | - ansible.builtin.template: |
427 | | - src: "{{ playbook_dir }}/templates/05-restore-order-40-backup-config.yaml.j2" |
428 | | - dest: "{{ rendered_dir.path }}/05-restore-order-40-backup-config.yaml" |
429 | | - |
430 | | - - name: "Next: Step 5 - Restore GaleraBackup CRs" |
431 | | - ansible.builtin.debug: |
432 | | - msg: "{{ lookup('file', rendered_dir.path + '/05-restore-order-40-backup-config.yaml').splitlines() }}" |
433 | | - when: not (auto_ack | bool) |
434 | | - |
435 | | - - name: Pause after controlplane restore |
436 | | - ansible.builtin.pause: |
437 | | - prompt: >- |
438 | | - Step 4 complete: OpenStackControlPlane restored (staged). |
439 | | - Press Enter to continue, or Ctrl+C then 'A' to abort |
440 | | - when: not (auto_ack | bool) |
441 | | - |
442 | | - - name: Create backup config restore |
443 | | - ansible.builtin.shell: | |
444 | | - oc apply -f {{ rendered_dir.path }}/05-restore-order-40-backup-config.yaml |
445 | | - changed_when: true |
446 | | - |
447 | | - - name: Wait for backup config restore |
448 | | - ansible.builtin.include_tasks: |
449 | | - file: wait-for-restore.yaml |
450 | | - vars: |
451 | | - restore_name: "openstack-restore-40-backup-{{ restore_suffix }}" |
452 | | - step_name: "Step 5 (GaleraBackup restore)" |
453 | | - |
454 | | - # ======================================== |
455 | | - # Step 6: Wait for Infrastructure Ready |
456 | | - # ======================================== |
457 | | - - name: Pause after GaleraBackup restore |
458 | | - ansible.builtin.pause: |
459 | | - prompt: >- |
460 | | - Step 5 complete: GaleraBackup CRs restored. |
461 | | - Next: Step 6 - Wait for infrastructure ready (Galera, OVN, RabbitMQ, Memcached). |
462 | | - Press Enter to continue, or Ctrl+C then 'A' to abort |
463 | | - when: not (auto_ack | bool) |
464 | | - |
465 | 425 | - name: Wait for OpenStackControlPlane infrastructure ready |
466 | 426 | ansible.builtin.shell: | |
467 | 427 | oc wait openstackcontrolplane -n {{ openstack_namespace }} --all \ |
|
481 | 441 | register: galera_pod_phases |
482 | 442 | changed_when: false |
483 | 443 |
|
484 | | - - name: Print Step 6 result |
| 444 | + - name: Print Step 5 result |
485 | 445 | ansible.builtin.debug: |
486 | 446 | msg: |
487 | 447 | - "Infrastructure is ready" |
488 | 448 | - "ControlPlane: {{ ctlplane_name.stdout }}" |
489 | 449 | - "Galera pod phases: {{ galera_pod_phases.stdout }}" |
490 | 450 |
|
491 | 451 | # ======================================== |
492 | | - # Step 7: Database Restore |
| 452 | + # Step 6: Restore GaleraBackup CRs (Order 40) |
493 | 453 | # ======================================== |
| 454 | + - name: Render backup config restore |
| 455 | + ansible.builtin.template: |
| 456 | + src: "{{ playbook_dir }}/templates/05-restore-order-40-backup-config.yaml.j2" |
| 457 | + dest: "{{ rendered_dir.path }}/05-restore-order-40-backup-config.yaml" |
| 458 | + |
| 459 | + - name: "Next: Step 6 - Restore GaleraBackup CRs" |
| 460 | + ansible.builtin.debug: |
| 461 | + msg: "{{ lookup('file', rendered_dir.path + '/05-restore-order-40-backup-config.yaml').splitlines() }}" |
| 462 | + when: not (auto_ack | bool) |
| 463 | + |
494 | 464 | - name: Pause after infrastructure ready |
495 | 465 | ansible.builtin.pause: |
496 | 466 | prompt: >- |
497 | | - Step 6 complete: Infrastructure is ready (Galera, OVN, RabbitMQ, Memcached). |
| 467 | + Step 5 complete: Infrastructure is ready (Galera, OVN, RabbitMQ, Memcached). |
| 468 | + Press Enter to continue, or Ctrl+C then 'A' to abort |
| 469 | + when: not (auto_ack | bool) |
| 470 | + |
| 471 | + - name: Create backup config restore |
| 472 | + ansible.builtin.shell: | |
| 473 | + oc apply -f {{ rendered_dir.path }}/05-restore-order-40-backup-config.yaml |
| 474 | + changed_when: true |
| 475 | + |
| 476 | + - name: Wait for backup config restore |
| 477 | + ansible.builtin.include_tasks: |
| 478 | + file: wait-for-restore.yaml |
| 479 | + vars: |
| 480 | + restore_name: "openstack-restore-40-backup-{{ restore_suffix }}" |
| 481 | + step_name: "Step 6 (GaleraBackup restore)" |
| 482 | + |
| 483 | + # ======================================== |
| 484 | + # Step 7: Database Restore |
| 485 | + # ======================================== |
| 486 | + - name: Pause after GaleraBackup restore |
| 487 | + ansible.builtin.pause: |
| 488 | + prompt: >- |
| 489 | + Step 6 complete: GaleraBackup CRs restored. |
498 | 490 | Next: Step 7 - Database restore (GaleraRestore). |
499 | 491 | Press Enter to continue, or Ctrl+C then 'A' to abort |
500 | 492 | when: not (auto_ack | bool) |
|
673 | 665 | loop: "{{ rabbitmq_clusters }}" |
674 | 666 | changed_when: true |
675 | 667 |
|
| 668 | + - name: Wait for RabbitMQUser CRs to be ready |
| 669 | + ansible.builtin.shell: | |
| 670 | + oc wait rabbitmquser --all -n {{ openstack_namespace }} --for=jsonpath='{.status.conditions[0].status}'=True --timeout=120s |
| 671 | + changed_when: false |
| 672 | + failed_when: false |
| 673 | + |
| 674 | + - name: Get RabbitMQUser status |
| 675 | + ansible.builtin.shell: | |
| 676 | + oc get rabbitmquser -n {{ openstack_namespace }} |
| 677 | + register: rabbitmquser_status |
| 678 | + changed_when: false |
| 679 | + |
676 | 680 | - name: Print Step 8 result |
677 | 681 | ansible.builtin.debug: |
678 | | - msg: "RabbitMQ user credentials restored" |
| 682 | + msg: "{{ rabbitmquser_status.stdout_lines }}" |
679 | 683 |
|
680 | 684 | # ======================================== |
681 | 685 | # Step 9: Resume Full Deployment |
|
688 | 692 | Press Enter to continue, or Ctrl+C then 'A' to abort |
689 | 693 | when: not (auto_ack | bool) |
690 | 694 |
|
| 695 | + - name: Print annotation removal command |
| 696 | + ansible.builtin.debug: |
| 697 | + msg: "oc annotate openstackcontrolplane {{ ctlplane_name.stdout }} -n {{ openstack_namespace }} core.openstack.org/deployment-stage-" |
| 698 | + |
691 | 699 | - name: Remove deployment-stage annotation |
692 | 700 | ansible.builtin.shell: | |
693 | 701 | oc annotate openstackcontrolplane {{ ctlplane_name.stdout }} \ |
|
0 commit comments