Skip to content

Commit

Permalink
feat: upgrade power_linux_sap roles (#741)
Browse files Browse the repository at this point in the history

---------

Co-authored-by: surajsbharadwaj <[email protected]>
Co-authored-by: surajsbharadwaj <[email protected]>
Co-authored-by: stafaniasaju <[email protected]>
  • Loading branch information
4 people authored Dec 7, 2024
1 parent d028bc4 commit 6bff22d
Show file tree
Hide file tree
Showing 20 changed files with 111 additions and 119 deletions.
2 changes: 1 addition & 1 deletion .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "go.sum|^.secrets.baseline$",
"lines": null
},
"generated_at": "2024-10-31T15:08:37Z",
"generated_at": "2024-12-06T13:41:59Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down
120 changes: 60 additions & 60 deletions modules/ansible/ansible_node_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,46 @@
# This bash script performs #
# - installation of packages #
# - ansible galaxy collections. #
# - updates the OS #
# #
############################################################

GLOBAL_RHEL_PACKAGES="rhel-system-roles rhel-system-roles-sap expect"
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"
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"

############################################################
# Start functions
############################################################

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

main::log_info() {
local log_entry=${1}
echo "INFO - ${log_entry}"
local log_entry=${1}
echo "INFO - ${log_entry}"
}

main::log_error() {
local log_entry=${1}
echo "ERROR - Deployment exited - ${log_entry}"
exit 1
local log_entry=${1}
echo "ERROR - Deployment exited - ${log_entry}"
exit 1
}

main::subscription_mgr_check_process() {

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

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

}

