Skip to content

Commit

Permalink
Add support for EL 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Friderici committed Jul 28, 2021
1 parent 450744c commit a8ea904
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ for the exact matrix of supported Puppet and ruby versions.
* EL 5
* EL 6
* EL 7
* EL 8 [*]
* Suse 10
* Suse 11
* Suse 12
* Suse 15
* Solaris 10
* Solaris 11

[*] This module support the `basic` configuration format for rsyslog.
EL 8 by default utilize the `advanced` configuration format but is compatible with `basic` configurations as well.

===

# Examples
Expand Down
9 changes: 8 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,15 @@
$default_mod_imjournal = true
$default_manage_devlog = true
}
/^8\.*/: {
$default_pid_file = '/var/run/syslogd.pid'
$sysconfig_erb = 'sysconfig.rhel8.erb'
$default_syslogd_options = undef
$default_mod_imjournal = true
$default_manage_devlog = true
}
default: {
fail("rsyslog supports RedHat like systems with major release of 5, 6 and 7 and you have ${::operatingsystemrelease}")
fail("rsyslog supports RedHat like systems with major release of 5, 6, 7 and 8 and you have ${::operatingsystemrelease}")
}
}
# ensures that sysklogd is absent, which is needed on EL5
Expand Down
12 changes: 8 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,35 @@
"operatingsystemrelease": [
"5",
"6",
"7"
"7",
"8"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"5",
"6",
"7"
"7",
"8"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"5",
"6",
"7"
"7",
"8"
]
},
{
"operatingsystem": "Scientific",
"operatingsystemrelease": [
"5",
"6",
"7"
"7",
"8"
]
},
{
Expand Down
34 changes: 34 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,7 @@
'redhat5' => { :osfamily => 'RedHat', :release => '5.10', :kernel => 'Linux', },
'redhat6' => { :osfamily => 'RedHat', :release => '6.5', :kernel => 'Linux', },
'redhat7' => { :osfamily => 'RedHat', :release => '7.0.1406', :kernel => 'Linux', },
'redhat8' => { :osfamily => 'RedHat', :release => '8.0', :kernel => 'Linux', },
'debian7' => { :osfamily => 'Debian', :release => '7.3', :kernel => 'Linux', },
'suse10' => { :osfamily => 'Suse', :release => '10.1', :kernel => 'Linux', },
'suse11' => { :osfamily => 'Suse', :release => '11.1', :kernel => 'Linux', },
Expand Down Expand Up @@ -1082,6 +1083,36 @@
end
end

context 'on EL 8' do
let :facts do
{
:kernel => 'Linux',
:osfamily => 'RedHat',
:operatingsystemrelease => '8.0',
}
end

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

context 'with syslogd_options specified as valid value' do
let(:params) { { :syslogd_options => '-c0' } }

it { should contain_file('rsyslog_sysconfig').with_content(/^SYSLOGD_OPTIONS="-c0"$/) }
end
end

context 'on Suse 10' do
let :facts do
{
Expand Down Expand Up @@ -1399,6 +1430,7 @@
'redhat5' => { :kernel => 'Linux', :osfamily => 'RedHat', :release => '5.10', :support => 'supported', },
'redhat6' => { :kernel => 'Linux', :osfamily => 'RedHat', :release => '6.5', :support => 'supported', },
'redhat7' => { :kernel => 'Linux', :osfamily => 'RedHat', :release => '7.0.1406', :support => 'supported', },
'redhat8' => { :kernel => 'Linux', :osfamily => 'RedHat', :release => '8.0', :support => 'supported', },
'debian7' => { :kernel => 'Linux', :osfamily => 'Debian', :release => '7.3', :support => 'supported', },
'suse9' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '9.1', :support => 'unsupported', },
'suse10' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '10.2', :support => 'supported', },
Expand Down Expand Up @@ -1448,6 +1480,7 @@
'redhat5' => { :kernel => 'Linux', :osfamily => 'RedHat', :release => '5', :mod_imjournal => false, },
'redhat6' => { :kernel => 'Linux', :osfamily => 'RedHat', :release => '6', :mod_imjournal => false, },
'redhat7' => { :kernel => 'Linux', :osfamily => 'RedHat', :release => '7', :mod_imjournal => true, },
'redhat8' => { :kernel => 'Linux', :osfamily => 'RedHat', :release => '8', :mod_imjournal => true, },
'debian7' => { :kernel => 'Linux', :osfamily => 'Debian', :release => '7', :mod_imjournal => false, },
'suse10' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '10', :mod_imjournal => false, },
'suse11' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '11', :mod_imjournal => false, },
Expand Down Expand Up @@ -1490,6 +1523,7 @@
'redhat5' => { :kernel => 'Linux', :osfamily => 'RedHat', :release => '5', :manage_devlog => false, },
'redhat6' => { :kernel => 'Linux', :osfamily => 'RedHat', :release => '6', :manage_devlog => false, },
'redhat7' => { :kernel => 'Linux', :osfamily => 'RedHat', :release => '7', :manage_devlog => true, },
'redhat8' => { :kernel => 'Linux', :osfamily => 'RedHat', :release => '8', :manage_devlog => true, },
'debian7' => { :kernel => 'Linux', :osfamily => 'Debian', :release => '7', :manage_devlog => false, },
'suse10' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '10', :manage_devlog => false, },
'suse11' => { :kernel => 'Linux', :osfamily => 'Suse', :release => '11', :manage_devlog => false, },
Expand Down
15 changes: 15 additions & 0 deletions spec/fixtures/logrotate.redhat8
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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
{
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}
8 changes: 8 additions & 0 deletions templates/sysconfig.rhel8.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file is being maintained by Puppet.
# DO NOT EDIT
#
# Options for rsyslogd
# Syslogd options are deprecated since rsyslog v3.
# If you want to use them, switch to compatibility mode 2 by "-c 2"
# See rsyslogd(8) for more details
SYSLOGD_OPTIONS="<%= @syslogd_options_real %>"

0 comments on commit a8ea904

Please sign in to comment.