-
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
ovirt_remove_stale_lun: Use add_host instead of delegate_to #390
Conversation
Hello contributor, thanks for submitting a PR for this project! I am the bot who triggers "standard-CI" builds for this project. 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:
|
2b573e7
to
8ef61e9
Compare
ci add to whitelist |
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.
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.
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.
LGTM
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.