Skip to content

Commit

Permalink
Add EL8 & EL9 support and claim compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Doninelli Davide authored and Doninelli Davide committed Oct 8, 2024
1 parent 6f30219 commit 928cdd0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
2 changes: 2 additions & 0 deletions data/os/RedHat/8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
corosync::config_validate_cmd: "/usr/sbin/corosync -c % -t"
2 changes: 2 additions & 0 deletions data/os/RedHat/9.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
corosync::config_validate_cmd: "/usr/sbin/corosync -c % -t"
8 changes: 6 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7"
"7",
"8",
"9"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7"
"7",
"8",
"9"
]
},
{
Expand Down
27 changes: 21 additions & 6 deletions spec/classes/corosync_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@
)
end

it 'validates the corosync configuration' do
is_expected.to contain_file('/etc/corosync/corosync.conf').with_validate_cmd(
'/usr/bin/env COROSYNC_MAIN_CONFIG_FILE=% /usr/sbin/corosync -t'
)
end

context 'validates the corosncy configuration when config_validate_cmd is set' do
let(:params) do
super().merge(
Expand Down Expand Up @@ -730,6 +724,27 @@

it_configures 'corosync'

# Check the correct validation command is used for each OS
it 'validates the corosync configuration' do
case os_facts[:os]['family']
when 'RedHat'
case os_facts[:os]['release']['major'].to_i
when 0..7
is_expected.to contain_file('/etc/corosync/corosync.conf').with_validate_cmd(
'/usr/bin/env COROSYNC_MAIN_CONFIG_FILE=% /usr/sbin/corosync -t'
)
else
is_expected.to contain_file('/etc/corosync/corosync.conf').with_validate_cmd(
'/usr/sbin/corosync -c % -t'
)
end
else
is_expected.to contain_file('/etc/corosync/corosync.conf').with_validate_cmd(
'/usr/bin/env COROSYNC_MAIN_CONFIG_FILE=% /usr/sbin/corosync -t'
)
end
end

# Check default package installations per platform
case os_facts[:os]['family']
when 'RedHat'
Expand Down

0 comments on commit 928cdd0

Please sign in to comment.