Skip to content

Commit 6bff22d

Browse files
ludwig-muellersurajsbharadwajstafaniasaju
authored
feat: upgrade power_linux_sap roles (#741)
--------- Co-authored-by: surajsbharadwaj <101711050+surajsbharadwaj@users.noreply.github.com> Co-authored-by: surajsbharadwaj <suraj.bharadwaj@ibm.com> Co-authored-by: stafaniasaju <109294118+stafaniasaju@users.noreply.github.com>
1 parent d028bc4 commit 6bff22d

File tree

20 files changed

+111
-119
lines changed

20 files changed

+111
-119
lines changed

.secrets.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.sum|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2024-10-31T15:08:37Z",
6+
"generated_at": "2024-12-06T13:41:59Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"

modules/ansible/ansible_node_packages.sh

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,46 @@
44
# This bash script performs #
55
# - installation of packages #
66
# - ansible galaxy collections. #
7-
# - updates the OS #
7+
# #
88
############################################################
99

1010
GLOBAL_RHEL_PACKAGES="rhel-system-roles rhel-system-roles-sap expect"
11-
GLOBAL_GALAXY_COLLLECTIONS="ibm.power_linux_sap:2.1.1 ansible.utils:3.1.0 ansible.posix:1.5.4 community.general:8.4.0"
11+
GLOBAL_GALAXY_COLLECTIONS="ibm.power_linux_sap:>=3.0.0,<4.0.0 ansible.posix:1.5.4 ansible.utils:4.1.0 community.general:10.0.1"
1212

1313
############################################################
1414
# Start functions
1515
############################################################
1616

1717
main::get_os_version() {
18-
if grep -q "Red Hat" /etc/os-release; then
19-
readonly LINUX_DISTRO="RHEL"
20-
else
21-
main::log_error "Unsupported Linux distribution. Only RHEL is supported."
22-
fi
23-
#readonly LINUX_VERSION=$(grep VERSION_ID /etc/os-release | awk -F '\"' '{ print $2 }')
18+
if grep -q "Red Hat" /etc/os-release; then
19+
readonly LINUX_DISTRO="RHEL"
20+
else
21+
main::log_error "Unsupported Linux distribution. Only RHEL is supported."
22+
fi
23+
#readonly LINUX_VERSION=$(grep VERSION_ID /etc/os-release | awk -F '\"' '{ print $2 }')
2424
}
2525

2626
main::log_info() {
27-
local log_entry=${1}
28-
echo "INFO - ${log_entry}"
27+
local log_entry=${1}
28+
echo "INFO - ${log_entry}"
2929
}
3030

3131
main::log_error() {
32-
local log_entry=${1}
33-
echo "ERROR - Deployment exited - ${log_entry}"
34-
exit 1
32+
local log_entry=${1}
33+
echo "ERROR - Deployment exited - ${log_entry}"
34+
exit 1
3535
}
3636

3737
main::subscription_mgr_check_process() {
3838

39-
main::log_info "Sleeping 30 seconds for all subscription-manager process to finish."
40-
sleep 30
39+
main::log_info "Sleeping 30 seconds for all subscription-manager process to finish."
40+
sleep 30
4141

42-
## check if subscription-manager is still running
43-
while pgrep subscription-manager; do
44-
main::log_info "--- subscription-manager is still running. Waiting 10 seconds before attempting to continue"
45-
sleep 10s
46-
done
42+
## check if subscription-manager is still running
43+
while pgrep subscription-manager; do
44+
main::log_info "--- subscription-manager is still running. Waiting 10 seconds before attempting to continue"
45+
sleep 10s
46+
done
4747

4848
}
4949

@@ -52,46 +52,46 @@ main::subscription_mgr_check_process() {
5252
############################################################
5353
main::install_packages() {
5454

55-
if [[ ${LINUX_DISTRO} = "RHEL" ]]; then
56-
57-
main::subscription_mgr_check_process
58-
59-
## enable repository for RHEL sap roles
60-
subscription-manager repos --enable="rhel-$(rpm -E %rhel)-for-$(uname -m)-sap-solutions-rpms"
61-
62-
## Install packages
63-
for package in $GLOBAL_RHEL_PACKAGES; do
64-
local count=0
65-
local max_count=3
66-
while ! dnf -y install "${package}"; do
67-
count=$((count + 1))
68-
sleep 3
69-
# shellcheck disable=SC2317
70-
if [[ ${count} -gt ${max_count} ]]; then
71-
main::log_error "Failed to install ${package}"
72-
break
73-
fi
74-
done
75-
done
76-
77-
## Download and install collections from ansible-galaxy
78-
79-
for collection in $GLOBAL_GALAXY_COLLLECTIONS; do
80-
local count=0
81-
local max_count=3
82-
while ! ansible-galaxy collection install "${collection}"; do
83-
count=$((count + 1))
84-
sleep 3
85-
# shellcheck disable=SC2317
86-
if [[ ${count} -gt ${max_count} ]]; then
87-
main::log_error "Failed to install ansible galaxy collection ${collection}"
88-
break
89-
fi
90-
done
91-
done
92-
93-
main::log_info "All packages installed successfully"
94-
fi
55+
if [[ ${LINUX_DISTRO} = "RHEL" ]]; then
56+
57+
main::subscription_mgr_check_process
58+
59+
## enable repository for RHEL sap roles
60+
subscription-manager repos --enable="rhel-$(rpm -E %rhel)-for-$(uname -m)-sap-solutions-rpms"
61+
62+
## Install packages
63+
for package in $GLOBAL_RHEL_PACKAGES; do
64+
local count=0
65+
local max_count=3
66+
while ! dnf -y install "${package}"; do
67+
count=$((count + 1))
68+
sleep 3
69+
# shellcheck disable=SC2317
70+
if [[ ${count} -gt ${max_count} ]]; then
71+
main::log_error "Failed to install ${package}"
72+
break
73+
fi
74+
done
75+
done
76+
77+
## Download and install collections from ansible-galaxy
78+
79+
for collection in $GLOBAL_GALAXY_COLLECTIONS; do
80+
local count=0
81+
local max_count=3
82+
while ! ansible-galaxy collection install "${collection}" -f; do
83+
count=$((count + 1))
84+
sleep 3
85+
# shellcheck disable=SC2317
86+
if [[ ${count} -gt ${max_count} ]]; then
87+
main::log_error "Failed to install ansible galaxy collection ${collection}"
88+
break
89+
fi
90+
done
91+
done
92+
93+
main::log_info "All packages installed successfully"
94+
fi
9595

9696
}
9797

modules/ansible/templates-ansible/configure-network-services/playbook-configure-network-services.yml.tftpl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,5 @@
1313
client_config: ${client_config}
1414

1515
roles:
16-
- role: ibm.power_linux_sap.powervs_client_enable_services
17-
when: client_config.keys()|length > 0
18-
- role: ibm.power_linux_sap.powervs_install_services
19-
when: server_config.keys()|length > 0
16+
- role: ibm.power_linux_sap.configure_network_management_services
17+
when: client_config.keys()|length > 0 or server_config.keys()|length > 0

modules/ansible/templates-ansible/configure-os-for-sap/playbook-configure-os-for-sap.yml.tftpl

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,9 @@
1515
sap_domain: ${sap_domain}
1616

1717
roles:
18-
- { role: ibm.power_linux_sap.powervs_prepare_rhel_sap, when: sap_solution is defined and ansible_distribution is match("RedHat*") }
19-
- { role: ibm.power_linux_sap.powervs_prepare_sles_sap, when: sap_solution is defined and ansible_distribution is match("SLES*") }
18+
- { role: ibm.power_linux_sap.powervs_configure_os_for_sap, when: sap_solution is defined }
2019

2120
tasks:
22-
- include_role:
23-
name: redhat.sap_install.sap_general_preconfigure
24-
vars:
25-
sap_general_preconfigure_fail_if_reboot_required: no
26-
when:
27-
- ansible_distribution is match("RedHat*")
28-
- sap_solution is defined
29-
30-
- include_role:
31-
name: redhat.sap_install.sap_hana_preconfigure
32-
vars:
33-
sap_hana_preconfigure_fail_if_reboot_required: no
34-
when:
35-
- ansible_distribution is match("RedHat*")
36-
- sap_solution is defined
37-
- sap_solution is match("HANA")
38-
39-
- include_role:
40-
name: redhat.sap_install.sap_netweaver_preconfigure
41-
when:
42-
- ansible_distribution is match("RedHat*")
43-
- sap_solution is defined
44-
- sap_solution is match("NETWEAVER")
45-
4621
- name: Reboot the machine with timeout 10 mins
4722
ansible.builtin.reboot:
4823

modules/pi-sap-system-type1/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The Power Virtual Server for SAP module automates the following tasks:
2424
| Name | Version |
2525
|------|---------|
2626
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9.0 |
27-
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.70.1 |
27+
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.71.3 |
2828
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.9.1 |
2929

3030
### Modules
@@ -34,10 +34,10 @@ The Power Virtual Server for SAP module automates the following tasks:
3434
| <a name="module_ansible_netweaver_sapmnt_mount"></a> [ansible\_netweaver\_sapmnt\_mount](#module\_ansible\_netweaver\_sapmnt\_mount) | ../ansible | n/a |
3535
| <a name="module_ansible_sap_instance_init"></a> [ansible\_sap\_instance\_init](#module\_ansible\_sap\_instance\_init) | ../ansible | n/a |
3636
| <a name="module_ansible_sharefs_instance_exportfs"></a> [ansible\_sharefs\_instance\_exportfs](#module\_ansible\_sharefs\_instance\_exportfs) | ../ansible | n/a |
37-
| <a name="module_pi_hana_instance"></a> [pi\_hana\_instance](#module\_pi\_hana\_instance) | terraform-ibm-modules/powervs-instance/ibm | 2.1.0 |
37+
| <a name="module_pi_hana_instance"></a> [pi\_hana\_instance](#module\_pi\_hana\_instance) | terraform-ibm-modules/powervs-instance/ibm | 2.2.1 |
3838
| <a name="module_pi_hana_storage_calculation"></a> [pi\_hana\_storage\_calculation](#module\_pi\_hana\_storage\_calculation) | ../pi-hana-storage-config | n/a |
39-
| <a name="module_pi_netweaver_instance"></a> [pi\_netweaver\_instance](#module\_pi\_netweaver\_instance) | terraform-ibm-modules/powervs-instance/ibm | 2.1.0 |
40-
| <a name="module_pi_sharefs_instance"></a> [pi\_sharefs\_instance](#module\_pi\_sharefs\_instance) | terraform-ibm-modules/powervs-instance/ibm | 2.1.0 |
39+
| <a name="module_pi_netweaver_instance"></a> [pi\_netweaver\_instance](#module\_pi\_netweaver\_instance) | terraform-ibm-modules/powervs-instance/ibm | 2.2.1 |
40+
| <a name="module_pi_sharefs_instance"></a> [pi\_sharefs\_instance](#module\_pi\_sharefs\_instance) | terraform-ibm-modules/powervs-instance/ibm | 2.2.1 |
4141

4242
### Resources
4343

modules/pi-sap-system-type1/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ locals {
2525

2626
module "pi_sharefs_instance" {
2727
source = "terraform-ibm-modules/powervs-instance/ibm"
28-
version = "2.1.0"
28+
version = "2.2.1"
2929
count = var.pi_sharefs_instance.enable ? 1 : 0
3030

3131
pi_workspace_guid = var.pi_workspace_guid
@@ -103,7 +103,7 @@ module "pi_hana_storage_calculation" {
103103

104104
module "pi_hana_instance" {
105105
source = "terraform-ibm-modules/powervs-instance/ibm"
106-
version = "2.1.0"
106+
version = "2.2.1"
107107

108108
pi_workspace_guid = var.pi_workspace_guid
109109
pi_instance_name = local.pi_hana_instance_name
@@ -141,7 +141,7 @@ resource "time_sleep" "wait_1_min" {
141141

142142
module "pi_netweaver_instance" {
143143
source = "terraform-ibm-modules/powervs-instance/ibm"
144-
version = "2.1.0"
144+
version = "2.2.1"
145145
count = var.pi_netweaver_instance.instance_count
146146
depends_on = [time_sleep.wait_1_min]
147147

modules/pi-sap-system-type1/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ terraform {
88
# tflint-ignore: terraform_unused_required_providers
99
ibm = {
1010
source = "IBM-Cloud/ibm"
11-
version = ">= 1.70.1"
11+
version = ">= 1.71.3"
1212
}
1313
time = {
1414
source = "hashicorp/time"

reference-architectures/sap-ready-to-go/deploy-arch-ibm-pvs-sap-ready-to-go.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
copyright:
44
years: 2024
5-
lastupdated: "2024-06-10"
5+
lastupdated: "2024-12-02"
66
keywords:
77
subcollection: deployable-reference-architectures
88
authors:
@@ -16,7 +16,7 @@ use-case: ITServiceManagement
1616
industry: Technology
1717
compliance: SAPCertified
1818
content-type: reference-architecture
19-
version: v2.1.1
19+
version: v3.2.0
2020
related_links:
2121
- title: 'SAP in IBM Cloud documentation'
2222
url: 'https://cloud.ibm.com/docs/sap'
@@ -38,7 +38,7 @@ related_links:
3838
{: toc-industry="Technology"}
3939
{: toc-use-case="ITServiceManagement"}
4040
{: toc-compliance="SAPCertified"}
41-
{: toc-version="2.1.1"}
41+
{: toc-version="3.2.0"}
4242

4343
The SAP-ready PowerVS variation of the Power Virtual Server for SAP HANA creates a basic and expandable SAP system landscape. The variation builds on the foundation of the VPC landing zone and Power Virtual Server with VPC landing zone. PowerVS instances for SAP HANA, SAP NetWeaver, and optionally for shared SAP files are deployed and preconfigured for SAP installation.
4444

reference-architectures/sap-ready-to-go/deploy-arch-ibm-pvs-sap-ready-to-go.svg

Lines changed: 1 addition & 1 deletion
Loading

reference-architectures/sap-s4hana-bw4hana/deploy-arch-ibm-pvs-sap-s4hana-bw4hana.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
copyright:
44
years: 2024
5-
lastupdated: "2024-06-10"
5+
lastupdated: "2024-12-02"
66
keywords:
77
subcollection: deployable-reference-architectures
88
authors:
@@ -16,7 +16,7 @@ use-case: ITServiceManagement
1616
industry: Technology
1717
compliance: SAPCertified
1818
content-type: reference-architecture
19-
version: v2.1.1
19+
version: v3.2.0
2020
related_links:
2121
- title: 'SAP in IBM Cloud documentation'
2222
url: 'https://cloud.ibm.com/docs/sap'
@@ -38,7 +38,7 @@ related_links:
3838
{: toc-industry="Technology"}
3939
{: toc-use-case="ITServiceManagement"}
4040
{: toc-compliance="SAPCertified"}
41-
{: toc-version="2.1.1"}
41+
{: toc-version="3.2.0"}
4242

4343
'SAP S/4HANA or BW/4HANA' variation of 'Power Virtual Server for SAP HANA' creates a basic and expandable SAP system landscape built on the foundation of 'Power Virtual Server with VPC landing zone'. PowerVS instances for SAP HANA, SAP NetWeaver, and optionally for shared SAP files are deployed and preconfigured for SAP installation. The S/4HANA or BW/4HANA solution is installed based on the selected version.
4444

0 commit comments

Comments
 (0)