Changeset View
Changeset View
Standalone View
Standalone View
site-modules/profile/manifests/swh/deploy/worker/instance.pp
# Instance of a worker | # Instance of a worker | ||||
# @param send_task_events | |||||
# True for workers whose tasks are still scheduled with scheduler-runner (they need to | |||||
# report their status to the listener which updates the scheduler accordingly). | |||||
# False, the default, for other workers whose recurring tasks are scheduled with | |||||
# next-gen scheduler-runner. Their status are updated through a journal client so no | |||||
# need for the events. | |||||
define profile::swh::deploy::worker::instance ( | define profile::swh::deploy::worker::instance ( | ||||
$ensure = present, | $ensure = present, | ||||
$instance_name = $title, | $instance_name = $title, | ||||
$sentry_name = $title, | $sentry_name = $title, | ||||
$limit_no_file = undef, | $limit_no_file = undef, | ||||
$private_tmp = undef, | $private_tmp = undef, | ||||
$merge_policy = 'deep', | $merge_policy = 'deep', | ||||
$send_task_events = false, | |||||
) | ) | ||||
{ | { | ||||
include ::profile::swh::deploy::worker::base | include ::profile::swh::deploy::worker::base | ||||
ardumont: That currently does not work since the $send_task_events is not propagated in that base profile… | |||||
Done Inline Actionsfor older version of the diff (no longer relevant now) ardumont: for older version of the diff (no longer relevant now) | |||||
# Parametrize the celery worker to actually send task events if required | |||||
if $send_task_events { | |||||
$celery_worker_extra_args = "--events" | |||||
} else { | |||||
$celery_worker_extra_args = "" | |||||
} | |||||
$service_basename = "swh-worker@${instance_name}" | $service_basename = "swh-worker@${instance_name}" | ||||
$service_name = "${service_basename}.service" | $service_name = "${service_basename}.service" | ||||
$concurrency = lookup("swh::deploy::worker::${instance_name}::concurrency") | $concurrency = lookup("swh::deploy::worker::${instance_name}::concurrency") | ||||
$max_tasks_per_child = lookup("swh::deploy::worker::${instance_name}::max_tasks_per_child", Integer, first, 5) | $max_tasks_per_child = lookup("swh::deploy::worker::${instance_name}::max_tasks_per_child", Integer, first, 5) | ||||
$loglevel = lookup("swh::deploy::worker::${instance_name}::loglevel") | $loglevel = lookup("swh::deploy::worker::${instance_name}::loglevel") | ||||
$config_file = lookup("swh::deploy::worker::${instance_name}::config_file") | $config_file = lookup("swh::deploy::worker::${instance_name}::config_file") | ||||
$config = lookup("swh::deploy::worker::${instance_name}::config", Hash, $merge_policy) | $config = lookup("swh::deploy::worker::${instance_name}::config", Hash, $merge_policy) | ||||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |
That currently does not work since the $send_task_events is not propagated in that base profile ^.