Skip to content

Commit

Permalink
Do registering all needed modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Varkoly committed Feb 14, 2024
2 parents 39485ae + 791b62c commit fd13247
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 39 deletions.
12 changes: 12 additions & 0 deletions package/sap-installation-wizard.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
-------------------------------------------------------------------
Mon Feb 5 09:08:23 UTC 2024 - Peter Varkoly <varkoly@suse.com>

- BusinessOne installer:
o Adapt installed services.
o Use hostname as local address."
- Implementing selecting SAP HANA XS Routing Mode.
sap-installation-wizard does not handle xs_routing_mode (bsc#1216648)
Remove deprecated MDC stuff: (bsc#1083546) mdc is now default for hana 2.0 sps1
- Missed dependency in patterns-sap-bone (bsc#1219569)
- 4.6.10

-------------------------------------------------------------------
Fri Jan 19 08:39:28 UTC 2024 - Peter Varkoly <varkoly@suse.com>

Expand Down
6 changes: 4 additions & 2 deletions package/sap-installation-wizard.spec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Name: sap-installation-wizard
Summary: Installation wizard for SAP applications
License: GPL-2.0+
Group: System/YaST
Version: 4.6.9
Version: 4.6.10
Release: 0
PreReq: /bin/mkdir %fillup_prereq yast2
Requires: autoyast2
Expand Down Expand Up @@ -60,13 +60,15 @@ Authors:
Summary: Installation wizard for SAP Business One applications
License: GPL-2.0+
Group: System/YaST
Version: 4.6.9
Version: 4.6.10
Release: 0
PreReq: /bin/mkdir %fillup_prereq yast2
BuildRequires: yast2
BuildRequires: sapconf
Requires: autoyast2
Requires: autoyast2-installation
Requires: patterns-sap-hana
Requires: patterns-sap-bone
Requires: rubygem(%{rb_default_ruby_abi}:nokogiri)
Requires: xfsprogs
PreReq: logrotate
Expand Down
3 changes: 2 additions & 1 deletion src/bin/b1_inst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ HANA_DATABASE_USER_ID=SYSTEM
LANDSCAPE_INSTALL_ACTION=create
LICENSE_SERVER_ACTION=register
LICENSE_SERVER_NODE=standalone
SELECTED_FEATURES=B1ServerToolsSLD,B1ServerToolsExtensionManager,B1ServerToolsLicense,B1BackupService,B1ServerSHR,B1ServerCommonDB
LOCAL_ADDRESS=myhostname
SELECTED_FEATURES=B1ServerToolsSLD,B1ServerToolsExtensionManager,B1ServerToolsLicense,B1ServerToolsJobService,B1ServerToolsMobileService,B1ServerToolsXApp,B1SLDAgent,B1WebClient,B1BackupService,B1ServerSHR,B1ServerCommonDB,B1ServerHelp_EN,B1ServerAddons,B1ServerOI,B1AnalyticsOlap,B1AnalyticsTomcatEntSearch,B1AnalyticsTomcatDashboard,B1AnalyticsTomcatReplication,B1AnalyticsTomcatConfiguration,B1AnalyticsTomcatPredictiveAnalysis,B1ServiceLayerComponent,B1ElectronicDocumentService,B1APIGatewayService
SITE_USER_ID=B1SiteUser
SLD_CERTIFICATE_ACTION=self
SLD_DATABASE_ACTION=create
Expand Down
28 changes: 9 additions & 19 deletions src/bin/hana_inst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,9 @@ INSTALL_COUNT=$(echo ${MEDIA_TARGET} | awk -F '/' '{print $NF}')
A_MASTERPASS="${MEDIA_TARGET}/ay_q_masterPwd"
A_SID="${MEDIA_TARGET}/ay_q_sid"
A_SAPINSTNR="${MEDIA_TARGET}/ay_q_sapinstnr"
A_FILES="${A_SID} ${A_SAPINSTNR} ${A_MASTERPASS}"
if [ -e ${MEDIA_TARGET}/ay_q_sapmdc ]; then
A_SAPMDC=$(cat ${MEDIA_TARGET}/ay_q_sapmdc)
fi

A_XS_ROUTING_MODE="${MEDIA_TARGET}/ay_q_xs_routing_mode"
A_XS_DOMAIN_NAME="${MEDIA_TARGET}/ay_q_xs_domain_name"
A_FILES="${A_SID} ${A_SAPINSTNR} ${A_MASTERPASS} ${A_XS_ROUTING} ${A_XS_DOMAIN_NAME}"
###########################################
# Define ERRORS section
###########################################
Expand Down Expand Up @@ -162,6 +160,9 @@ hana_get_input()
if [ -z "${MASTERPASS}" ]; then
echo "Warning: MASTERPASS not set!"
fi

[ -f ${A_XS_DOMAIN_NAME} ] && A_XS_DOMAIN_NAME=$(cat ${A_XS_DOMAIN_NAME})
[ -f ${A_XS_ROUTING_MODE} ] && A_XS_ROUTING_MODE=$(cat ${A_XS_ROUTING_MODE})
}

hana_setenv_lcm()
Expand Down Expand Up @@ -254,23 +255,12 @@ hana_lcm_workflow()
rc=1
return $rc
fi
case $A_SAPMDC in
no)
echo -e "db_mode=\n" > ${MEDIA_TARGET}/hana_mdc.conf
;;
low)
echo -e "db_mode=multidb\ndb_isolation=low\n" > ${MEDIA_TARGET}/hana_mdc.conf
;;
high)
echo -e "db_mode=multidb\ndb_isolation=high\n" > ${MEDIA_TARGET}/hana_mdc.conf
;;
esac
cd "${HDBLCMDIR}"
TOIGNORE="check_signature_file"
if [ -e /root/hana-install-ignore ]; then
TOIGNORE=$(cat /root/hana-install-ignore)
fi
if [ -e ${MEDIA_TARGET}/hana_mdc.conf ]; then
if [ ${XS_ROUTING_MODE} == "ports" ]; then
cat ~/pwds.xml | ./hdblcm --batch --action=install \
--ignore=$TOIGNORE \
--lss_trust_unsigned_server \
Expand All @@ -279,7 +269,6 @@ hana_lcm_workflow()
--number=${SAPINSTNR} \
--groupid=79 \
--read_password_from_stdin=xml \
--configfile=${MEDIA_TARGET}/hana_mdc.conf \
--xs_routing_mode=ports
else
cat ~/pwds.xml | ./hdblcm --batch --action=install \
Expand All @@ -290,7 +279,8 @@ hana_lcm_workflow()
--number=${SAPINSTNR} \
--groupid=79 \
--read_password_from_stdin=xml \
--xs_routing_mode=ports
--xs_routing_mode=${XS_ROUTING_MODE} \
--xs_domain_name="${XS_DOMAIN_NAME}"
fi
rc=$?
rm ~/pwds.xml
Expand Down
33 changes: 31 additions & 2 deletions src/clients/inst_sap-start.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,17 @@
module Yast
# Select basic installation profile
class InstSapStart < Client
include Yast::Logger
BONE_REQUIRED_MODULES = [
"sle-module-desktop-applications",
"sle-module-development-tools",
"sle-module-legacy",
"sle-module-server-applications"
]

