summaryrefslogtreecommitdiff
path: root/puppet/modules/site_nickserver/manifests
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2017-01-16 15:41:44 +0100
committervarac <varacanero@zeromail.org>2017-01-18 18:43:15 +0100
commit7e51872c854f48eaf372a6025f4550ca801cb447 (patch)
tree27016e1f44da807d690984799046c651a16e68ae /puppet/modules/site_nickserver/manifests
parent8cba23d7308af4ed018d42935adee442e2e53134 (diff)
Use systemd unit file for nickserver [#8578]
Diffstat (limited to 'puppet/modules/site_nickserver/manifests')
-rw-r--r--puppet/modules/site_nickserver/manifests/init.pp46
1 files changed, 15 insertions, 31 deletions
diff --git a/puppet/modules/site_nickserver/manifests/init.pp b/puppet/modules/site_nickserver/manifests/init.pp
index ad97f829..12236b3b 100644
--- a/puppet/modules/site_nickserver/manifests/init.pp
+++ b/puppet/modules/site_nickserver/manifests/init.pp
@@ -101,42 +101,26 @@ class site_nickserver {
# NICKSERVER DAEMON
#
- file {
- '/usr/bin/nickserver':
- ensure => link,
- target => '/srv/leap/nickserver/bin/nickserver',
- require => Vcsrepo['/srv/leap/nickserver'];
-
- '/etc/init.d/nickserver':
- owner => root,
- group => 0,
- mode => '0755',
- source => '/srv/leap/nickserver/dist/debian-init-script',
- require => Vcsrepo['/srv/leap/nickserver'];
+ file { '/usr/bin/nickserver':
+ ensure => link,
+ target => '/srv/leap/nickserver/bin/nickserver',
+ require => Vcsrepo['/srv/leap/nickserver'];
}
- # register initscript at systemd on nodes newer than wheezy
- # see https://leap.se/code/issues/7614
- case $::operatingsystemrelease {
- /^7.*/: { }
- default: {
- exec { 'register_systemd_nickserver':
- refreshonly => true,
- command => '/bin/systemctl enable nickserver',
- subscribe => File['/etc/init.d/nickserver'],
- before => Service['nickserver'];
- }
- }
+ ::systemd::unit_file {'nickserver.service':
+ ensure => present,
+ source => '/srv/leap/nickserver/dist/nickserver.service',
+ subscribe => Vcsrepo['/srv/leap/nickserver'],
+ require => File['/usr/bin/nickserver'];
}
service { 'nickserver':
- ensure => running,
- enable => true,
- hasrestart => true,
- hasstatus => true,
- require => [
- File['/etc/init.d/nickserver'],
- File['/usr/bin/nickserver'],
+ ensure => running,
+ provider => 'systemd',
+ enable => true,
+ require => [
+ Systemd::Unit_file['nickserver.service'],
+ Exec['systemctl-daemon-reload'],
Class['Site_config::X509::Key'],
Class['Site_config::X509::Cert'],
Class['Site_config::X509::Ca'] ];