Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Solaris support #310

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) if 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