From 98367c99b58f945640ddffef14a99d63437a1df5 Mon Sep 17 00:00:00 2001 From: PIYUSH RATHORE <163632958+Piyushrathoree@users.noreply.github.com> Date: Thu, 4 Dec 2025 17:54:15 +0000 Subject: [PATCH 1/4] upgraded --upgrade with variable with default value --upgrade and can be overridden with --upgrade --force-reinstall --- defaults/main.yml | 2 ++ docs/user/role-variables.rst | 5 +++++ tasks/pip.yml | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index ea55373d..fa002fed 100755 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -234,3 +234,5 @@ openwisp2_radius_periodic_tasks: true openwisp2_usage_metric_collection_periodic_tasks: true # point {{ inventory_name }} to localhost in /etc/hosts openwisp2_inventory_hostname_localhost: true +# variable for default deps upgrade +openwisp2_pip_extra_args: "--upgrade" \ No newline at end of file diff --git a/docs/user/role-variables.rst b/docs/user/role-variables.rst index 7141b00b..f3b831e3 100644 --- a/docs/user/role-variables.rst +++ b/docs/user/role-variables.rst @@ -31,6 +31,11 @@ take a look at `the default values of these variables openwisp2_monitoring_version: "openwisp-monitoring~=1.0.0" openwisp2_radius_version: "openwisp-radius~=1.0.0" openwisp2_django_version: "django~=3.2.13" + # Extra arguments passed to pip when reinstalling python package with --force-reinstall + # By default, packages are upgraded on each playbook run. + # Can be overridden, for example: + # openwisp2_pip_extra_args: "--upgrade --force-reinstall" + openwisp2_pip_extra_args: "--upgrade" # Setting this to true will enable subnet division feature of # openwisp-controller. Refer openwisp-controller documentation # for more information. https://github.com/openwisp/openwisp-controller#subnet-division-app diff --git a/tasks/pip.yml b/tasks/pip.yml index 2038e4e8..31d3f757 100644 --- a/tasks/pip.yml +++ b/tasks/pip.yml @@ -43,6 +43,7 @@ requirements: "{{ openwisp2_path }}/requirements.txt" virtualenv: "{{ virtualenv_path }}" virtualenv_python: "{{ openwisp2_python }}" + extra_args: "{{ openwisp2_pip_extra_args }}" notify: Reload application retries: 5 delay: 10 @@ -122,6 +123,7 @@ requirements: "{{ openwisp2_path }}/requirements-cors-headers.txt" virtualenv: "{{ virtualenv_path }}" virtualenv_python: "{{ openwisp2_python }}" + extra_args: "{{ openwisp2_pip_extra_args }}" when: openwisp2_django_cors.get('enabled') retries: 5 delay: 10 @@ -153,6 +155,7 @@ requirements: "{{ openwisp2_path }}/requirements-postgresql.txt" virtualenv: "{{ virtualenv_path }}" virtualenv_python: "{{ openwisp2_python }}" + extra_args: "{{ openwisp2_pip_extra_args }}" when: openwisp2_database.engine in ["django.db.backends.postgresql", "django.contrib.gis.db.backends.postgis"] retries: 5 delay: 10 @@ -171,6 +174,7 @@ requirements: "{{ openwisp2_path }}/requirements-mysql.txt" virtualenv: "{{ virtualenv_path }}" virtualenv_python: "{{ openwisp2_python }}" + extra_args: "{{ openwisp2_pip_extra_args }}" when: openwisp2_database.engine in ["django.db.backends.mysql", "django.contrib.gis.db.backends.mysql"] retries: 5 delay: 10 @@ -210,6 +214,7 @@ requirements: "{{ openwisp2_path }}/requirements-celery-email.txt" virtualenv: "{{ virtualenv_path }}" virtualenv_python: "{{ openwisp2_python }}" + extra_args: "{{ openwisp2_pip_extra_args }}" when: openwisp2_email_backend == "djcelery_email.backends.CeleryEmailBackend" notify: Reload application retries: 5 From 73ed71d120133eb6da060a2d24277bf9bdaab5c7 Mon Sep 17 00:00:00 2001 From: PIYUSH RATHORE <163632958+Piyushrathoree@users.noreply.github.com> Date: Wed, 10 Dec 2025 10:08:09 +0000 Subject: [PATCH 2/4] Revert "upgraded --upgrade with variable with default" This reverts commit 98367c99b58f945640ddffef14a99d63437a1df5. --- docs/user/role-variables.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/role-variables.rst b/docs/user/role-variables.rst index f3b831e3..185626e8 100644 --- a/docs/user/role-variables.rst +++ b/docs/user/role-variables.rst @@ -31,7 +31,7 @@ take a look at `the default values of these variables openwisp2_monitoring_version: "openwisp-monitoring~=1.0.0" openwisp2_radius_version: "openwisp-radius~=1.0.0" openwisp2_django_version: "django~=3.2.13" - # Extra arguments passed to pip when reinstalling python package with --force-reinstall + # 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" From 7121f3954c4755fe622bac7c21dd4b9e39b22adf Mon Sep 17 00:00:00 2001 From: PIYUSH RATHORE <163632958+Piyushrathoree@users.noreply.github.com> Date: Mon, 22 Dec 2025 23:48:27 +0530 Subject: [PATCH 3/4] Update defaults/main.yml Co-authored-by: Gagan Deep --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index fa002fed..05e64558 100755 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -235,4 +235,4 @@ openwisp2_usage_metric_collection_periodic_tasks: true # point {{ inventory_name }} to localhost in /etc/hosts openwisp2_inventory_hostname_localhost: true # variable for default deps upgrade -openwisp2_pip_extra_args: "--upgrade" \ No newline at end of file +openwisp2_pip_extra_args: "--upgrade" From c4f124d5151ab010f195766fa6c71b9b4cc9217c Mon Sep 17 00:00:00 2001 From: Gagan Deep Date: Wed, 3 Jun 2026 20:19:24 +0530 Subject: [PATCH 4/4] [fix] Fixes by @coderabbitai --- defaults/main.yml | 3 ++- tasks/pip.yml | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 711163ad..27243b1d 100755 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -236,5 +236,6 @@ openwisp2_radius_periodic_tasks: true openwisp2_usage_metric_collection_periodic_tasks: true # point {{ inventory_name }} to localhost in /etc/hosts openwisp2_inventory_hostname_localhost: true -# variable for default deps upgrade +# openwisp2_pip_extra_args controls extra pip arguments used when installing or +# reinstalling OpenWISP Python packages and dependencies. openwisp2_pip_extra_args: "--upgrade" diff --git a/tasks/pip.yml b/tasks/pip.yml index 620e3c68..feb9d96a 100644 --- a/tasks/pip.yml +++ b/tasks/pip.yml @@ -22,6 +22,7 @@ state: latest virtualenv: "{{ virtualenv_path }}" virtualenv_python: "{{ openwisp2_python }}" + extra_args: "{{ openwisp2_pip_extra_args }}" environment: LC_CTYPE: "en_US.UTF-8" notify: Reload application @@ -59,6 +60,7 @@ state: latest virtualenv: "{{ virtualenv_path }}" virtualenv_python: "{{ openwisp2_python }}" + extra_args: "{{ openwisp2_pip_extra_args }}" notify: Reload application retries: 5 delay: 10 @@ -74,6 +76,7 @@ state: latest virtualenv: "{{ virtualenv_path }}" virtualenv_python: "{{ openwisp2_python }}" + extra_args: "{{ openwisp2_pip_extra_args }}" notify: Reload application retries: 5 delay: 10 @@ -89,6 +92,7 @@ state: latest virtualenv: "{{ virtualenv_path }}" virtualenv_python: "{{ openwisp2_python }}" + extra_args: "{{ openwisp2_pip_extra_args }}" notify: Reload application retries: 5 delay: 10 @@ -104,6 +108,7 @@ state: latest virtualenv: "{{ virtualenv_path }}" virtualenv_python: "{{ openwisp2_python }}" + extra_args: "{{ openwisp2_pip_extra_args }}" notify: Reload application retries: 5 delay: 10