-
-
Notifications
You must be signed in to change notification settings - Fork 150
[ansible-openwisp2] Upgrade pip deps from requirements on rerun #575
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
base: master
Are you sure you want to change the base?
[ansible-openwisp2] Upgrade pip deps from requirements on rerun #575
Conversation
|
@pandafy PTAL |
pandafy
left a comment
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.
Good start @Piyushrathoree!
I am afraid that --upgrade might not always work when we use tarball URL as source. E.g. when we set openwisp-controller version in the ansible playbook
openwisp2_controller_version: openwisp-controller @ https://github.com/openwisp/openwisp-controller/tarball/masterIn such scenarios, we would need to use state: forcereinstall.
Using forcereinstall by default will slow down the playbook, since it will make pip reinstall packages even when the latest package have been installed.
I can think of exposing pip.extra_args argument through ansible variable openwisp2_pip_extra_args. The default value for this argument will be openwisp2_pip_extra_args: "--upgrade". When needed, the user can override the variable in the playbook to use `openwisp2_pip_extra_args: "--upgrade --force-reinstall" which will force-reinstall the packages.
We will need to add this new variable in https://github.com/openwisp/ansible-openwisp2/blob/master/docs/user/role-variables.rst, and explain the usage with a comment. You can take reference from other settings mentioned in the file.
value --upgrade and can be overridden with --upgrade --force-reinstall
This reverts commit 98367c9.
015e499 to
73ed71d
Compare
thanks @pandafy |
| # Extra arguments passed to pip when reinstalling Python packages with --force-reinstall | ||
| # By default, packages are upgraded on each playbook run. | ||
| # Can be overridden, for example: | ||
| # openwisp2_pip_extra_args: "--upgrade --force-reinstall" |
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.
| # Extra arguments passed to pip when reinstalling Python packages with --force-reinstall | |
| # By default, packages are upgraded on each playbook run. | |
| # Can be overridden, for example: | |
| # openwisp2_pip_extra_args: "--upgrade --force-reinstall" | |
| # Extra arguments passed to pip when installing Python packages. | |
| # By default, packages are upgraded on each playbook run. | |
| # Can be overridden, for example: | |
| # openwisp2_pip_extra_args: "--upgrade --force-reinstall" |
Checklist
Reference to Existing Issue
Closes #572
Description of Changes
update the pip.yml file with extra-args:"--upgrade" which make sure that every dependency is updated.