Skip to content

Commit c02df04

Browse files
feat: central ansible execution host support (#667)
BREAKING CHANGE: ansible module reworked
1 parent 19c8024 commit c02df04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+859
-670
lines changed

.secrets.baseline

Lines changed: 4 additions & 4 deletions
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-04-29T13:31:31Z",
6+
"generated_at": "2024-05-21T18:34:53Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -92,7 +92,7 @@
9292
"hashed_secret": "3bd02b996f65f3548c1a0b5d93b00bfa7c88341a",
9393
"is_secret": false,
9494
"is_verified": false,
95-
"line_number": 57,
95+
"line_number": 55,
9696
"type": "Secret Keyword",
9797
"verified_result": null
9898
}
@@ -102,7 +102,7 @@
102102
"hashed_secret": "3bd02b996f65f3548c1a0b5d93b00bfa7c88341a",
103103
"is_secret": false,
104104
"is_verified": false,
105-
"line_number": 62,
105+
"line_number": 61,
106106
"type": "Secret Keyword",
107107
"verified_result": null
108108
}
@@ -112,7 +112,7 @@
112112
"hashed_secret": "4d82fc4e8ef3a90cebdf3a1fc0e4abab79a41391",
113113
"is_secret": false,
114114
"is_verified": false,
115-
"line_number": 19,
115+
"line_number": 18,
116116
"type": "Secret Keyword",
117117
"verified_result": null
118118
}

README.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ This repository contains deployable architecture solutions that help in deployin
1414

1515
### IBM catalog solutions that require a Schematics workspace ID of [Power Virtual Server with VPC landing zone](https://cloud.ibm.com/catalog/architecture/deploy-arch-ibm-pvs-inf-2dd486c7-b317-4aaa-907b-42671485ad96-global)
1616
1. [IBM catalog PowerVS SAP Ready variation](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-sap/tree/main/solutions/ibm-catalog/sap-ready-to-go)
17-
- Creates and configures **one HANA instance, zero to several NetWeaver instances, and one optional ShareFS** with **RHEL or SLES OS** distribution. Creates a private subnet for SAP communication for the entire landscape and attaches it to cloud connections (in non-PER DC).
17+
- Creates and configures **one HANA instance, zero to several NetWeaver instances, and one optional ShareFS** with **RHEL or SLES OS** distribution. Creates a private subnet for SAP communication for the entire landscape.
1818
- Optionally configures OS network management services (NTP, NFS, and DNS services) using Ansible Galaxy Collection from [IBM](https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/): `power_linux_sap`
1919
- Additionally tunes the instances according to SAP's best practices, which are fully ready for hosting SAP applications.
2020
2. [IBM catalog PowerVS S/4HANA or BW/4HANA variation](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-sap/tree/main/solutions/ibm-catalog/sap-s4hana-bw4hana)
21-
- Creates and configures **one HANA instance, one NetWeaver instance, and one optional ShareFS** with **RHEL** OS distribution. Creates a private subnet for SAP communication for the entire landscape and attaches it to cloud connections (in non-PER DC).
21+
- Creates and configures **one HANA instance, one NetWeaver instance, and one optional ShareFS** with **RHEL** OS distribution. Creates a private subnet for SAP communication for the entire landscape.
2222
- Optionally configures OS network management services (NTP, NFS, and DNS services) using Ansible Galaxy Collection from [IBM](https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/): `power_linux_sap`
2323
- Tunes the instances according to SAP's best practices.
2424
- Downloads user-provided preloaded SAP Installation binaries from IBM Cloud Object Storage Bucket.
@@ -27,12 +27,12 @@ This repository contains deployable architecture solutions that help in deployin
2727