def main
textdomain "sap-installation-wizard"
Yast.import "Arch"
Yast.import "Package"
Yast.import "Popup"
Yast.import "PackagesProposal"
Expand All @@ -55,7 +64,7 @@ def main
when :help
Wizard.ShowHelp(@help)
when :next
constumize_sap_installation(
costumize_sap_installation(
Convert.to_boolean(UI.QueryWidget(Id("wizard"), :Value)),
Convert.to_boolean(UI.QueryWidget(Id("rdp"), :Value))
)
Expand All @@ -67,7 +76,7 @@ def main
ret
end

def constumize_sap_installation(start_wizard, start_rdp)
def costumize_sap_installation(start_wizard, start_rdp)
to_install = []
to_remove = []
ProductControl.DisableModule("user_first")
Expand All @@ -89,6 +98,7 @@ def constumize_sap_installation(start_wizard, start_rdp)
end
PackagesProposal.AddResolvables("sap-wizard", :package, to_install)
PackagesProposal.RemoveResolvables("sap-wizard", :package, to_remove) if !to_remove.empty?
install_bone_required_modules if @wizard == "bone-installation-wizard"
end

def set_variable
Expand Down Expand Up @@ -124,6 +134,25 @@ def set_variable
)
)
end

def install_bone_required_modules
require "registration/registration"
require "registration/storage"
options = Registration::Storage::InstallationOptions.instance
version = Yast::OSRelease.ReleaseVersion
arch = Yast::Arch.rpm_arch
reg = Registration::Registration.new
BONE_REQUIRED_MODULES.each do |product|
product_data = {
"name" => product,
"reg_code" => options.reg_code,
"arch" => arch,
"version" => version
}
log.info("Bone required SLE Module: #{product} #{arch} #{version}")
reg.register_product(product_data)
end
end
end
end

