Skip to content

Commit 3994109

Browse files
stuggiclaude
andcommitted
[b/r] Pretty print rendered templates in restore playbook
Add .splitlines() to all lookup('file', ...) calls so Ansible debug renders YAML templates line-by-line instead of as escaped strings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent aa352f5 commit 3994109

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

docs/dev/backup-restore/restore/restore-openstack.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140

141141
- name: "Next: Create resource modifier ConfigMap"
142142
ansible.builtin.debug:
143-
msg: "{{ lookup('file', rendered_dir.path + '/00-resource-modifiers-configmap.yaml') }}"
143+
msg: "{{ lookup('file', rendered_dir.path + '/00-resource-modifiers-configmap.yaml').splitlines() }}"
144144
when: not (auto_ack | bool)
145145

146146
- name: Pause before creating resource modifier ConfigMap
@@ -271,7 +271,7 @@
271271

272272
- name: "Next: Step 1 - Restore PVCs (CSI Snapshots)"
273273
ansible.builtin.debug:
274-
msg: "{{ lookup('file', rendered_dir.path + '/01-restore-order-00-pvcs.yaml') }}"
274+
msg: "{{ lookup('file', rendered_dir.path + '/01-restore-order-00-pvcs.yaml').splitlines() }}"
275275
when: not (auto_ack | bool)
276276

277277
- name: Pause before PVC restore
@@ -319,7 +319,7 @@
319319

320320
- name: "Next: Step 2 - Restore foundation resources (Secrets, ConfigMaps, NADs)"
321321
ansible.builtin.debug:
322-
msg: "{{ lookup('file', rendered_dir.path + '/02-restore-order-10-foundation.yaml') }}"
322+
msg: "{{ lookup('file', rendered_dir.path + '/02-restore-order-10-foundation.yaml').splitlines() }}"
323323
when: not (auto_ack | bool)
324324

325325
- name: Pause after PVC restore
@@ -351,7 +351,7 @@
351351

352352
- name: "Next: Step 3 - Restore infrastructure CRs (OpenStackVersion, MariaDBAccount, etc.)"
353353
ansible.builtin.debug:
354-
msg: "{{ lookup('file', rendered_dir.path + '/03-restore-order-20-infrastructure.yaml') }}"
354+
msg: "{{ lookup('file', rendered_dir.path + '/03-restore-order-20-infrastructure.yaml').splitlines() }}"
355355
when: not (auto_ack | bool)
356356

357357
- name: Pause after foundation restore
@@ -383,7 +383,7 @@
383383

384384
- name: "Next: Step 4 - Restore OpenStackControlPlane (staged, infrastructure-only)"
385385
ansible.builtin.debug:
386-
msg: "{{ lookup('file', rendered_dir.path + '/04-restore-order-30-controlplane.yaml') }}"
386+
msg: "{{ lookup('file', rendered_dir.path + '/04-restore-order-30-controlplane.yaml').splitlines() }}"
387387
when: not (auto_ack | bool)
388388

389389
- name: Pause after infrastructure restore
@@ -415,7 +415,7 @@
415415

416416
- name: "Next: Step 5 - Restore GaleraBackup CRs"
417417
ansible.builtin.debug:
418-
msg: "{{ lookup('file', rendered_dir.path + '/05-restore-order-40-backup-config.yaml') }}"
418+
msg: "{{ lookup('file', rendered_dir.path + '/05-restore-order-40-backup-config.yaml').splitlines() }}"
419419
when: not (auto_ack | bool)
420420

421421
- name: Pause after controlplane restore
@@ -559,9 +559,9 @@
559559
- name: "Next: Step 8 - Restore RabbitMQ user credentials"
560560
ansible.builtin.debug:
561561
msg:
562-
- "{{ lookup('file', rendered_dir.path + '/06b-resource-modifiers-tmp.yaml') }}"
562+
- "{{ lookup('file', rendered_dir.path + '/06b-resource-modifiers-tmp.yaml').splitlines() }}"
563563
- "---"
564-
- "{{ lookup('file', rendered_dir.path + '/06b-restore-rabbitmq-secrets.yaml') }}"
564+
- "{{ lookup('file', rendered_dir.path + '/06b-restore-rabbitmq-secrets.yaml').splitlines() }}"
565565
when: not (auto_ack | bool)
566566

567567
- name: Pause after database restore
@@ -702,7 +702,7 @@
702702

703703
- name: "Next: Step 10 - Restore DataPlane resources"
704704
ansible.builtin.debug:
705-
msg: "{{ lookup('file', rendered_dir.path + '/07-restore-order-60-dataplane.yaml') }}"
705+
msg: "{{ lookup('file', rendered_dir.path + '/07-restore-order-60-dataplane.yaml').splitlines() }}"
706706
when: not (auto_ack | bool)
707707

708708
- name: Pause after full deployment ready
@@ -746,7 +746,7 @@
746746

747747
- name: "Next: Step 11 - Run EDPM deployment to resync credentials on dataplane nodes"
748748
ansible.builtin.debug:
749-
msg: "{{ lookup('file', rendered_dir.path + '/08-edpm-deployment.yaml') }}"
749+
msg: "{{ lookup('file', rendered_dir.path + '/08-edpm-deployment.yaml').splitlines() }}"
750750
when: not (auto_ack | bool) and nodeset_names.stdout != ""
751751

752752
- name: Pause before EDPM deployment

0 commit comments

Comments
 (0)