2828
### Solutions independent of IBM Cloud prerequisite Schematics workspace ID:
2929
1. [PowerVS SAP Ready variation](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-sap/tree/main/solutions/sap-ready-to-go)
30-
- Creates and configures **one HANA instance, zero to several NetWeaver instances and one optional ShareFS** with **RHEL or SLES OS** distribution. Creates a private subnet for SAP communication for the entire landscape, and attaches it to cloud connections (in non-PER DC).
30+
- Creates and configures **one HANA instance, zero to several NetWeaver instances and one optional ShareFS** with **RHEL or SLES OS** distribution. Creates a private subnet for SAP communication for the entire landscape
3131
- Optionally configures OS network management services (NTP, NFS, and DNS services) using Ansible Galaxy collection from [IBM](https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/)
3232
- Additionally tunes the instances according to SAP's best practices, which is fully ready for hosting SAP applications.
3333
2. [End-to-End Solution](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-sap/tree/main/solutions/e2e)
34-
- Creates a [Power Virtual Server with vpc landing zone](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-infrastructure/tree/main/modules/powervs-vpc-landing-zone) which creates a VPC Infrastructure and PowerVS infrastructure. Installs and configures the Squid Proxy, DNS Forwarder, NTP forwarder, and NFS on hosts, and sets the host as the server for the NTP, NFS, and DNS services by using Ansible Galaxy Collection from [IBM](https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/): `power_linux_sap`
35-
- Creates and configures **one HANA instance, zero to several NetWeaver instances, and one optional ShareFS** with **RHEL or SLES OS** distribution. Creates a private subnet for SAP communication for the entire landscape, and attaches it to cloud connections (in non-PER DC).
34+
- Creates a [Power Virtual Server with vpc landing zone](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-infrastructure/tree/main/modules/powervs-vpc-landing-zone) which creates a VPC Infrastructure and PowerVS infrastructure. Installs and configures the Squid Proxy, DNS Forwarder, NTP forwarder, and NFS as a service on hosts, and sets the host as the server for the NTP, SQUID proxy and DNS services by using Ansible Galaxy Collection from [IBM](https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/): `power_linux_sap`
35+
- Creates and configures **one HANA instance, zero to several NetWeaver instances, and one optional ShareFS** with **RHEL or SLES OS** distribution. Creates a private subnet for SAP communication for the entire landscape.
3636
- Optionally configures OS network management services (NTP, NFS, and DNS services) using Ansible Galaxy Collection from [IBM](https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/): `power_linux_sap`
3737
- Additionally tunes the instances according to SAP's best practices, which is fully ready for hosting SAP applications.
3838

@@ -52,14 +52,6 @@ This repository contains deployable architecture solutions that help in deployin
5252
| [ End-to-End ]( ./solutions/e2e/ ) | N/A | N/A | :heavy_check_mark: | 1 | 0 to N | :heavy_check_mark: | :heavy_check_mark: | N/A |
5353

5454

