Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt to new SAPHanaSR-angi #54

Merged
merged 20 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions package/yast2-sap-ha.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Wed Jan 29 11:06:24 UTC 2025 - Peter Varkoly <varkoly@suse.com>

- yast-sap-ha does not support SAPHanaSR-angi (bsc#1232807)
Fix used templates
Add missed distinguishing between classic and angi
#458 [doc] Issue in "Constraints for SAPHanaSR-angi"
https://github.com/SUSE/suse-best-practices/issues/458
- 6.0.3

-------------------------------------------------------------------
Mon Nov 4 21:34:50 UTC 2024 - Peter Varkoly <varkoly@suse.com>

Expand Down
4 changes: 2 additions & 2 deletions package/yast2-sap-ha.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# spec file for package yast2-sap-ha
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
Expand All @@ -17,7 +17,7 @@


Name: yast2-sap-ha
Version: 6.0.2
Version: 6.0.3
Release: 0
BuildArch: noarch
Source0: %{name}-%{version}.tar.bz2
Expand Down
3 changes: 3 additions & 0 deletions src/data/sap_ha/SUDOERS_HANASR.angi.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SAPHanaSR-ScaleUp entries for writing srHook cluster attribute
<%= @system_id -%>adm ALL=(ALL) NOPASSWD: /usr/bin/SAPHanaSR-hookHelper --sid=<%= @system_id -%> *
<%= @system_id -%>adm ALL=(ALL) NOPASSWD: /usr/sbin/crm_attribute -n hana_<%= @system_id -%>_site_srHook_*
10 changes: 5 additions & 5 deletions src/data/sap_ha/tmpl_cluster_config.angi.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ primitive rsc_SAPHanaCon_<%= @system_id -%>_HDB<%= @instance -%> ocf:suse:SAPHan
DUPLICATE_PRIMARY_TIMEOUT=600 AUTOMATED_REGISTER="<%= @auto_register -%>" \
meta priority="100"

clone msl_SAPHana_<%= @system_id -%>_HDB<%= @instance -%> rsc_SAPHanaCon_<%= @system_id -%>_HDB<%= @instance -%> \
clone mst_SAPHanaCon_<%= @system_id -%>_HDB<%= @instance -%> rsc_SAPHanaCon_<%= @system_id -%>_HDB<%= @instance -%> \
meta clone-max=2 clone-node-max=1 interleave=true promotable=true

primitive rsc_ip_<%= @system_id -%>_HDB<%= @instance -%> ocf:heartbeat:IPaddr2 \
Expand All @@ -63,17 +63,17 @@ group g_ip_<%= @system_id -%>_HDB<%= @instance -%> rsc_ip_<%= @system_id -%>_HDB
#

colocation col_saphana_ip_<%= @system_id -%>_HDB<%= @instance -%> <%= @additional_instance ? "3000" : "2000" -%>: g_ip_<%= @system_id -%>_HDB<%= @instance -%>:Started \
msl_SAPHana_<%= @system_id -%>_HDB<%= @instance -%>:Master
mst_SAPHanaCon_<%= @system_id -%>_HDB<%= @instance -%>:Master

<% else %>

colocation col_saphana_ip_<%= @system_id -%>_HDB<%= @instance -%> <%= @additional_instance ? "3000" : "2000" -%>: rsc_ip_<%= @system_id -%>_HDB<%= @instance -%>:Started \
msl_SAPHana_<%= @system_id -%>_HDB<%= @instance -%>:Master
mst_SAPHanaCon_<%= @system_id -%>_HDB<%= @instance -%>:Master

<% end %>

order ord_SAPHana_<%= @system_id -%>_HDB<%= @instance -%> Optional: cln_SAPHanaTop_<%= @system_id -%>_HDB<%= @instance -%> \
msl_SAPHana_<%= @system_id -%>_HDB<%= @instance -%>
mst_SAPHanaCon_<%= @system_id -%>_HDB<%= @instance -%>

<% if @additional_instance %>

Expand All @@ -96,6 +96,6 @@ colocation col_<%= @np_system_id -%>_never_with_<%= @system_id -%>ip -inf: rsc_S

order ord_<%= @np_system_id -%>_stop_before_<%= @system_id -%>-promote mandatory: \
rsc_SAP_<%= @np_system_id -%>_HDB<%= @np_instance -%>:stop \
msl_SAPHana_<%= @system_id -%>_HDB<%= @instance -%>:promote
mst_SAPHanaCon_<%= @system_id -%>_HDB<%= @instance -%>:promote

<% end %>
9 changes: 6 additions & 3 deletions src/lib/sap_ha/configuration/hana.rb
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,10 @@ def wait_idle(node)
end

def activating_msr
msr = "msl_SAPHana_#{@system_id}_HDB#{@instance}"
msr = "mst_SAPHanaCon_#{@system_id}_HDB#{@instance}"
if @rsa_version == "classic"
msr = "msl_SAPHana_#{@system_id}_HDB#{@instance}"
end
out, status = exec_outerr_status("crm", "resource", "refresh", msr)
@nlog.log_status(status.exitstatus == 0,
"#{msr} status refresh OK",
Expand Down Expand Up @@ -402,8 +405,8 @@ def configure_firewall(role)

# Creates the sudoers file
def adapt_sudoers
if File.exist?(SapHA::Helpers.data_file_path("SUDOERS_HANASR.erb"))
Helpers.write_file("/etc/sudoers.d/saphanasr.conf", Helpers.render_template("SUDOERS_HANASR.erb", binding))
if File.exist?(SapHA::Helpers.data_file_path("SUDOERS_HANASR.#{@rsa_version}.erb"))
Helpers.write_file("/etc/sudoers.d/saphanasr.conf", Helpers.render_template("SUDOERS_HANASR.#{@rsa_version}.erb", binding))
end
end

Expand Down