|
83 | 83 | - name: Block connections to Delius primary database
|
84 | 84 | import_playbook: ../block_sessions/playbook.yml
|
85 | 85 | vars:
|
86 |
| - target_host: "{{ target_dbs.split(',') | select('search', '.*delius_primarydb') | first }}" |
| 86 | + target_host: "{{ target_dbs.split(',') | select('match','.*delius_dbs') | first | replace('dbs','primarydb') }}" |
87 | 87 | database: { "delius": { "high_availability_count": 0 } }
|
88 | 88 | action: block
|
89 | 89 | when:
|
|
198 | 198 |
|
199 | 199 | when: (restore_date_time | default() | length > 0) and database_primary_sid is defined
|
200 | 200 |
|
201 |
| - - name: Get environment name and application name |
202 |
| - set_fact: |
203 |
| - environment_name: "{{ hostvars[inventory_hostname].group_names[2] | replace(hostvars[inventory_hostname].group_names[2].split('_')[-1],'') }}" |
204 |
| - application_name: "{{ hostvars[inventory_hostname].group_names[3].split('_')[-2] }}" |
205 |
| - |
206 | 201 | - name: Create Oracle Standby Restore Points
|
207 | 202 | script: create_standby_restore_points.sh
|
208 | 203 | when: database_standby_sid is defined
|
209 | 204 | environment:
|
210 | 205 | RESTORE_POINT_NAME: "{{ uplift_restore_point_name | default(restore_point_name) | upper }}"
|
211 |
| - SCN: "{{ hostvars[groups[environment_name + application_name + '_primarydb'][0]]['scn'] | default('0') }}" |
| 206 | + SCN: "{{ hostvars[groups[hostvars[inventory_hostname].group_names | select('match','.*_dbs') | first | replace('dbs','primarydb')][0]]['scn'] | default('0') }}" |
212 | 207 |
|
213 | 208 | - name: Create Oracle Primary Restore Points
|
214 | 209 | script: create_primary_restore_points.sh
|
|
306 | 301 | - name: Unblock connections to Delius primary database
|
307 | 302 | import_playbook: ../block_sessions/playbook.yml
|
308 | 303 | vars:
|
309 |
| - target_host: "{{ target_dbs.split(',') | select('search', '.*delius_primarydb') | first }}" |
| 304 | + target_host: "{{ target_dbs.split(',') | select('match','.*delius_dbs') | first | replace('dbs','primarydb') }}" |
310 | 305 | database: { "delius": { "high_availability_count": 0 } }
|
311 | 306 | action: unblock
|
312 | 307 | ignore_flashback: true
|
|
0 commit comments