Browse Source

Update os variables

It's 2020, let's stop using the legacy variables as much of the
information is now available via $::os

Change-Id: Id26a98a9c5385e742fb01479ec0473662df5f818
tags/1.0.0
Alex Schultz 3 months ago
parent
commit
56a1112001
3 changed files with 13 additions and 17 deletions
  1. +7
    -7
      manifests/new/params.pp
  2. +1
    -1
      manifests/new/setup.pp
  3. +5
    -9
      manifests/params.pp

+ 7
- 7
manifests/new/params.pp View File

@@ -3,11 +3,11 @@
# Common default parameter values for the Paceamker module
#
class pacemaker::new::params {
$release = split($::operatingsystemrelease, '[.]')
$major = $release[0]
$minor = $release[1]
$release = split($::os['release']['full'], '[.]')
$major = $::os['release']['major']
$minor = $::os['release']['minor']

if $::osfamily == 'RedHat' {
if $::os['family'] == 'RedHat' {
if $major >= '7' {
$package_list = ['pacemaker', 'pcs', 'fence-agents-all', 'pacemaker-libs']
$pcsd_mode = true
@@ -22,9 +22,9 @@ class pacemaker::new::params {
$cluster_user = 'hacluster'
$cluster_group = 'haclient'
$log_file_path = '/var/log/cluster/corosync.log'
} elsif $::osfamily == 'Debian' {
} elsif $::os['family'] == 'Debian' {
$pcsd_mode = false
if ($::operatingsystem == 'Ubuntu') and (versioncmp($::operatingsystemmajrelease, '16') >= 0) {
if ($::os['name'] == 'Ubuntu') and (versioncmp($::os['release']['full'], '16') >= 0) {
$package_list = ['dbus', 'pacemaker', 'corosync', 'pacemaker-cli-utils', 'resource-agents', 'crmsh']
} else {
$package_list = ['pacemaker-mgmt', 'pacemaker', 'corosync', 'pacemaker-cli-utils', 'resource-agents', 'crmsh']
@@ -33,7 +33,7 @@ class pacemaker::new::params {
$cluster_group = 'root'
$log_file_path = '/var/log/corosync/corosync.log'
} else {
fail("OS '${::operatingsystem}' is not supported!")
fail("OS '${::os['name']}' is not supported!")
}

$firewall_ipv6_manage = true


+ 1
- 1
manifests/new/setup.pp View File

@@ -23,7 +23,7 @@ class pacemaker::new::setup (
$plugin_version = $::pacemaker::new::params::plugin_version,
$log_file_path = $::pacemaker::new::params::log_file_path,
) inherits ::pacemaker::new::params {
if $::osfamily == 'Debian' {
if $::os['family'] == 'Debian' {
class { '::pacemaker::new::setup::debian' :
plugin_version => $plugin_version,
}


+ 5
- 9
manifests/params.pp View File

@@ -30,12 +30,12 @@
class pacemaker::params {

$hacluster_pwd = 'CHANGEME'
case $::osfamily {
case downcase($::facts['os']['family']) {
'redhat': {
$pcs_bin = '/sbin/pcs'
$pcsd_sysconfig = '/etc/sysconfig/pcsd'
$pcmk_sysconfig = '/etc/sysconfig/pacemaker'
if $::operatingsystemrelease =~ /^6\..*$/ {
if (versioncmp($::os['release']['major'], '7.0') < 0) {
$package_list = ['pacemaker','pcs','fence-agents','cman']
# TODO in el6.6, $pcsd_mode should be true
$pcsd_mode = false
@@ -46,13 +46,13 @@ class pacemaker::params {
$services_manager = 'systemd'
}
# Starting with 7.3 we have a separate pacemaker-remote package
if $::operatingsystemrelease =~ /7\.[012]*$/ {
if (versioncmp($::os['release']['full'], '7.2') < 1) {
$pcmk_remote_package_list = ['pacemaker','pcs','fence-agents-all','pacemaker-libs']
} else {
$pcmk_remote_package_list = ['pacemaker','pcs','fence-agents-all','pacemaker-libs', 'pacemaker-remote']
}
# Detect pcs 0.10.x versions and use different commands
if $::operatingsystemrelease =~ /8\..*$/ {
if (versioncmp($::os['release']['full'], '8.0') > 0) {
$pcs_010 = true
} else {
$pcs_010 = false
@@ -60,11 +60,7 @@ class pacemaker::params {
$service_name = 'pacemaker'
}
default: {
case $::operatingsystem {
default: {
fail("Unsupported platform: ${::osfamily}/${::operatingsystem}")
}
}
fail("Unsupported platform: ${::os['family']}")
}
}
}

Loading…
Cancel
Save