|
12 | 12 | failed_when: existing_oracle_home.rc > 1
|
13 | 13 | changed_when: false
|
14 | 14 |
|
15 |
| -- name: Seach Output For Oracle Home Name |
| 15 | +- name: Search Output For Oracle Home Name |
16 | 16 | set_fact:
|
17 | 17 | oracle_home_name: "{{ item }}"
|
18 | 18 | loop: "{{ existing_oracle_home.stdout_lines }}"
|
19 | 19 | when: item is search(agent_host)
|
20 | 20 |
|
21 |
| -- debug: var=oracle_home_name |
22 |
| - |
23 |
| -# # This block will run if the Deinstalled Oracle Home Target still exists |
24 |
| -# - name: Delete Deinstalled Oracle Home Target |
25 |
| -# block: |
26 |
| -# - name: Delete Target from Repository |
27 |
| -# shell: | |
28 |
| -# . {{ stage }}/emcli_login.sh |
29 |
| -# {{ emcli }} delete_target -name="{{ oracle_home_name }}" -type="oracle_home" |
30 |
| - |
31 |
| -# # Pause Until OEM has Finished Deleting the Target |
32 |
| -# # (Otherwise it will fail when we try to add the new target) |
33 |
| -# - name: Wait for Existing Target Deletion |
34 |
| -# script: ../../update_oem/files/wait_for_target_deletion.sh {{ existing_oracle_home.stdout }} |
35 |
| -# changed_when: false |
| 21 | +# This block will run if the Deinstalled Oracle Home Target still exists |
| 22 | +- name: Delete Target from Repository |
| 23 | + shell: | |
| 24 | + . {{ stage }}/emcli_login.sh |
| 25 | + {{ emcli }} delete_target -name="{{ oracle_home_name }}" -type="oracle_home" |
| 26 | + when: existing_oracle_home.rc == 0 and oracle_home_name is defined |
36 | 27 |
|
37 |
| -# when: existing_oracle_home.rc == 0 |
| 28 | +# Pause Until OEM has Finished Deleting the Target |
| 29 | +# (Otherwise it will fail when we try to add the new target) |
| 30 | +- name: Get Target From Repository |
| 31 | + shell: | |
| 32 | + . {{ stage }}/emcli_login.sh |
| 33 | + {{ emcli }} get_targets -targets="{{ oracle_home_name }}:oracle_home" -script -noheader | awk '{print $NF}' |
| 34 | + register: delete_target_monitor |
| 35 | + until: delete_target_monitor.stdout_lines is not search(oracle_home_name) |
| 36 | + delay: 60 |
| 37 | + retries: 10 |
| 38 | + when: oracle_home_name is defined |
0 commit comments