Permalink
Browse files

Adding support for FreeBSD

  • Loading branch information...
1 parent 482623e commit cf9d8d113de24031bc8ef28c8f45c946325f89ad @whopper committed Mar 14, 2012
Showing with 42 additions and 30 deletions.
  1. +11 −11 manifests/client.pp
  2. +4 −4 manifests/config.pp
  3. +1 −1 manifests/imfile.pp
  4. +2 −2 manifests/install.pp
  5. +23 −11 manifests/params.pp
  6. +1 −1 manifests/server.pp
View
@@ -7,15 +7,15 @@
$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'],
- }
+ 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'],
+ }
}
View
@@ -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 @@
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 @@
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 @@
file { $rsyslog::params::spool_dir:
owner => root,
- group => root,
+ group => $rsyslog::params::run_group,
ensure => directory,
require => Class["rsyslog::install"],
notify => Class["rsyslog::service"],
View
@@ -11,7 +11,7 @@
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'],
@@ -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
}
}
View
@@ -3,28 +3,40 @@
ubuntu, debian: {
$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'
}
View
@@ -9,7 +9,7 @@
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),

1 comment on commit cf9d8d1

@whopper
Owner

Alright, I believe everything is cleaner now. Let me know if there's anything else I can fix. Thanks!

Please sign in to comment.