-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DR-Failback errors when gathering/detecting HA VM as well as storage domains #649
Closed
shubhaOracle
wants to merge
22
commits into
oVirt:master
from
shubhaOracle:sd-detection-during-failback
Closed
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
88fab7b
DR-Failback errors when gathering/detecting HA VM as well as storage …
shubhaOracle 8fc1bb6
DR-Failback errors when gathering/detecting HA VM as well as storage …
shubhaOracle 0e9c9ec
remove trailing space
shubhaOracle 4bc7748
rebase and remove trailing space
shubhaOracle f3af909
Merge branch 'master' into sd-detection-during-failback
shubhaOracle 8fe7473
DR-Failback errors when gathering/detecting HA VM as well as storage …
shubhaOracle 542310b
remove trailing space
shubhaOracle e145fc8
DR-Failback errors when gathering/detecting HA VM as well as storage …
shubhaOracle c722a8a
rebase and remove trailing space. Update task name
shubhaOracle 4b9f968
Merge branch 'sd-detection-during-failback' of https://github.com/shu…
shubhaOracle 07636db
DR-Failback errors when gathering/detecting HA VM as well as storage …
shubhaOracle 06fbd1b
DR-Failback errors when gathering/detecting HA VM as well as storage …
shubhaOracle 155e656
Update roles/disaster_recovery/tasks/clean/remove_valid_filtered_mast…
shubhaOracle 60a9506
Update roles/disaster_recovery/tasks/clean/remove_valid_filtered_mast…
shubhaOracle 9c65be5
DR-Failback errors when gathering/detecting HA VM as well as storage …
shubhaOracle d07f5bf
DR-Failback errors when gathering/detecting HA VM as well as storage …
shubhaOracle 6749793
DR-Failback errors when gathering/detecting HA VM as well as storage …
shubhaOracle 52fb262
Update roles/disaster_recovery/tasks/clean/remove_valid_filtered_mast…
shubhaOracle e1b63c1
Update roles/disaster_recovery/tasks/clean/remove_valid_filtered_mast…
shubhaOracle 3736089
Storage domain detection was not finding any storage domains due to i…
shubhaOracle 3b07711
Storage domain detection was not finding any storage domains due to i…
shubhaOracle 86e358e
Created separate tasks for detecting domains in various states and fi…
shubhaOracle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
28 changes: 21 additions & 7 deletions
28
roles/disaster_recovery/tasks/clean/remove_valid_filtered_master_domains.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,38 @@ | ||
--- | ||
- name: Remove valid storage domain main block | ||
block: | ||
- name: Fetch active/maintenance/detached storage domain for remove | ||
- name: Fetch active storage domain for remove | ||
ovirt_storage_domain_info: | ||
pattern: > | ||
name={{ storage['dr_' + dr_source_map + '_name'] }} and | ||
datacenter={{ storage['dr_' + dr_source_map + '_dc_name'] }} and {{ dr_active_domain_search }} | ||
auth: "{{ ovirt_auth }}" | ||
register: storage_domain_info_active | ||
|
||
- name: Fetch maintenance storage domain for remove | ||
ovirt_storage_domain_info: | ||
pattern: > | ||
name={{ storage['dr_' + dr_source_map + '_name'] }} and | ||
datacenter={{ storage['dr_' + dr_source_map + '_dc_name'] }} and {{ dr_maintenance_domain_search }} | ||
auth: "{{ ovirt_auth }}" | ||
register: storage_domain_info_maintenance | ||
|
||
- name: Fetch detached storage domain for remove | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This section (lines 20-26) seems duplicate (same as lines 4-10) + wrong name? |
||
ovirt_storage_domain_info: | ||
pattern: > | ||
name={{ storage['dr_' + dr_source_map + '_name'] }} and | ||
( | ||
datacenter={{ storage['dr_' + dr_source_map + '_dc_name'] }} and {{ dr_active_domain_search }} or | ||
datacenter={{ storage['dr_' + dr_source_map + '_dc_name'] }} and {{ dr_maintenance_domain_search }} or | ||
{{ dr_unattached_domain_search }} | ||
) | ||
auth: "{{ ovirt_auth }}" | ||
register: storage_domain_info | ||
register: storage_domain_info_detached | ||
|
||
- name: Remove valid storage domain | ||
include_tasks: remove_domain_process.yml | ||
vars: | ||
sd: "{{ sd }}" | ||
with_items: | ||
- "{{ storage_domain_info.ovirt_storage_domains }}" | ||
- "{{ storage_domain_info_active.ovirt_storage_domains }}" | ||
- "{{ storage_domain_info_maintenance.ovirt_storage_domains }}" | ||
- "{{ storage_domain_info_detached.ovirt_storage_domains }}" | ||
when: (not only_master and not sd.master) or (only_master and sd.master) | ||
loop_control: | ||
loop_var: sd | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must admit I don't have a vast Ansible experience, but could some "playing" with
()
be a more simple option to fix the original code instead of splitting the code into 3 tasks with some amount of duplicate code?Not sure whether the following syntax will work:
If not then let's leave your solution with 3 separate tasks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a look at the changes. I would have preferred to have one common condition as well. However, for readability and ease of maintenance sake, I feel my new approach is much simpler. I hope that works for you as well.