-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 'ansible-lint' violations for 'disaster_recovery' role (part 1 - …
…'yamllint' warnings) (#543) * Update "automation/build.sh" to ignore specific errors. Add specific per-type exclusions that will allow commit after commit, PR after PR progressing: - var-spacing - unnamed-task - fqcn-builtins - no-changed-when - risky-shell-pipe - ignore-errors This PR is going to handle yamllint violations, so not adding "yaml" to the exclusions list. The follow-up commits will fix "yaml" violations till PR is green. Signed-off-by: Pavel Bar <[email protected]> Bug-Url: https://bugzilla.redhat.com/2097332 * Fix violations reported by "yamllint" (boolean values). All boolean values should be lowercase. Fixing 13 violations: yaml: truthy value should be one of [false, true] (yaml[truthy]) Signed-off-by: Pavel Bar <[email protected]> Bug-Url: https://bugzilla.redhat.com/2097332 * Fix violations reported by "yamllint" (spaces after colon). Only 1 space should appear after colon. Fixing 6 violations: yaml: too many spaces after colon (yaml[colons]) Signed-off-by: Pavel Bar <[email protected]> Bug-Url: https://bugzilla.redhat.com/2097332 * Fix violations reported by "yamllint" (wrong indentation). Fixing 141 indentation violations similar to: yaml: wrong indentation: expected 8 but found 10 (yaml[indentation]) Signed-off-by: Pavel Bar <[email protected]> Bug-Url: https://bugzilla.redhat.com/2097332
- Loading branch information
Showing
32 changed files
with
417 additions
and
413 deletions.
There are no files selected for viewing
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
3 changes: 3 additions & 0 deletions
3
changelogs/fragments/543-fix-ansible-lint-for_disaster_recovery.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
minor_changes: | ||
- Fix "ansible-lint" version 6.0.0 "yaml" violations for "disaster_recovery" role (https://github.com/oVirt/ovirt-ansible-collection/pull/543). |
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
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 |
---|---|---|
|
@@ -8,4 +8,4 @@ | |
roles: | ||
- disaster_recovery | ||
collections: | ||
- @NAMESPACE@.@NAME@ | ||
- @NAMESPACE@.@NAME@ |
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 |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
roles: | ||
- disaster_recovery | ||
collections: | ||
- @NAMESPACE@.@NAME@ | ||
- @NAMESPACE@.@NAME@ |
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,10 +1,10 @@ | ||
- block: | ||
- name: Remove disk | ||
ovirt_disk: | ||
state: absent | ||
id: "{{ disk.id }}" | ||
auth: "{{ ovirt_auth }}" | ||
state: absent | ||
id: "{{ disk.id }}" | ||
auth: "{{ ovirt_auth }}" | ||
ignore_errors: "{{ dr_ignore_error_clean }}" | ||
tags: | ||
- fail_back | ||
- clean_engine | ||
- fail_back | ||
- clean_engine |
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
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
14 changes: 7 additions & 7 deletions
14
roles/disaster_recovery/tasks/clean/remove_invalid_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,20 +1,20 @@ | ||
- block: | ||
- name: Fetch invalid storage domain for remove | ||
ovirt_storage_domain_info: | ||
pattern: name={{ storage['dr_' + dr_source_map + '_name'] }} and {{ dr_inactive_domain_search }} | ||
auth: "{{ ovirt_auth }}" | ||
pattern: name={{ storage['dr_' + dr_source_map + '_name'] }} and {{ dr_inactive_domain_search }} | ||
auth: "{{ ovirt_auth }}" | ||
register: storage_domain_info | ||
|
||
- name: Remove invalid storage domain | ||
include_tasks: remove_domain_process.yml | ||
vars: | ||
sd: "{{ sd }}" | ||
sd: "{{ sd }}" | ||
with_items: | ||
- "{{ storage_domain_info.ovirt_storage_domains }}" | ||
- "{{ storage_domain_info.ovirt_storage_domains }}" | ||
when: (not only_master and not sd.master) or (only_master and sd.master) | ||
loop_control: | ||
loop_var: sd | ||
loop_var: sd | ||
ignore_errors: "{{ dr_ignore_error_clean }}" | ||
tags: | ||
- fail_back | ||
- clean_engine | ||
- fail_back | ||
- clean_engine |
26 changes: 13 additions & 13 deletions
26
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,26 +1,26 @@ | ||
- block: | ||
- name: Fetch active/maintenance/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 }}" | ||
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 | ||
|
||
- name: Remove valid storage domain | ||
include_tasks: remove_domain_process.yml | ||
vars: | ||
sd: "{{ sd }}" | ||
sd: "{{ sd }}" | ||
with_items: | ||
- "{{ storage_domain_info.ovirt_storage_domains }}" | ||
- "{{ storage_domain_info.ovirt_storage_domains }}" | ||
when: (not only_master and not sd.master) or (only_master and sd.master) | ||
loop_control: | ||
loop_var: sd | ||
loop_var: sd | ||
ignore_errors: "{{ dr_ignore_error_clean }}" | ||
tags: | ||
- fail_back | ||
- clean_engine | ||
- fail_back | ||
- clean_engine |
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,10 +1,10 @@ | ||
- block: | ||
- name: Remove diskless VMs | ||
ovirt_vm: | ||
state: absent | ||
name: "{{ vm.name }}" | ||
auth: "{{ ovirt_auth }}" | ||
state: absent | ||
name: "{{ vm.name }}" | ||
auth: "{{ ovirt_auth }}" | ||
ignore_errors: "{{ dr_ignore_error_clean }}" | ||
tags: | ||
- fail_back | ||
- clean_engine | ||
- fail_back | ||
- clean_engine |
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,12 +1,12 @@ | ||
- block: | ||
- name: Shutdown VM | ||
ovirt_vm: | ||
state: stopped | ||
name: "{{ vms.name }}" | ||
force: True | ||
wait: True | ||
auth: "{{ ovirt_auth }}" | ||
state: stopped | ||
name: "{{ vms.name }}" | ||
force: true | ||
wait: true | ||
auth: "{{ ovirt_auth }}" | ||
ignore_errors: "{{ dr_ignore_error_clean }}" | ||
tags: | ||
- fail_back | ||
- clean_engine | ||
- fail_back | ||
- clean_engine |
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
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,18 +1,18 @@ | ||
- block: | ||
- name: Fetch storage domain only if active | ||
ovirt_storage_domain_info: | ||
pattern: status = active and storage.name={{ storage['dr_' + dr_source_map + '_name'] }} | ||
auth: "{{ ovirt_auth }}" | ||
pattern: status = active and storage.name={{ storage['dr_' + dr_source_map + '_name'] }} | ||
auth: "{{ ovirt_auth }}" | ||
register: storage_domain_info | ||
|
||
- name: Update OVF store for active storage domain | ||
ovirt_storage_domain: | ||
state: update_ovf_store | ||
name: "{{ iscsi_storage['dr_' + dr_source_map + '_name'] }}" | ||
auth: "{{ ovirt_auth }}" | ||
state: update_ovf_store | ||
name: "{{ iscsi_storage['dr_' + dr_source_map + '_name'] }}" | ||
auth: "{{ ovirt_auth }}" | ||
with_items: | ||
- "{{ storage_domain_info.ovirt_storage_domains }}" | ||
ignore_errors: "{{ dr_ignore_error_clean }}" | ||
tags: | ||
- fail_back | ||
- clean_engine | ||
- fail_back | ||
- clean_engine |
Oops, something went wrong.