Expand All @@ -52,46 +52,46 @@ main::subscription_mgr_check_process() {
############################################################
main::install_packages() {

if [[ ${LINUX_DISTRO} = "RHEL" ]]; then

main::subscription_mgr_check_process

## enable repository for RHEL sap roles
subscription-manager repos --enable="rhel-$(rpm -E %rhel)-for-$(uname -m)-sap-solutions-rpms"

## Install packages
for package in $GLOBAL_RHEL_PACKAGES; do
local count=0
local max_count=3
while ! dnf -y install "${package}"; do
count=$((count + 1))
sleep 3
# shellcheck disable=SC2317
if [[ ${count} -gt ${max_count} ]]; then
main::log_error "Failed to install ${package}"
break
fi
done
done

## Download and install collections from ansible-galaxy

for collection in $GLOBAL_GALAXY_COLLLECTIONS; do
local count=0
local max_count=3
while ! ansible-galaxy collection install "${collection}"; do
count=$((count + 1))
sleep 3
# shellcheck disable=SC2317
if [[ ${count} -gt ${max_count} ]]; then
main::log_error "Failed to install ansible galaxy collection ${collection}"
break
fi
done
done

main::log_info "All packages installed successfully"
fi
if [[ ${LINUX_DISTRO} = "RHEL" ]]; then

main::subscription_mgr_check_process

## enable repository for RHEL sap roles
subscription-manager repos --enable="rhel-$(rpm -E %rhel)-for-$(uname -m)-sap-solutions-rpms"

## Install packages
for package in $GLOBAL_RHEL_PACKAGES; do
local count=0
local max_count=3
while ! dnf -y install "${package}"; do
count=$((count + 1))
sleep 3
# shellcheck disable=SC2317
if [[ ${count} -gt ${max_count} ]]; then
main::log_error "Failed to install ${package}"
break
fi
done
done

## Download and install collections from ansible-galaxy

for collection in $GLOBAL_GALAXY_COLLECTIONS; do
local count=0
local max_count=3
while ! ansible-galaxy collection install "${collection}" -f; do
count=$((count + 1))
sleep 3
# shellcheck disable=SC2317
if [[ ${count} -gt ${max_count} ]]; then
main::log_error "Failed to install ansible galaxy collection ${collection}"
break
fi
done
done

main::log_info "All packages installed successfully"
fi

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,5 @@
client_config: ${client_config}

roles:
- role: ibm.power_linux_sap.powervs_client_enable_services
when: client_config.keys()|length > 0
- role: ibm.power_linux_sap.powervs_install_services
when: server_config.keys()|length > 0
- role: ibm.power_linux_sap.configure_network_management_services
when: client_config.keys()|length > 0 or server_config.keys()|length > 0
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,9 @@
sap_domain: ${sap_domain}

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

tasks:
- include_role:
name: redhat.sap_install.sap_general_preconfigure
vars:
sap_general_preconfigure_fail_if_reboot_required: no
when:
- ansible_distribution is match("RedHat*")
- sap_solution is defined

- include_role:
name: redhat.sap_install.sap_hana_preconfigure
vars:
sap_hana_preconfigure_fail_if_reboot_required: no
when:
- ansible_distribution is match("RedHat*")
- sap_solution is defined
- sap_solution is match("HANA")

- include_role:
name: redhat.sap_install.sap_netweaver_preconfigure
when:
- ansible_distribution is match("RedHat*")
- sap_solution is defined
- sap_solution is match("NETWEAVER")

- name: Reboot the machine with timeout 10 mins
ansible.builtin.reboot:

Expand Down
8 changes: 4 additions & 4 deletions modules/pi-sap-system-type1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The Power Virtual Server for SAP module automates the following tasks:
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9.0 |
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.70.1 |
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.71.3 |
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.9.1 |

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

### Resources

Expand Down
6 changes: 3 additions & 3 deletions modules/pi-sap-system-type1/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ locals {

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

pi_workspace_guid = var.pi_workspace_guid
Expand Down Expand Up @@ -103,7 +103,7 @@ module "pi_hana_storage_calculation" {

module "pi_hana_instance" {
source = "terraform-ibm-modules/powervs-instance/ibm"
version = "2.1.0"
version = "2.2.1"

pi_workspace_guid = var.pi_workspace_guid
pi_instance_name = local.pi_hana_instance_name
Expand Down Expand Up @@ -141,7 +141,7 @@ resource "time_sleep" "wait_1_min" {

module "pi_netweaver_instance" {
source = "terraform-ibm-modules/powervs-instance/ibm"
version = "2.1.0"
version = "2.2.1"
count = var.pi_netweaver_instance.instance_count
depends_on = [time_sleep.wait_1_min]

Expand Down
2 changes: 1 addition & 1 deletion modules/pi-sap-system-type1/version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ terraform {
# tflint-ignore: terraform_unused_required_providers
ibm = {
source = "IBM-Cloud/ibm"
version = ">= 1.70.1"
version = ">= 1.71.3"
}
time = {
source = "hashicorp/time"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

copyright:
years: 2024
lastupdated: "2024-06-10"
lastupdated: "2024-12-02"
keywords:
subcollection: deployable-reference-architectures
authors:
Expand All @@ -16,7 +16,7 @@ use-case: ITServiceManagement
industry: Technology
compliance: SAPCertified
content-type: reference-architecture
version: v2.1.1
version: v3.2.0
related_links:
- title: 'SAP in IBM Cloud documentation'
url: 'https://cloud.ibm.com/docs/sap'
Expand All @@ -38,7 +38,7 @@ related_links:
{: toc-industry="Technology"}
{: toc-use-case="ITServiceManagement"}
{: toc-compliance="SAPCertified"}
{: toc-version="2.1.1"}
{: toc-version="3.2.0"}

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.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

copyright:
years: 2024
lastupdated: "2024-06-10"
lastupdated: "2024-12-02"
keywords:
subcollection: deployable-reference-architectures
authors:
Expand All @@ -16,7 +16,7 @@ use-case: ITServiceManagement
industry: Technology
compliance: SAPCertified
content-type: reference-architecture
version: v2.1.1
version: v3.2.0
related_links:
- title: 'SAP in IBM Cloud documentation'
url: 'https://cloud.ibm.com/docs/sap'
Expand All @@ -38,7 +38,7 @@ related_links:
{: toc-industry="Technology"}
{: toc-use-case="ITServiceManagement"}
{: toc-compliance="SAPCertified"}
{: toc-version="2.1.1"}
{: toc-version="3.2.0"}

'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.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions solutions/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ The end-to-end solution automates the following tasks:
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9.0 |
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | 1.71.1 |
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | 1.71.3 |
| <a name="requirement_time"></a> [time](#requirement\_time) | 0.12.1 |

### Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_powervs_infra"></a> [powervs\_infra](#module\_powervs\_infra) | terraform-ibm-modules/powervs-infrastructure/ibm//modules/powervs-vpc-landing-zone | 7.1.0 |
| <a name="module_powervs_infra"></a> [powervs\_infra](#module\_powervs\_infra) | terraform-ibm-modules/powervs-infrastructure/ibm//modules/powervs-vpc-landing-zone | 8.0.1 |
| <a name="module_sap_system"></a> [sap\_system](#module\_sap\_system) | ../../modules/pi-sap-system-type1 | n/a |

### Resources
Expand Down
2 changes: 1 addition & 1 deletion solutions/e2e/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

module "powervs_infra" {
source = "terraform-ibm-modules/powervs-infrastructure/ibm//modules/powervs-vpc-landing-zone"
version = "7.1.0"
version = "8.0.1"

providers = { ibm.ibm-is = ibm.ibm-is, ibm.ibm-pi = ibm.ibm-pi, ibm.ibm-sm = ibm.ibm-sm }

Expand Down
2 changes: 1 addition & 1 deletion solutions/e2e/version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = "1.71.1"
version = "1.71.3"
}
time = {
source = "hashicorp/time"
Expand Down
6 changes: 3 additions & 3 deletions solutions/ibm-catalog/sap-ready-to-go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9.0 |
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | 1.71.1 |
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | 1.71.3 |

### Modules

Expand All @@ -56,8 +56,8 @@

| Name | Type |
|------|------|
| [ibm_schematics_output.schematics_output](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.71.1/docs/data-sources/schematics_output) | data source |
| [ibm_schematics_workspace.schematics_workspace](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.71.1/docs/data-sources/schematics_workspace) | data source |
| [ibm_schematics_output.schematics_output](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.71.3/docs/data-sources/schematics_output) | data source |
| [ibm_schematics_workspace.schematics_workspace](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.71.3/docs/data-sources/schematics_workspace) | data source |

### Inputs

Expand Down
2 changes: 1 addition & 1 deletion solutions/ibm-catalog/sap-ready-to-go/version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = "1.71.1"
version = "1.71.3"
}
}
}
Loading

0 comments on commit 6bff22d

Please sign in to comment.