Skip to content

Commit 5ee3bfe

Browse files
Doninelli DavideDoninelli Davide
authored andcommitted
support for RH subscription repo e CentOS9
1 parent 252ddfd commit 5ee3bfe

File tree

5 files changed

+34
-3
lines changed

5 files changed

+34
-3
lines changed

data/os/CentOS/9.yaml

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

data/os/RedHat/8.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
---
2-
corosync::config_validate_cmd: "/usr/sbin/corosync -c % -t"
2+
corosync::config_validate_cmd: "/usr/sbin/corosync -c % -t"
3+
corosync::highavailability_repo: "rhel-8-for-x86_64-highavailability-rpms"

data/os/RedHat/9.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
---
2-
corosync::config_validate_cmd: "/usr/sbin/corosync -c % -t"
2+
corosync::config_validate_cmd: "/usr/sbin/corosync -c % -t"
3+
corosync::highavailability_repo: "rhel-9-for-x86_64-highavailability-rpms"

manifests/init.pp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@
136136
# Additional install-options for the pcs package resource.
137137
# Default: undef
138138
#
139+
# @param #highavailability_repo
140+
# Whether the module should enable the corosync service.
141+
#
139142
# @param ensure_corosync
140143
# Define what version of the corosync package should be installed.
141144
# Default: 'present'
@@ -404,6 +407,7 @@
404407
Optional[Variant[Stdlib::Absolutepath, Enum['off']]] $watchdog_device = undef,
405408
Enum['pcs', 'crm'] $provider = 'pcs',
406409
String $pcs_version = '', # lint:ignore:params_empty_string_assignment
410+
String[1] $highavailability_repo = unfed
407411
) inherits corosync::params {
408412
if $set_votequorum and (empty($quorum_members) and empty($multicast_address) and !$cluster_name) {
409413
fail('set_votequorum is true, so you must set either quorum_members, or one of multicast_address or cluster_name.')
@@ -417,6 +421,29 @@
417421
fail('quorum_members_ids may not be used without the quorum_members.')
418422
}
419423

424+
# Enable High Availability repository
425+
case $facts['os']['name'] {
426+
'RedHat': {
427+
if $facts['os']['release']['major'] > 7 {
428+
exec { 'enable_highavailability_repo':
429+
command => "subscription-manager repos --enable=${highavailability_repo}",
430+
path => '/usr/bin:/usr/sbin:/bin:/sbin',
431+
unless => "yum repolist enabled | grep -q ${highavailability_repo}",
432+
}
433+
}
434+
}
435+
'CentOS': {
436+
if $facts['os']['release']['major'] == 9 {
437+
exec { 'enable_highavailability_repo':
438+
command => "yum config-manager --set-enabled ${highavailability_repo}",
439+
path => '/usr/bin:/usr/sbin:/bin:/sbin',
440+
unless => "yum repolist enabled | grep -q ${highavailability_repo}",
441+
}
442+
}
443+
}
444+
default: {}
445+
}
446+
420447
if $package_corosync {
421448
package { 'corosync':
422449
ensure => $ensure_corosync,

metadata.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"operatingsystem": "CentOS",
2121
"operatingsystemrelease": [
2222
"7",
23-
"8",
2423
"9"
2524
]
2625
},

0 commit comments

Comments
 (0)