Expand Down
27 changes: 14 additions & 13 deletions src/data/y2sap/HANA.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,11 @@ exit $?
<file>/var/run/sap-wizard/ay_q_xs_routing_mode</file>
<question>SAP HANA XS Routing Mode</question>
<stage>cont</stage>
<selection config:type="list"><default>hostname</defualt><default>ports^</defualt></selection>
<script>
<filename>xs_routing_mode.sh</filename>
<rerun_on_error config:type="boolean">true</rerun_on_error>
<environment config:type="boolean">true</environment>
<source><![CDATA[
/usr/lib/YaST2/bin/sap_check_admin_pw.sh HANA
exit $?
]]></source>
<debug config:type="boolean">false</debug>
<feedback config:type="boolean">true</feedback>
</script>
<default>ports</default>
<selection config:type="list">
<entry><value>hostname</value><label>hostname</label></entry>
<entry><value>ports</value><label>ports</label></entry>
</selection>
</ask>
<ask>
<title>SAP HANA System Parameters</title>
Expand All @@ -164,7 +157,15 @@ exit $?
<rerun_on_error config:type="boolean">true</rerun_on_error>
<environment config:type="boolean">true</environment>
<source><![CDATA[
exit $?
MODE=$( cat /var/run/sap-wizard/ay_q_xs_routing_mode )
if [ $MODE == "hostname" ]; then
DOMAIN=$( cat /var/run/sap-wizard/ay_q_xs_domain_name )
if [ -z "$DOMAIN" ]; then
echo "You have to define the SAP HANA XS Domain Name"
exit 1
fi
fi
exit 0
]]></source>
<debug config:type="boolean">false</debug>
<feedback config:type="boolean">true</feedback>
Expand Down
15 changes: 13 additions & 2 deletions src/lib/y2sap/auto.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,25 @@ def prepare_hana(prod)
@error = true
return :abort
end
!prod.key?("sapMDC") || prod["sapMDC"] = "no"
File.write(@inst_dir + "/ay_q_masterPwd", prod["sapMasterPW"])
File.write(@inst_dir + "/ay_q_sid", prod["sid"])
File.write(@inst_dir + "/ay_q_sapinstnr", prod["sapInstNr"])
File.write(@inst_dir + "/ay_q_sapmdc", prod["sapMDC"])
if prod.key?("sapVirtHostname")
File.write(@inst_dir + "/ay_q_virt_hostname", prod["sapVirtHostname"])
end
xs_routing_mode = prod.key?("xsRoutingMode") ? prod.key?("xsRoutingMode") : "ports"
if !["hostname", "ports"].include?(xs_routing_mode)
Yast::Popup.Error("Bad XS routing mode: #{xs_routing_mode}. Provided values are 'hostname' or 'ports'")
@error = true
return :abort
end
if xs_routing_mode == "hostname" && !prod.key?("xsDomainName")
Yast::Popup.Error("If XS routing mode is set to hostname you have to define xsDomainName also")
@error = true
return :abort
end
File.write(@inst_dir + "/ay_q_xs_routing_mode", xs_routing_mode)
File.write(@inst_dir + "/ay_q_xs_domain_name", prod["xsDomainName"]) if prod.key?("xsDomainName")
@sid = prod["sid"]
SCR.Execute(path(".target.bash"), "chgrp sapinst " + @inst_dir)
SCR.Execute(path(".target.bash"), "chmod 775 " + @inst_dir)
Expand Down

0 comments on commit fd13247

Please sign in to comment.