diff --git a/manifests/init.pp b/manifests/init.pp index 2f215b9..3899805 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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}") } diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 407b0bd..ec75da1 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -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 }, } @@ -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 @@ -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 diff --git a/spec/fixtures/suse12.logrotate b/spec/fixtures/suse12.logrotate new file mode 100644 index 0000000..2b0bbc9 --- /dev/null +++ b/spec/fixtures/suse12.logrotate @@ -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 +} diff --git a/templates/sysconfig.suse12.erb b/templates/sysconfig.suse12.erb new file mode 100644 index 0000000..8cee051 --- /dev/null +++ b/templates/sysconfig.suse12.erb @@ -0,0 +1,4 @@ +# This file is being maintained by Puppet. +# DO NOT EDIT + +RSYSLOGD_PARAMS="-c 4"