Changeset View
Changeset View
Standalone View
Standalone View
site-modules/profile/manifests/swh/deploy/worker/base.pp
# Base worker profile | # Base worker profile | ||||
class profile::swh::deploy::worker::base { | class profile::swh::deploy::worker::base { | ||||
$systemd_template_unit_name = 'swh-worker@.service' | $systemd_template_unit_name = 'swh-worker@.service' | ||||
$systemd_template_events_unit_name = 'swh-worker-events@.service' | |||||
$systemd_unit_name = 'swh-worker.service' | $systemd_unit_name = 'swh-worker.service' | ||||
$systemd_slice_name = 'system-swh\x2dworker.slice' | $systemd_slice_name = 'system-swh\x2dworker.slice' | ||||
$celery_hostname = $swh_hostname['internal_fqdn'] | $celery_hostname = $swh_hostname['internal_fqdn'] | ||||
package {'python3-swh.scheduler': | package {'python3-swh.scheduler': | ||||
ensure => installed, | ensure => installed, | ||||
} | } | ||||
# Parametrize the celery worker to actually send task events if required | |||||
if $send_task_events { | |||||
$extra_command_flag = "--events" | |||||
} else { | |||||
$extra_command_flag = "" | |||||
} | |||||
::systemd::unit_file {$systemd_template_unit_name: | ::systemd::unit_file {$systemd_template_unit_name: | ||||
ensure => 'present', | ensure => 'present', | ||||
content => template("profile/swh/deploy/worker/${systemd_template_unit_name}.erb"), | content => template("profile/swh/deploy/worker/${systemd_template_unit_name}.erb"), | ||||
} | } | ||||
::systemd::unit_file {$systemd_template_events_unit_name: | |||||
ensure => 'present', | |||||
content => template("profile/swh/deploy/worker/${systemd_template_events_unit_name}.erb"), | |||||
} | |||||
::systemd::unit_file {$systemd_unit_name: | ::systemd::unit_file {$systemd_unit_name: | ||||
ensure => 'present', | ensure => 'present', | ||||
source => "puppet:///modules/profile/swh/deploy/worker/${systemd_unit_name}", | source => "puppet:///modules/profile/swh/deploy/worker/${systemd_unit_name}", | ||||
} ~> service {'swh-worker': | } ~> service {'swh-worker': | ||||
ensure => running, | ensure => running, | ||||
enable => true, | enable => true, | ||||
} | } | ||||
Show All 19 Lines |