From 9f2e6f10a4883041cc3a086ee85be807af6bd4a0 Mon Sep 17 00:00:00 2001 From: "Chandan Kumar (raukadah)" Date: Wed, 22 Dec 2021 15:45:40 +0530 Subject: [PATCH] Only install required/supported fence agents This change replaces fence-agents-all package to fence-agents-redfish, fence-agents-ipmilan, fence-agents-kdump and fence-agents-rhevm. The same is proposed in https://review.opendev.org/c/openstack/tripleo-puppet-elements/+/818184 This change also fixes failure in unit tests, caused by the following warning message shown by the pcs command. Warning: stonith option 'passwd' is deprecated and should not be used, use 'password' instead Closes-Bug: #1955559 Related-Bug: #1955572 Signed-off-by: Chandan Kumar (raukadah) Change-Id: I8f5c04cea4afb8f46a8da5ab639ac984bac36cca --- bindep.txt | 5 ++++- manifests/new/params.pp | 2 +- manifests/params.pp | 6 +++--- spec/classes/pacemaker_install_spec.rb | 2 +- spec/unit/puppet/provider/cib-orig.xml | 6 +++--- spec/unit/puppet/provider/pcmk_common_spec.rb | 4 ++-- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/bindep.txt b/bindep.txt index 3048d541..144c8b0a 100644 --- a/bindep.txt +++ b/bindep.txt @@ -13,7 +13,10 @@ pacemaker-cli-utils [test platform:dpkg] pacemaker-cli [test platform:rpm] pcs [test platform:rpm] pcs [test platform:dpkg] -fence-agents-all [test platform:rpm] +fence-agents-redfish [test platform:rpm] +fence-agents-ipmilan [test platform:rpm] +fence-agents-kdump [test platform:rpm] +fence-agents-rhevm [test platform:rpm] fence-agents [test platform:dpkg] pacemaker [test platform:rpm] pacemaker [test platform:dpkg] diff --git a/manifests/new/params.pp b/manifests/new/params.pp index 87d63a08..4886fae2 100644 --- a/manifests/new/params.pp +++ b/manifests/new/params.pp @@ -8,7 +8,7 @@ class pacemaker::new::params { $minor = $::os['release']['minor'] if $::os['family'] == 'RedHat' { - $package_list = ['pacemaker', 'pcs', 'fence-agents-all', 'pacemaker-libs'] + $package_list = ['pacemaker', 'pcs', 'fence-agents-redfish', 'fence-agents-ipmilan', 'fence-agents-kdump', 'fence-agents-rhevm', 'pacemaker-libs'] $pcsd_mode = true $cluster_user = 'hacluster' $cluster_group = 'haclient' diff --git a/manifests/params.pp b/manifests/params.pp index c3c502c1..f1ee1c51 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -35,14 +35,14 @@ class pacemaker::params { $pcs_bin = '/sbin/pcs' $pcsd_sysconfig = '/etc/sysconfig/pcsd' $pcmk_sysconfig = '/etc/sysconfig/pacemaker' - $package_list = ['pacemaker','pcs','fence-agents-all','pacemaker-libs'] + $package_list = ['pacemaker','pcs','fence-agents-redfish','fence-agents-ipmilan','fence-agents-kdump','fence-agents-rhevm','pacemaker-libs'] $pcsd_mode = true $services_manager = 'systemd' # Starting with 7.3 we have a separate pacemaker-remote package if (versioncmp($::os['release']['full'], '7.2') < 1) { - $pcmk_remote_package_list = ['pacemaker','pcs','fence-agents-all','pacemaker-libs'] + $pcmk_remote_package_list = ['pacemaker','pcs','fence-agents-redfish','fence-agents-ipmilan','fence-agents-kdump','fence-agents-rhevm','pacemaker-libs'] } else { - $pcmk_remote_package_list = ['pacemaker','pcs','fence-agents-all','pacemaker-libs', 'pacemaker-remote'] + $pcmk_remote_package_list = ['pacemaker','pcs','fence-agents-redfish','fence-agents-ipmilan','fence-agents-kdump','fence-agents-rhevm','pacemaker-libs','pacemaker-remote'] } # Detect pcs 0.10.x versions and use different commands. # If full version == '8', we're using 8-stream or check if newer than 8.0 diff --git a/spec/classes/pacemaker_install_spec.rb b/spec/classes/pacemaker_install_spec.rb index a44d3830..5884634c 100644 --- a/spec/classes/pacemaker_install_spec.rb +++ b/spec/classes/pacemaker_install_spec.rb @@ -7,7 +7,7 @@ describe 'pacemaker::new::install', type: :class do package_list = begin if facts[:osfamily] == 'RedHat' - %w(pacemaker pcs fence-agents-all pacemaker-libs) + %w(pacemaker pcs fence-agents-redfish fence-agents-ipmilan fence-agents-kdump fence-agents-rhevm pacemaker-libs) elsif facts[:osfamily] == 'Debian' if facts[:operatingsystem] == 'Ubuntu' && facts[:operatingsystemmajrelease].to_i >= 16 %w(pacemaker corosync pacemaker-cli-utils resource-agents) diff --git a/spec/unit/puppet/provider/cib-orig.xml b/spec/unit/puppet/provider/cib-orig.xml index d54bb606..d6bfef9a 100644 --- a/spec/unit/puppet/provider/cib-orig.xml +++ b/spec/unit/puppet/provider/cib-orig.xml @@ -32,7 +32,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -52,7 +52,7 @@ - + diff --git a/spec/unit/puppet/provider/pcmk_common_spec.rb b/spec/unit/puppet/provider/pcmk_common_spec.rb index fdddde3d..57315b8a 100644 --- a/spec/unit/puppet/provider/pcmk_common_spec.rb +++ b/spec/unit/puppet/provider/pcmk_common_spec.rb @@ -17,12 +17,12 @@ describe "pcmk_common functions" do it "pcs_offline noop update" do expect(pcs_offline('resource update ip-172.16.11.97 cidr_netmask=32', 'cib-noop.xml')).to eq "" - expect(pcs_offline('resource update stonith-fence_ipmilan-stonith-fence-1 passwd=renVamyep3!', 'cib-noop.xml')).to eq "" + expect(pcs_offline('resource update stonith-fence_ipmilan-stonith-fence-1 password=renVamyep3!', 'cib-noop.xml')).to eq "" end it "pcs_offline update to resource definition" do expect(pcs_offline('resource update ip-172.16.11.97 cidr_netmask=31', 'cib-resource.xml')).to eq "" - expect(pcs_offline('resource update stonith-fence_ipmilan-stonith-fence-1 passwd=NewPassword', 'cib-resource.xml')).to eq "" + expect(pcs_offline('resource update stonith-fence_ipmilan-stonith-fence-1 password=NewPassword', 'cib-resource.xml')).to eq "" end it "pcs_offline update to bundle definition" do