diff --git a/lib/facter/rsyslog_version.rb b/lib/facter/rsyslog_version.rb index f6c65a6..6819342 100644 --- a/lib/facter/rsyslog_version.rb +++ b/lib/facter/rsyslog_version.rb @@ -31,6 +31,10 @@ command = 'equery -q -C list -F \'$version\' rsyslog' version = Facter::Util::Resolution.exec(command) Regexp.last_match(1) if version =~ %r{^(.+)$} + when "Solaris" + command='pkg info rsyslog 2>/dev/null| grep Version:' + version = Facter::Util::Resolution.exec(command).strip.split[1] + Regexp.last_match(1) if version =~ %r{^([\d.]+)$} end end end diff --git a/manifests/config.pp b/manifests/config.pp index b63eee1..ddff30f 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -31,9 +31,15 @@ content => template("${module_name}/rsyslog.conf.erb"), } - file { $rsyslog::rsyslog_default: - ensure => file, - content => template("${module_name}/${rsyslog::rsyslog_default_file}.erb"), + if $rsyslog::rsyslog_default_file { + file { $rsyslog::rsyslog_default: + ensure => file, + owner => 'root', + group => $rsyslog::run_group, + content => template("${module_name}/${rsyslog::rsyslog_default_file}.erb"), + require => Class['rsyslog::install'], + notify => Class['rsyslog::service'], + } } file { $rsyslog::spool_dir: diff --git a/manifests/params.pp b/manifests/params.pp index 79fd025..0e4b11c 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -281,6 +281,39 @@ $im_journal_ignore_previous_messages = undef $im_journal_statefile = undef } + solaris: { + $rsyslog_package_name = 'rsyslog' + $relp_package_name = false + $mysql_package_name = false + $pgsql_package_name = false + $gnutls_package_name = false + $package_status = 'latest' + $rsyslog_d = '/etc/rsyslog.d/' + $rsyslog_conf = '/etc/rsyslog.conf' + $rsyslog_default = false + $default_config_file = false + $run_user = 'root' + $run_group = 'root' + $log_user = 'root' + $log_group = 'sys' + $log_style = 'debian' + $umask = false + $perm_file = '0640' + $perm_dir = '0755' + $spool_dir = '/var/spool/rsyslog' + $service_name = 'rsyslog' + $client_conf = 'client' + $server_conf = 'server' + $ssl = false + $modules = [ + '#$ModLoad immark # provides --MARK-- message capability', + '#$ModLoad imuxsock # can be used for rate-limiting and flow-control', + '$ModLoad imsolaris # for Solaris kernel logging', + ] + $service_hasrestart = true + $service_hasstatus = true + $omit_local_logging = false + } default: { fail("The ${module_name} module is not supported on ${::osfamily}/${::operatingsystem}.") } diff --git a/manifests/service.pp b/manifests/service.pp index 4be1999..18ef906 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -11,6 +11,14 @@ # class { 'rsyslog::service': } # class rsyslog::service { + if $::operatingsystem == "Solaris" { + service { 'svc:/system/system-log:default': + ensure => stopped, + enable => false, + before => Service[$rsyslog::service_name], + require => Package[$rsyslog::rsyslog_package_name], + } + } service { $rsyslog::service_name: ensure => running, enable => true,