Skip to content

Commit

Permalink
Add Suse 12 support
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-larsson committed Nov 5, 2014
1 parent 6fb77f7 commit 252b55d
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 0 deletions.
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@
'11' : {
$sysconfig_erb = 'sysconfig.suse11.erb'
}
'12' : {
$sysconfig_erb = 'sysconfig.suse12.erb'
}
default: {
fail("rsyslog supports Suse like systems with major release 10 and 11, and you have ${::lsbmajdistrelease}")
}
Expand Down
36 changes: 36 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@
'debian7' => { :kernel => 'Linux', :osfamily => 'Debian', :release => '7', :logrotate_present => true },
'suse10' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '10', :logrotate_present => true },
'suse11' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '11', :logrotate_present => true },
'suse12' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '12', :logrotate_present => true },
'solaris10' => { :kernel => 'Solaris', :osfamily => 'Solaris', :release => '5.10', :logrotate_present => false },
'solaris11' => { :kernel => 'Solaris', :osfamily => 'Solaris', :release => '5.11', :logrotate_present => false },
}
Expand Down Expand Up @@ -718,6 +719,30 @@
it { should contain_file('rsyslog_sysconfig').with_content(/^RSYSLOGD_PARAMS=""$/) }
end
end

context 'on Suse 12' do
let :facts do
{
:kernel => 'Linux',
:osfamily => 'Suse',
:lsbmajdistrelease => '12',
}
end

context 'with default params' do
it {
should contain_file('rsyslog_sysconfig').with({
'path' => '/etc/sysconfig/syslog',
'owner' => 'root',
'group' => 'root',
'mode' => '0644',
'require' => 'Package[rsyslog]',
'notify' => 'Service[rsyslog_daemon]',
})
}
it { should contain_file('rsyslog_sysconfig').with_content(/^RSYSLOGD_PARAMS="-c 4"$/) }
end
end
end

describe 'rsyslog_d_dir' do
Expand Down Expand Up @@ -1060,6 +1085,17 @@
end
it { should contain_class('rsyslog') }
end

context 'on supported major release 12' do
let :facts do
{
:kernel => 'Linux',
:osfamily => 'Suse',
:lsbmajdistrelease => '12',
}
end
it { should contain_class('rsyslog') }
end
end

context 'on supported osfamily, Solaris' do
Expand Down
23 changes: 23 additions & 0 deletions spec/fixtures/suse12.logrotate
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file is being maintained by Puppet.
# DO NOT EDIT

/var/log/warn
/var/log/messages
/var/log/allmessages
/var/log/localmessages
/var/log/firewall
/var/log/acpid
/var/log/NetworkManager
/var/log/mail
/var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
/var/log/news/news.crit
/var/log/news/news.err
/var/log/news/news.notice
{
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}
4 changes: 4 additions & 0 deletions templates/sysconfig.suse12.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file is being maintained by Puppet.
# DO NOT EDIT

RSYSLOGD_PARAMS="-c 4"

0 comments on commit 252b55d

Please sign in to comment.