From 4c5e46c59de215f4620c0bf4db1012bd975b03b6 Mon Sep 17 00:00:00 2001 From: Eeshu-Yadav Date: Tue, 2 Jun 2026 12:46:57 +0530 Subject: [PATCH 1/2] [feature] Wired check_pending_upgrades and send_pending_upgrade_reminders into the Beat schedule #621 Added the two new firmware-upgrader Beat entries to CELERY_BEAT_SCHEDULE in templates/openwisp2/settings.py, gated on openwisp2_firmware_upgrader and a new openwisp2_firmware_upgrader_periodic_tasks toggle mirroring the existing monitoring/radius/metric_collection gating. Cadences come from two new ansible variables (default 10 minutes and 7 days) so operators can tune from inventory. Uses timedelta() because these are scan workloads, not fixed-clock cron jobs. Documented the three new variables in docs/user/role-variables.rst next to the existing *_periodic_tasks rows. Related to #621 --- defaults/main.yml | 3 +++ docs/user/role-variables.rst | 3 +++ templates/openwisp2/settings.py | 10 ++++++++++ 3 files changed, 16 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index dd1cfe3a..4504a6a1 100755 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -97,6 +97,8 @@ openwisp2_celery_firmware_upgrader_concurrency: 1 openwisp2_celery_firmware_upgrader_autoscale: openwisp2_celery_firmware_upgrader_prefetch_multiplier: 1 openwisp2_celery_firmware_upgrader_optimization: fair +openwisp2_firmware_upgrader_check_pending_period_minutes: 10 +openwisp2_firmware_upgrader_reminder_scan_period_days: 7 openwisp2_celery_monitoring: true openwisp2_celery_monitoring_concurrency: 2 openwisp2_celery_monitoring_autoscale: @@ -234,5 +236,6 @@ openwisp2_usage_metric_collection: true openwisp2_monitoring_periodic_tasks: true openwisp2_radius_periodic_tasks: true openwisp2_usage_metric_collection_periodic_tasks: true +openwisp2_firmware_upgrader_periodic_tasks: true # point {{ inventory_name }} to localhost in /etc/hosts openwisp2_inventory_hostname_localhost: true diff --git a/docs/user/role-variables.rst b/docs/user/role-variables.rst index c840d8f8..7bdb2fba 100644 --- a/docs/user/role-variables.rst +++ b/docs/user/role-variables.rst @@ -377,6 +377,9 @@ take a look at `the default values of these variables openwisp2_monitoring_periodic_tasks: true openwisp2_radius_periodic_tasks: true openwisp2_usage_metric_collection_periodic_tasks: true + openwisp2_firmware_upgrader_periodic_tasks: true + openwisp2_firmware_upgrader_check_pending_period_minutes: 10 + openwisp2_firmware_upgrader_reminder_scan_period_days: 7 # point {{ inventory_name }} to localhost in /etc/hosts openwisp2_inventory_hostname_localhost: true # this role provides a default configuration of freeradius diff --git a/templates/openwisp2/settings.py b/templates/openwisp2/settings.py index 10a75abd..e84b4eb4 100644 --- a/templates/openwisp2/settings.py +++ b/templates/openwisp2/settings.py @@ -274,6 +274,16 @@ "schedule": timedelta(minutes=5), }, {% endif %} +{% if openwisp2_firmware_upgrader and openwisp2_firmware_upgrader_periodic_tasks %} + "check_pending_upgrades": { + "task": "openwisp_firmware_upgrader.tasks.check_pending_upgrades", + "schedule": timedelta(minutes={{ openwisp2_firmware_upgrader_check_pending_period_minutes }}), + }, + "send_pending_upgrade_reminders": { + "task": "openwisp_firmware_upgrader.tasks.send_pending_upgrade_reminders", + "schedule": timedelta(days={{ openwisp2_firmware_upgrader_reminder_scan_period_days }}), + }, +{% endif %} {% if openwisp2_radius and openwisp2_radius_periodic_tasks %} "delete_old_radiusbatch_users": { "task": "openwisp_radius.tasks.delete_old_radiusbatch_users", From 0f5fe44be2f5bc7d5ac9fb714763d51b4566ab56 Mon Sep 17 00:00:00 2001 From: Eeshu-Yadav Date: Tue, 2 Jun 2026 13:04:21 +0530 Subject: [PATCH 2/2] =?UTF-8?q?[chores]=20TEMPORARY=20pin=20firmware-upgra?= =?UTF-8?q?der=20to=20PR=20#436=20branch=20in=20molecule=20converge=20?= =?UTF-8?q?=E2=80=94=20revert=20before=20merge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Molecule installs the master tarball by default, which does not yet ship the new Beat tasks. Overriding only in the test inventory keeps the production default in defaults/main.yml clean. Points at the openwisp-firmware-upgrader branch issues/417-persistence-schema-fields (the PR #436 head). Revert this override before this branch merges to master, once PR #436 has merged and a release is cut. Related to #621 --- molecule/resources/converge.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/molecule/resources/converge.yml b/molecule/resources/converge.yml index a5dad8d3..45652e24 100644 --- a/molecule/resources/converge.yml +++ b/molecule/resources/converge.yml @@ -7,6 +7,7 @@ vars: openwisp2_network_topology: true openwisp2_firmware_upgrader: true + openwisp2_firmware_upgrader_version: "openwisp-firmware-upgrader @ https://github.com/openwisp/openwisp-firmware-upgrader/tarball/issues/417-persistence-schema-fields" openwisp2_radius: true openwisp2_controller_subnet_division: true openwisp2_uwsgi_extra_conf: |