Skip to content
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

ovirt_remove_stale_lun: Use add_host instead of delegate_to #390

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

nijinashok
Copy link
Contributor

As of now, we are using delegate_to using with_items to run the tasks in multiple hosts. This has got several problems:

  • Ansible considers tasks for all the hosts as single task since we are iterating over host_info using with_items to run it on multiple hosts. So if any of the tasks fails in any of the hosts, it stops the execution of the subsequent tasks on all other hosts. For example, if multipath -f fails on any hosts, it won't run the task for removing the SCSI device even for the hosts where it was able to remove the device from multipath successfully.

  • Each task is executed serially on the discovered hosts in DC because with_items unpacks serially.

  • It's very difficult to understand which host it got failed, and "PLAY RECAP" is not useful.

Using add_host automatically solves the above problems.

@ovirt-infra
Copy link

Hello contributor, thanks for submitting a PR for this project!

I am the bot who triggers "standard-CI" builds for this project.
As a security measure, I will not run automated tests on PRs that are not from white-listed contributors.

In order to allow automated tests to run, please ask one of the project maintainers to review the code and then do one of the following:

  1. Type ci test please on this PR to trigger automated tests for it.
  2. Type ci add to whitelist on this PR to trigger automated tests for it and also add you to the contributor white-list so that your future PRs will be tested automatically. ( keep in mind this list might be overwritten if the job XML is refreshed, for permanent whitelisting, please follow ovirt dynamic plugin improvements #3 option )
  3. If you are planning to contribute to more than one project, maybe it's better to ask them to add you to the project organization, so you'll be able to run tests for all the organization's projects.

@nijinashok nijinashok force-pushed the master branch 2 times, most recently from 2b573e7 to 8ef61e9 Compare November 24, 2021 13:32
@mwperina mwperina requested review from vjuranek and mnecas November 24, 2021 13:34
@mwperina
Copy link
Member

ci add to whitelist

Copy link
Member

@vjuranek vjuranek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, definitely more efficient and nicer solution! LGTM, it doesn't change functionality what it does on hosts, this is mainly Ansible related change. That being said, Martin's review is much more relevant here than mine.

Using add_host has got several benefits:
- Parallel execution of tasks in the discovered hosts.
- Failure in one host doesn't affect the task execution in others.
- Ansible gives more understandable summary.
Copy link
Member

@mnecas mnecas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mnecas mnecas merged commit a598e77 into oVirt:master Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants