From eca33108c812283a0e6905934545d3726787b048 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 7 Jun 2016 22:31:09 -0300 Subject: Better dependency chain --- manifests/init.pp | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 902182e..65b996f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -3,10 +3,26 @@ class rsyslog { ensure => present, } + exec { 'restart-rsyslog': + command => '/usr/sbin/service rsyslog restart', + user => root, + refreshonly => true, + } + + # See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741496 + file { '/etc/systemd/system/syslog.service': + force => true, + ensure => '/lib/systemd/system/rsyslog.service', + owner => 'root', + group => 'root', + require => Package['rsyslog'], + notify => Exec['restart-rsyslog'], + } + service { 'rsyslog' : ensure => running, enable => true, - require => Package['rsyslog'], + require => File['/etc/systemd/system/syslog.service'], } file { '/etc/rsyslog.d/00-anon.conf': @@ -18,19 +34,4 @@ class rsyslog { require => Package['rsyslog'], notify => Service['rsyslog'], } - - # See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741496 - file { '/etc/systemd/system/syslog.service': - force => true, - ensure => '/lib/systemd/system/rsyslog.service', - owner => 'root', - group => 'root', - require => Package['rsyslog'], - notify => Exec['restart-rsyslog'], - } - - exec { 'restart-rsyslog': - command => '/usr/sbin/service rsyslog restart', - refreshonly => true, - } } -- cgit v1.2.3