Puppet Class: epics::carepeater
- Defined in:
- manifests/carepeater.pp
Summary
Install and run the EPICS Channel Access RepeaterOverview
Running the Channel Access Repeater is often useful on workstations and other computers running multiple Channel Access clients. It forwards beacons to multiple clients which allows all clients running on the machine to be notified when IOCs are started or stopped. This often leads to faster reconnects after IOC restarts. See the [Channel Access Reference Manual](epics.anl.gov/base/R7-0/3-docs/CAref.html#Repeater) for details.
In some cases installing the package containing the Channel Access Repeater executable might be sufficient to start the Channel Access Repeater service. However, this class provides more fine-grained control allowing users to run the service on a custom port or under a different user. It can also ensure the service is actually running (e.g. if a sysadmin stops it and forgets to start it after the maintenance work is finished).
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'manifests/carepeater.pp', line 64
class epics::carepeater(
Stdlib::Ensure::Service $ensure,
Boolean $enable,
String $executable,
Stdlib::Port $port,
Enum['present', 'absent', 'file'] $dropin_file_ensure,
String $user,
) {
include "::${module_name}::catools"
case $::service_provider {
'systemd': {
# The epics-catools package already comes with a caRepeater.service file.
# We only add a drop-in file to allow some configuration.
systemd::dropin_file { '10-params.conf':
ensure => $dropin_file_ensure,
unit => 'caRepeater.service',
content => template("${module_name}/caRepeater/systemd/10-params.conf"),
notify => Service['caRepeater'],
}
Class['systemd::systemctl::daemon_reload'] -> Service['caRepeater']
}
'init', 'debian': {
file { '/etc/init.d/caRepeater':
ensure => 'file',
source => "puppet:///modules/${module_name}/init/caRepeater",
owner => 'root',
group => 'root',
mode => '0755',
notify => Service['caRepeater'],
}
file { '/etc/caRepeater.conf':
ensure => 'file',
content => template("${module_name}/caRepeater/init/caRepeater.conf"),
owner => 'root',
group => 'root',
mode => '0755',
notify => Service['caRepeater'],
}
}
default: {
fail("Module '${module_name}' doesn't support service provider '${::service_provider}', yet. Pull-requests welcome ;-)")
}
}
service { 'caRepeater':
ensure => $ensure,
enable => $enable,
hasrestart => true,
require => Class["::${module_name}::catools"],
}
}
|