From 4e3498bd693ac0f5b5b0340da324f8238a4253c2 Mon Sep 17 00:00:00 2001 From: Saz Date: Sat, 3 Dec 2011 15:23:38 +0100 Subject: [PATCH] change ensure from file to present, add custom_config parameter, switch rsyslog::server to parameterized class --- manifests/server.pp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/manifests/server.pp b/manifests/server.pp index dceb252..cf7075c 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -1,10 +1,13 @@ -class rsyslog::server inherits rsyslog { +class rsyslog::server ($enable_tcp = true, $enable_udp = true, $server_dir = '/srv/log/', $custom_config = undef) inherits rsyslog { file { $rsyslog::params::server_conf: + ensure => present, owner => root, group => root, - ensure => file, - content => template("${module_name}/server.conf.erb"), - require => Class['rsyslog::install'], + content => $custom_config ? { + '' => template("${module_name}/server.conf.erb"), + default => template($custom_config), + }, + require => Class['rsyslog::config'], notify => Class['rsyslog::service'], } }