Skip to content

Commit

Permalink
Added Solaris support
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeniy Dementyev authored and Dmitriy Pavlov committed Apr 30, 2019
1 parent 927cfee commit 71228c3
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 3 deletions.
4 changes: 4 additions & 0 deletions lib/facter/rsyslog_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) version =~ %r{^([\d.]+)$}
end
end
end
12 changes: 9 additions & 3 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
33 changes: 33 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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}.")
}
Expand Down
8 changes: 8 additions & 0 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 71228c3

Please sign in to comment.