mode => '0444',
}
- file { "/etc/systemd/system/rsyncd-${name}@.service":
+ $service_file = "/etc/systemd/system/rsyncd-${name}@.service"
+ $socket_file = "/etc/systemd/system/rsyncd-${name}.socket"
+ $systemd_service = "rsyncd-${name}.socket"
+
+ file { $service_file:
ensure => $ensure,
content => template('rsync/systemd-rsyncd.service.erb'),
owner => 'root',
notify => Exec['systemctl daemon-reload'],
}
- file { "/etc/systemd/system/rsyncd-${name}.socket":
+ file { $socket_file:
ensure => $ensure,
content => template('rsync/systemd-rsyncd.socket.erb'),
owner => 'root',
notify => Exec['systemctl daemon-reload'],
}
- service { "rsyncd-${name}.socket":
+ service { $systemd_service:
ensure => $ensure_service,
enable => $ensure_enable,
notify => Exec['systemctl daemon-reload'],
subscribe => [
- File["/etc/systemd/system/rsyncd-${name}@.service"],
- File["/etc/systemd/system/rsyncd-${name}.socket"],
+ File[$service_file],
+ File[$socket_file],
],
provider => systemd,
}