Skip to content

Commit 928cdd0

Browse files
Doninelli DavideDoninelli Davide
authored andcommitted
Add EL8 & EL9 support and claim compatibility
copy of voxpupuli#527
1 parent 6f30219 commit 928cdd0

File tree

4 files changed

+31
-8
lines changed

4 files changed

+31
-8
lines changed

data/os/RedHat/8.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
corosync::config_validate_cmd: "/usr/sbin/corosync -c % -t"

data/os/RedHat/9.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
corosync::config_validate_cmd: "/usr/sbin/corosync -c % -t"

metadata.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@
1111
{
1212
"operatingsystem": "RedHat",
1313
"operatingsystemrelease": [
14-
"7"
14+
"7",
15+
"8",
16+
"9"
1517
]
1618
},
1719
{
1820
"operatingsystem": "CentOS",
1921
"operatingsystemrelease": [
20-
"7"
22+
"7",
23+
"8",
24+
"9"
2125
]
2226
},
2327
{

spec/classes/corosync_spec.rb

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@
1717
)
1818
end
1919

20-
it 'validates the corosync configuration' do
21-
is_expected.to contain_file('/etc/corosync/corosync.conf').with_validate_cmd(
22-
'/usr/bin/env COROSYNC_MAIN_CONFIG_FILE=% /usr/sbin/corosync -t'
23-
)
24-
end
25-
2620
context 'validates the corosncy configuration when config_validate_cmd is set' do
2721
let(:params) do
2822
super().merge(
@@ -730,6 +724,27 @@
730724

731725
it_configures 'corosync'
732726

727+
# Check the correct validation command is used for each OS
728+
it 'validates the corosync configuration' do
729+
case os_facts[:os]['family']
730+
when 'RedHat'
731+
case os_facts[:os]['release']['major'].to_i
732+
when 0..7
733+
is_expected.to contain_file('/etc/corosync/corosync.conf').with_validate_cmd(
734+
'/usr/bin/env COROSYNC_MAIN_CONFIG_FILE=% /usr/sbin/corosync -t'
735+
)
736+
else
737+
is_expected.to contain_file('/etc/corosync/corosync.conf').with_validate_cmd(
738+
'/usr/sbin/corosync -c % -t'
739+
)
740+
end
741+
else
742+
is_expected.to contain_file('/etc/corosync/corosync.conf').with_validate_cmd(
743+
'/usr/bin/env COROSYNC_MAIN_CONFIG_FILE=% /usr/sbin/corosync -t'
744+
)
745+
end
746+
end
747+
733748
# Check default package installations per platform
734749
case os_facts[:os]['family']
735750
when 'RedHat'

0 commit comments

Comments
 (0)