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/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: | 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",