-
Notifications
You must be signed in to change notification settings - Fork 92
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
Changes from 10 commits
88fab7b
8fc1bb6
0e9c9ec
4bc7748
f3af909
8fe7473
542310b
e145fc8
c722a8a
4b9f968
07636db
06fbd1b
155e656
60a9506
9c65be5
d07f5bf
6749793
52fb262
e1b63c1
3736089
3b07711
86e358e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,54 @@ | ||
--- | ||
- 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: > | ||
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. I must admit I don't have a vast Ansible experience, but could some "playing" with
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 commentThe 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. |
||
name={{ storage['dr_' + dr_source_map + '_name'] }} and | ||
shubhaOracle marked this conversation as resolved.
Show resolved
Hide resolved
|
||
datacenter={{ storage['dr_' + dr_source_map + '_dc_name'] }} and {{ dr_active_domain_search }} | ||
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. Please fix 2 trailing spaces that cause 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. Updated. 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.
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.
Thanks for the feedback and review!! |
||
auth: "{{ ovirt_auth }}" | ||
register: storage_domain_info_active | ||
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.
|
||
|
||
- name: Fetch maintenance 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 28-34) seems duplicate (same as lines 12-18)? |
||
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 | ||
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 | ||
|
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.
1 small indentation fix: move 1 character to the left.