diff --git a/README.md b/README.md index a1e878d..e943114 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ for the exact matrix of supported Puppet and ruby versions. * Suse 10 * Suse 11 * Suse 12 + * Suse 15 * Solaris 10 * Solaris 11 diff --git a/manifests/init.pp b/manifests/init.pp index 92eb83f..3a83984 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -237,8 +237,11 @@ /^12\.*/ : { $sysconfig_erb = 'sysconfig.suse12.erb' } + /^15\.*/ : { + $sysconfig_erb = 'sysconfig.suse15.erb' + } default: { - fail("rsyslog supports Suse like systems with major release 10 and 11, and you have ${::operatingsystemrelease}") + fail("rsyslog supports Suse like systems with major release 10, 11, 12 and 15, and you have ${::operatingsystemrelease}") } } } diff --git a/metadata.json b/metadata.json index 4fc7f82..540e643 100644 --- a/metadata.json +++ b/metadata.json @@ -51,10 +51,22 @@ ] }, { - "operatingsystem": "SLES" + "operatingsystem": "SLES", + "operatingsystemrelease": [ + "10", + "11", + "12", + "15" + ] }, { - "operatingsystem": "SLED" + "operatingsystem": "SLED", + "operatingsystemrelease": [ + "10", + "11", + "12", + "15" + ] }, { "operatingsystem": "Solaris", diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index ff92857..7ff5fc9 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -809,6 +809,7 @@ 'suse10' => { :osfamily => 'Suse', :release => '10.1', :kernel => 'Linux', }, 'suse11' => { :osfamily => 'Suse', :release => '11.1', :kernel => 'Linux', }, 'suse12' => { :osfamily => 'Suse', :release => '12.1', :kernel => 'Linux', }, + 'suse15' => { :osfamily => 'Suse', :release => '15.1', :kernel => 'Linux', }, 'solaris10' => { :osfamily => 'Solaris', :release => '5.10', :kernel => 'Solaris', }, 'solaris11' => { :osfamily => 'Solaris', :release => '5.11', :kernel => 'Solaris', }, } @@ -1182,6 +1183,36 @@ it { should contain_file('rsyslog_sysconfig').with_content(/^RSYSLOGD_PARAMS="-c0"$/) } end end + + context 'on Suse 15' do + let :facts do + { + :kernel => 'Linux', + :osfamily => 'Suse', + :operatingsystemrelease => '15.0', + } + 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=""$/) } + end + + context 'with syslogd_options specified as valid value' do + let(:params) { { :syslogd_options => '-c0' } } + + it { should contain_file('rsyslog_sysconfig').with_content(/^RSYSLOGD_PARAMS="-c0"$/) } + end + end end describe 'rsyslog_d_dir' do @@ -1373,6 +1404,7 @@ 'suse10' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '10.2', :support => 'supported', }, 'suse11' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '11.1', :support => 'supported', }, 'suse12' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '12.1', :support => 'supported', }, + 'suse15' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '15.1', :support => 'supported', }, 'solaris9' => { :kernel => 'Solaris', :osfamily => 'Solaris', :release => '5.9', :support => 'unsupported', }, 'solaris10' => { :kernel => 'Solaris', :osfamily => 'Solaris', :release => '5.10', :support => 'supported', }, 'solaris11' => { :kernel => 'Solaris', :osfamily => 'Solaris', :release => '5.11', :support => 'supported', }, @@ -1420,6 +1452,7 @@ 'suse10' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '10', :mod_imjournal => false, }, 'suse11' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '11', :mod_imjournal => false, }, 'suse12' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '12', :mod_imjournal => false, }, + 'suse15' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '15', :mod_imjournal => false, }, 'solaris10' => { :kernel => 'Solaris', :osfamily => 'Solaris', :release => '5.10', :mod_imjournal => false, }, 'solaris11' => { :kernel => 'Solaris', :osfamily => 'Solaris', :release => '5.11', :mod_imjournal => false, }, } @@ -1461,6 +1494,7 @@ 'suse10' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '10', :manage_devlog => false, }, 'suse11' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '11', :manage_devlog => false, }, 'suse12' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '12', :manage_devlog => false, }, + 'suse15' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '15', :manage_devlog => false, }, 'solaris10' => { :kernel => 'Solaris', :osfamily => 'Solaris', :release => '5.10', :manage_devlog => false, }, 'solaris11' => { :kernel => 'Solaris', :osfamily => 'Solaris', :release => '5.11', :manage_devlog => false, }, } diff --git a/spec/fixtures/logrotate.suse15 b/spec/fixtures/logrotate.suse15 new file mode 100644 index 0000000..7c79eef --- /dev/null +++ b/spec/fixtures/logrotate.suse15 @@ -0,0 +1,36 @@ +# This file is being maintained by Puppet. +# DO NOT EDIT + +/var/log/messages +/var/log/secure +/var/log/maillog +/var/log/spooler +/var/log/boot.log +/var/log/cron +/var/log/warn +/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 +{ + compress + dateext + maxage 365 + rotate 99 + missingok + notifempty + size +4096k + create 640 root root + sharedscripts + postrotate + /sbin/service syslog reload > /dev/null + endscript +} diff --git a/templates/sysconfig.suse15.erb b/templates/sysconfig.suse15.erb new file mode 100644 index 0000000..8b27bef --- /dev/null +++ b/templates/sysconfig.suse15.erb @@ -0,0 +1,18 @@ +# This file is being maintained by Puppet. +# DO NOT EDIT + +## Type: string +## Default: "" +## Config: "" +## ServiceRestart: syslog +# +# Parameters for rsyslogd, except of the version compatibility (-c) +# and the config file (-f), because they're used by sysconfig and +# earlysysconfig init scripts. +# +# See also the RSYSLOGD_COMPAT_VERSION variable in this file, the +# documentation provided in /usr/share/doc/packages/rsyslog/doc by +# the rsyslog-doc package and the rsyslogd(8) and rsyslog.conf(5) +# manual pages. +# +RSYSLOGD_PARAMS="<%= @syslogd_options_real %>"