55-
<!-- BEGIN OVERVIEW HOOK -->
56-
## Overview
57-
* [terraform-ibm-powervs-sap](#terraform-ibm-powervs-sap)
58-
* [Submodules](./modules)
59-
* [pi-sap-system-type1](./modules/pi-sap-system-type1)
60-
* [Contributing](#contributing)
61-
<!-- END OVERVIEW HOOK -->
62-
6355

6456
## Required IAM access policies
6557

cra-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ CRA_TARGETS:
77
TF_VAR_prefix: "cra-sap"
88
TF_VAR_powervs_zone: "syd05"
99
TF_VAR_powervs_resource_group_name: "Default"
10-
TF_VAR_landing_zone_configuration: "3VPC_RHEL"
1110
TF_VAR_external_access_ip: "0.0.0.0/0"
1211
TF_VAR_powervs_create_separate_sharefs_instance: false
1312
TF_VAR_os_image_distro: "RHEL"

cra-tf-validate-ignore-rules.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@
1111
"description": "Check whether Flow Logs for VPC are enabled",
1212
"ignore_reason": "In order for this rule to pass, Context Based Restrictions (CBRs) support needs to be added to the module (tracking in https://github.ibm.com/GoldenEye/issues/issues/5626). Even after that is added, there is still a dependency on SCC to support scanning for CBR rules. SCC CBR support is being tracked in https://github.ibm.com/project-fortress/pm/issues/11800.",
1313
"is_valid": true
14+
},
15+
{
16+
"scc_rule_id": "rule-8c923215-afdc-41b1-886c-64ce78741f8c",
17+
"description": "Check whether Application Load Balancer for VPC has health check configured when created",
18+
"ignore_reason": "In order for this rule to pass, Context Based Restrictions (CBRs) support needs to be added to the module (tracking in https://github.ibm.com/GoldenEye/issues/issues/5626). Even after that is added, there is still a dependency on SCC to support scanning for CBR rules. SCC CBR support is being tracked in https://github.ibm.com/project-fortress/pm/issues/11800.",
19+
"is_valid": true
20+
},
21+
{
22+
"scc_rule_id": "rule-65b61a0f-ffdb-41ba-873d-ad329e7fc0ee",
23+
"description": "Check whether Application Load Balancer for VPC is configured to convert HTTP client requests to HTTPS",
24+
"ignore_reason": "In order for this rule to pass, Context Based Restrictions (CBRs) support needs to be added to the module (tracking in https://github.ibm.com/GoldenEye/issues/issues/5626). Even after that is added, there is still a dependency on SCC to support scanning for CBR rules. SCC CBR support is being tracked in https://github.ibm.com/project-fortress/pm/issues/11800.",
25+
"is_valid": true
1426
}
1527
]
1628
}

