summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteffen Zieger <me@saz.sh>2012-05-11 14:14:02 +0200
committerSteffen Zieger <me@saz.sh>2012-05-11 14:14:02 +0200
commit31b02647837955911253725ef789ec263c517e9e (patch)
tree21e2961bb50048e0591ef3ffc9fa075ee569f261
parentd59582291a31f7c8289c3c5b7d5279caa68899e9 (diff)
parentc044800d5fe722454911686fd399088280172d1b (diff)
Merge branch 'master' of github.com:saz/puppet-rsyslog
-rw-r--r--manifests/client.pp32
-rw-r--r--manifests/config.pp8
-rw-r--r--manifests/imfile.pp2
-rw-r--r--manifests/install.pp4
-rw-r--r--manifests/params.pp52
-rw-r--r--manifests/server.pp11
6 files changed, 68 insertions, 41 deletions
diff --git a/manifests/client.pp b/manifests/client.pp
index 6b71e9e..ce882b5 100644
--- a/manifests/client.pp
+++ b/manifests/client.pp
@@ -1,13 +1,21 @@
-class rsyslog::client ($log_remote = true, $remote_type = 'tcp', $log_local = false, $log_auth_local = false, $custom_config = undef, $server = 'log') inherits rsyslog {
- file { $rsyslog::params::client_conf:
- ensure => present,
- owner => root,
- group => root,
- content => $custom_config ? {
- '' => template("${module_name}/client.conf.erb"),
- default => template($custom_config),
- },
- require => Class['rsyslog::config'],
- notify => Class['rsyslog::service'],
- }
+class rsyslog::client (
+ $log_remote = true,
+ $remote_type = 'tcp',
+ $log_local = false,
+ $log_auth_local = false,
+ $custom_config = undef,
+ $server = 'log'
+) inherits rsyslog {
+
+ file { $rsyslog::params::client_conf:
+ ensure => present,
+ owner => root,
+ group => $rsyslog::params::run_group,
+ content => $custom_config ? {
+ '' => template("${module_name}/client.conf.erb"),
+ default => template($custom_config),
+ },
+ require => Class['rsyslog::config'],
+ notify => Class['rsyslog::service'],
+ }
}
diff --git a/manifests/config.pp b/manifests/config.pp
index cc63292..aa06535 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -1,7 +1,7 @@
class rsyslog::config {
file { $rsyslog::params::rsyslog_d:
owner => root,
- group => root,
+ group => $rsyslog::params::run_group,
purge => true,
recurse => true,
force => true,
@@ -11,7 +11,7 @@ class rsyslog::config {
file { $rsyslog::params::rsyslog_conf:
owner => root,
- group => root,
+ group => $rsyslog::params::run_group,
ensure => file,
content => template("${module_name}/rsyslog.conf.erb"),
require => Class["rsyslog::install"],
@@ -20,7 +20,7 @@ class rsyslog::config {
file { $rsyslog::params::rsyslog_default:
owner => root,
- group => root,
+ group => $rsyslog::params::run_group,
ensure => file,
source => "puppet:///modules/rsyslog/rsyslog_default",
require => Class["rsyslog::install"],
@@ -29,7 +29,7 @@ class rsyslog::config {
file { $rsyslog::params::spool_dir:
owner => root,
- group => root,
+ group => $rsyslog::params::run_group,
ensure => directory,
require => Class["rsyslog::install"],
notify => Class["rsyslog::service"],
diff --git a/manifests/imfile.pp b/manifests/imfile.pp
index 0e109d9..64e6e2f 100644
--- a/manifests/imfile.pp
+++ b/manifests/imfile.pp
@@ -11,7 +11,7 @@ define rsyslog::imfile(
file { "${rsyslog::params::rsyslog_d}${name}.conf":
ensure => file,
owner => 'root',
- group => 'root',
+ group => $rsyslog::params::run_group,
content => template('rsyslog/imfile.erb'),
require => Class['rsyslog::install'],
notify => Class['rsyslog::service'],
diff --git a/manifests/install.pp b/manifests/install.pp
index 5521264..e0601bd 100644
--- a/manifests/install.pp
+++ b/manifests/install.pp
@@ -1,9 +1,9 @@
class rsyslog::install {
package { $rsyslog::params::rsyslog_package_name:
- ensure => latest,
+ ensure => $rsyslog::params::package_status,
}
package { $rsyslog::params::relp_package_name:
- ensure => latest,
+ ensure => $rsyslog::params::package_status
}
}
diff --git a/manifests/params.pp b/manifests/params.pp
index 24426ad..37c40ce 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -1,30 +1,42 @@
class rsyslog::params {
case $::operatingsystem {
ubuntu, debian: {
- $rsyslog_package_name = 'rsyslog'
- $relp_package_name = 'rsyslog-relp'
- $rsyslog_d = '/etc/rsyslog.d/'
- $rsyslog_conf = '/etc/rsyslog.conf'
- $rsyslog_default = '/etc/default/rsyslog'
- $spool_dir = '/var/spool/rsyslog/'
- $service_name = 'rsyslog'
- $client_conf = "${rsyslog_d}client.conf"
- $server_conf = "${rsyslog_d}server.conf"
+ $rsyslog_package_name = 'rsyslog'
+ $relp_package_name = 'rsyslog-relp'
+ $package_status = 'latest'
+ $rsyslog_d = '/etc/rsyslog.d/'
+ $rsyslog_conf = '/etc/rsyslog.conf'
+ $rsyslog_default = '/etc/default/rsyslog'
+ $run_user = 'root'
+ $run_group = 'root'
+ $log_user = 'root'
+ $log_group = 'adm'
+ $spool_dir = '/var/spool/rsyslog/'
+ $service_name = 'rsyslog'
+ $client_conf = "${rsyslog_d}client.conf"
+ $server_conf = "${rsyslog_d}server.conf"
}
+ freebsd: {
+ $rsyslog_package_name = 'rsyslog5'
+ $relp_package_name = 'rsyslog5-relp'
+ $package_status = 'present'
+ $rsyslog_d = '/etc/syslog.d/'
+ $rsyslog_conf = '/etc/syslog.conf'
+ $rsyslog_default = '/etc/defaults/syslogd'
+ $run_user = 'root'
+ $run_group = 'wheel'
+ $log_user = 'root'
+ $log_group = 'wheel'
+ $spool_dir = '/var/spool/syslog/'
+ $service_name = 'syslogd'
+ $client_conf = "${rsyslog_d}client.conf"
+ $server_conf = "${rsyslog_d}server.conf"
+ }
+
+
default: {
fail("Unsupported platform: ${::operatingsystem}")
}
}
- #
- # Internal variables
- #
-
- # Drop privileges to this user and group
- $run_user = 'root'
- $run_group = 'root'
-
- # User and group of log files
- $log_user = 'root'
- $log_group = 'adm'
}
diff --git a/manifests/server.pp b/manifests/server.pp
index adc868e..f5d7e88 100644
--- a/manifests/server.pp
+++ b/manifests/server.pp
@@ -1,8 +1,15 @@
-class rsyslog::server ($enable_tcp = true, $enable_udp = true, $server_dir = '/srv/log/', $custom_config = undef, $high_precision_timestamps = false) inherits rsyslog {
+class rsyslog::server (
+ $enable_tcp = true,
+ $enable_udp = true,
+ $server_dir = '/srv/log/',
+ $custom_config = undef,
+ $high_precision_timestamps = false
+) inherits rsyslog {
+
file { $rsyslog::params::server_conf:
ensure => present,
owner => root,
- group => root,
+ group => $rsyslog::params::run_group,
content => $custom_config ? {
'' => template("${module_name}/server.conf.erb"),
default => template($custom_config),