ibm_catalog.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@
5353
{
5454
"flavors": [
5555
"powervs-workspace",
56-
"powervs-import-workspace"
56+
"powervs-import-workspace",
57+
"powervs-quickstart"
5758
],
5859
"id": "2dd486c7-b317-4aaa-907b-42671485ad96-global",
5960
"name": "deploy-arch-ibm-pvs-inf",
6061
"install_type": "fullstack",
61-
"version": ">=3.0.0"
62+
"version": ">=5.0.0"
6263
}
6364
],
6465
"configuration": [
@@ -69,7 +70,7 @@
6970
"config_constraints": {
7071
"catalogID": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc",
7172
"offeringID": "2dd486c7-b317-4aaa-907b-42671485ad96-global",
72-
"versionConstraint": ">=3.0.0"
73+
"versionConstraint": ">=5.0.0"
7374
},
7475
"grouping": "deployment",
7576
"original_grouping": "deployment",
@@ -353,7 +354,7 @@
353354
"url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-powervs-sap/main/reference-architectures/sap-ready-to-go/deploy-arch-ibm-pvs-sap-ready-to-go.svg",
354355
"type": "image/svg+xml"
355356
},
356-
"description": "'SAP ready PowerVS' variation of 'Power Virtual Server for SAP HANA' creates a basic and expandable SAP system landscape builds on the foundation of the '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.\n\nServices such as DNS, NTP and NFS running in VPC and provided by 'Power Virtual Server with VPC landing zone' are leveraged.\n\nRedundant IBM Cloud Connections provide the network bridge between the IBM Power infrastructure and the IBM VPC and public internet.\n\nThe resulting SAP landscape leverages the services such as Activity Tracker, Cloud Object Storage, Key Management and the network connectivity configuration provided by 'Power Virtual Server with VPC landing zone'."
357+
"description": "'SAP ready PowerVS' variation of 'Power Virtual Server for SAP HANA' creates a basic and expandable SAP system landscape builds on the foundation of the '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.\n\nServices such as DNS, NTP and NFS running in VPC and provided by 'Power Virtual Server with VPC landing zone' are leveraged.\n\nThe resulting SAP landscape leverages the services such as Activity Tracker, Cloud Object Storage, Key Management and the network connectivity configuration provided by 'Power Virtual Server with VPC landing zone'."
357358
}
358359
]
359360
}
@@ -368,12 +369,13 @@
368369
{
369370
"flavors": [
370371
"powervs-workspace",
371-
"powervs-import-workspace"
372+
"powervs-import-workspace",
373+
"powervs-quickstart"
372374
],
373375
"id": "2dd486c7-b317-4aaa-907b-42671485ad96-global",
374376
"name": "deploy-arch-ibm-pvs-inf",
375377
"install_type": "fullstack",
376-
"version": ">=3.0.0"
378+
"version": ">=5.0.0"
377379
}
378380
],
379381
"configuration": [
@@ -384,7 +386,7 @@
384386
"config_constraints": {
385387
"catalogID": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc",
386388
"offeringID": "2dd486c7-b317-4aaa-907b-42671485ad96-global",
387-
"versionConstraint": ">=3.0.0"
389+
"versionConstraint": ">=5.0.0"
388390
},
389391
"grouping": "deployment",
390392
"original_grouping": "deployment",
@@ -734,7 +736,7 @@
734736
"url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-powervs-sap/main/reference-architectures/sap-s4hana-bw4hana/deploy-arch-ibm-pvs-sap-s4hana-bw4hana.svg",
735737
"type": "image/svg+xml"
736738
},
737-
"description": "'SAP S/4HANA or BW/4HANA' variation of 'Power Virtual Server for SAP HANA' creates a basic and expandable SAP system landscape builds 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. S/4HANA or BW/4HANA solution is installed based on selected version. \n\nServices such as DNS, NTP and NFS running in VPC and provided by 'Power Virtual Server with VPC landing zone' are leveraged.\n\nRedundant IBM Cloud Connections provide the network bridge between the IBM Power infrastructure and the IBM VPC and public internet.\n\nThe resulting SAP landscape leverages the services such as Activity Tracker, Cloud Object Storage, Key Management and the network connectivity configuration provided by the 'Power Virtual Server with VPC landing zone'."
739+
"description": "'SAP S/4HANA or BW/4HANA' variation of 'Power Virtual Server for SAP HANA' creates a basic and expandable SAP system landscape builds 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. S/4HANA or BW/4HANA solution is installed based on selected version. \n\nServices such as DNS, NTP and NFS running in VPC and provided by 'Power Virtual Server with VPC landing zone' are leveraged.\n\nThe resulting SAP landscape leverages the services such as Activity Tracker, Cloud Object Storage, Key Management and the network connectivity configuration provided by the 'Power Virtual Server with VPC landing zone'."
738740
}
739741
]
740742
}
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#!/bin/bash
2+
############################################################
3+
# OS_Support: RHEL only #
4+
# This bash script performs #
5+
# - installation of packages #
6+
# - ansible galaxy collections. #
7+
# - updates the OS #
8+
############################################################
9+
10+
GLOBAL_RHEL_PACKAGES="rhel-system-roles rhel-system-roles-sap expect"
11+
GLOBAL_GALAXY_COLLLECTIONS="ibm.power_linux_sap:2.1.0 ansible.utils:3.1.0 ansible.posix:1.5.4 community.general:8.4.0"
12+
13+
############################################################
14+
# Start functions
15+
############################################################
16+
17+
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 }')
24+
}
25+
26+
main::log_info() {
27+
local log_entry=${1}
28+
echo "INFO - ${log_entry}"
29+
}
30+
31+
main::log_error() {
32+
local log_entry=${1}
33+
echo "ERROR - Deployment exited - ${log_entry}"
34+
exit 1
35+
}
36+
37+
main::subscription_mgr_check_process() {
38+
39+
main::log_info "Sleeping 30 seconds for all subscription-manager process to finish."
40+
sleep 30
41+
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
47+
48+
}
49+
50+
############################################################
51+
# RHEL : Install Packages #
52+
############################################################
53+
main::install_packages() {
54+
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
95+
96+
}
97+
98+
############################################################
99+
# Main start here #
100+
############################################################
101+
main::get_os_version
102+
main::install_packages

0 commit comments

Comments
 (0)