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

fix: remove anslble galaxy collection dependencies from shell script #751

Merged
merged 8 commits into from
Dec 13, 2024
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
8 changes: 4 additions & 4 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"name": "deploy-arch-ibm-pvs-inf",
"install_type": "fullstack",
"optional": true,
"version": ">=5.0.0"
"version": ">=8.0.0"
}
],
"configuration": [
Expand All @@ -71,7 +71,7 @@
"config_constraints": {
"catalogID": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc",
"offeringID": "2dd486c7-b317-4aaa-907b-42671485ad96-global",
"versionConstraint": ">=5.0.0"
"versionConstraint": ">=8.0.0"
},
"grouping": "deployment",
"original_grouping": "deployment",
Expand Down Expand Up @@ -373,7 +373,7 @@
"name": "deploy-arch-ibm-pvs-inf",
"install_type": "fullstack",
"optional": true,
"version": ">=5.0.0"
"version": ">=8.0.0"
}
],
"configuration": [
Expand All @@ -384,7 +384,7 @@
"config_constraints": {
"catalogID": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc",
"offeringID": "2dd486c7-b317-4aaa-907b-42671485ad96-global",
"versionConstraint": ">=5.0.0"
"versionConstraint": ">=8.0.0"
},
"grouping": "deployment",
"original_grouping": "deployment",
Expand Down
3 changes: 2 additions & 1 deletion modules/ansible/ansible_node_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
############################################################

GLOBAL_RHEL_PACKAGES="rhel-system-roles rhel-system-roles-sap expect"
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"
GLOBAL_GALAXY_COLLECTIONS="ibm.power_linux_sap:>=3.0.0,<4.0.0"

############################################################
# Start functions
Expand Down Expand Up @@ -90,6 +90,7 @@ main::install_packages() {
done
done

ansible-galaxy collection install -r '/root/.ansible/collections/ansible_collections/ibm/power_linux_sap/requirements.yml' -f
main::log_info "All packages installed successfully"
fi

Expand Down
1 change: 1 addition & 0 deletions modules/ansible/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ locals {
##############################################################

resource "terraform_data" "setup_ansible_host" {
count = var.configure_ansible_host ? 1 : 0

connection {
type = "ssh"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# ------------------------------------------------------------------------
# This playbook uses:
# 1. ansible-galaxy collection community.sap_install
# 2. ansible-galaxy collection community.general
# This playbook uses the RHEL Linux System Roles.
# ------------------------------------------------------------------------
# Install directory **should not contain** any IMDB files. Otherwise swpm roll will run into error. However exception is IMDB_CLIENT*.SAR file.
# 1. IMDB_SERVER*SAR file must be absent
Expand Down
5 changes: 5 additions & 0 deletions modules/ansible/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ variable "ssh_private_key" {
sensitive = true
}

variable "configure_ansible_host" {
description = "If set to true, bash script will be executed to install and configure the collections and packages on ansible node."
type = bool
}

variable "src_script_template_name" {
description = "Name of the bash script template file located within the 'templates-ansible' directory."
type = string
Expand Down
6 changes: 3 additions & 3 deletions modules/pi-sap-system-type1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.2.1 |
| <a name="module_pi_hana_instance"></a> [pi\_hana\_instance](#module\_pi\_hana\_instance) | terraform-ibm-modules/powervs-instance/ibm | 2.2.3 |
| <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.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 |
| <a name="module_pi_netweaver_instance"></a> [pi\_netweaver\_instance](#module\_pi\_netweaver\_instance) | terraform-ibm-modules/powervs-instance/ibm | 2.2.3 |
| <a name="module_pi_sharefs_instance"></a> [pi\_sharefs\_instance](#module\_pi\_sharefs\_instance) | terraform-ibm-modules/powervs-instance/ibm | 2.2.3 |

### Resources

Expand Down
45 changes: 24 additions & 21 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.2.1"
version = "2.2.3"
count = var.pi_sharefs_instance.enable ? 1 : 0

pi_workspace_guid = var.pi_workspace_guid
Expand Down Expand Up @@ -62,12 +62,13 @@ locals {

module "ansible_sharefs_instance_exportfs" {

source = "../ansible"
depends_on = [module.pi_sharefs_instance]
count = var.pi_sharefs_instance.enable ? 1 : 0
bastion_host_ip = var.pi_instance_init_linux.bastion_host_ip
ansible_host_or_ip = var.pi_instance_init_linux.ansible_host_or_ip
ssh_private_key = var.pi_instance_init_linux.ssh_private_key
source = "../ansible"
depends_on = [module.pi_sharefs_instance]
count = var.pi_sharefs_instance.enable ? 1 : 0
bastion_host_ip = var.pi_instance_init_linux.bastion_host_ip
ansible_host_or_ip = var.pi_instance_init_linux.ansible_host_or_ip
ssh_private_key = var.pi_instance_init_linux.ssh_private_key
configure_ansible_host = false

src_script_template_name = "configure-network-services/ansible_exec.sh.tftpl"
dst_script_file_name = "${local.sap_instance_names[count.index]}_configure_nfs_server.sh"
Expand Down Expand Up @@ -103,7 +104,7 @@ module "pi_hana_storage_calculation" {

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

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

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

Expand Down Expand Up @@ -173,12 +174,13 @@ locals {

module "ansible_netweaver_sapmnt_mount" {

source = "../ansible"
depends_on = [module.ansible_sharefs_instance_exportfs, module.pi_netweaver_instance]
count = var.pi_sharefs_instance.enable && local.valid_sharefs_nfs_config ? var.pi_netweaver_instance.instance_count : 0
bastion_host_ip = var.pi_instance_init_linux.bastion_host_ip
ansible_host_or_ip = var.pi_instance_init_linux.ansible_host_or_ip
ssh_private_key = var.pi_instance_init_linux.ssh_private_key
source = "../ansible"
depends_on = [module.ansible_sharefs_instance_exportfs, module.pi_netweaver_instance]
count = var.pi_sharefs_instance.enable && local.valid_sharefs_nfs_config ? var.pi_netweaver_instance.instance_count : 0
bastion_host_ip = var.pi_instance_init_linux.bastion_host_ip
ansible_host_or_ip = var.pi_instance_init_linux.ansible_host_or_ip
ssh_private_key = var.pi_instance_init_linux.ssh_private_key
configure_ansible_host = true

src_script_template_name = "configure-network-services/ansible_exec.sh.tftpl"
dst_script_file_name = "${local.sap_instance_names[count.index]}_sapmnt_mount.sh"
Expand Down Expand Up @@ -208,12 +210,13 @@ locals {

module "ansible_sap_instance_init" {

source = "../ansible"
depends_on = [module.pi_hana_instance, module.pi_netweaver_instance, module.ansible_netweaver_sapmnt_mount]
count = length(local.target_server_ips)
bastion_host_ip = var.pi_instance_init_linux.bastion_host_ip
ansible_host_or_ip = var.pi_instance_init_linux.ansible_host_or_ip
ssh_private_key = var.pi_instance_init_linux.ssh_private_key
source = "../ansible"
depends_on = [module.pi_hana_instance, module.pi_netweaver_instance, module.ansible_netweaver_sapmnt_mount]
count = length(local.target_server_ips)
bastion_host_ip = var.pi_instance_init_linux.bastion_host_ip
ansible_host_or_ip = var.pi_instance_init_linux.ansible_host_or_ip
ssh_private_key = var.pi_instance_init_linux.ssh_private_key
configure_ansible_host = false

src_script_template_name = "configure-os-for-sap/ansible_exec.sh.tftpl"
dst_script_file_name = "${local.sap_instance_names[count.index]}_configure_os_for_sap.sh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

copyright:
years: 2024
lastupdated: "2024-12-02"
lastupdated: "2024-12-11"
keywords:
subcollection: deployable-reference-architectures
authors:
Expand All @@ -16,7 +16,7 @@ use-case: ITServiceManagement
industry: Technology
compliance: SAPCertified
content-type: reference-architecture
version: v3.2.0
version: v3.2.1
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="3.2.0"}
{: toc-version="3.2.1"}

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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

copyright:
years: 2024
lastupdated: "2024-12-02"
lastupdated: "2024-12-11"
keywords:
subcollection: deployable-reference-architectures
authors:
Expand All @@ -16,7 +16,7 @@ use-case: ITServiceManagement
industry: Technology
compliance: SAPCertified
content-type: reference-architecture
version: v3.2.0
version: v3.2.1
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="3.2.0"}
{: toc-version="3.2.1"}

'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
4 changes: 2 additions & 2 deletions solutions/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ The end-to-end solution automates the following tasks:

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

### Resources

| Name | Type |
|------|------|
| [time_sleep.wait_10_mins](https://registry.terraform.io/providers/hashicorp/time/0.12.1/docs/resources/sleep) | resource |
| [time_sleep.wait_15_mins](https://registry.terraform.io/providers/hashicorp/time/0.12.1/docs/resources/sleep) | resource |

### Inputs

Expand Down
12 changes: 8 additions & 4 deletions 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 = "8.0.1"
version = "8.0.3"

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

Expand All @@ -21,11 +21,15 @@ module "powervs_infra" {
configure_ntp_forwarder = var.configure_ntp_forwarder
configure_nfs_server = var.configure_nfs_server
powervs_image_names = ["SLES15-SP5-SAP", "RHEL9-SP2-SAP", "SLES15-SP5-SAP-NETWEAVER", "RHEL9-SP2-SAP-NETWEAVER"]
client_to_site_vpn = { enable = false, client_ip_pool = "", vpn_client_access_group_users = [] }
}

resource "time_sleep" "wait_10_mins" {
create_duration = "600s"

resource "time_sleep" "wait_15_mins" {
create_duration = "900s"
}


#######################################################
# Power Virtual Server SAP ready-to-go
# Deploy SAP system
Expand Down Expand Up @@ -63,7 +67,7 @@ locals {

module "sap_system" {
source = "../../modules/pi-sap-system-type1"
depends_on = [time_sleep.wait_10_mins]
depends_on = [time_sleep.wait_15_mins]
providers = { ibm = ibm.ibm-pi }

prefix = var.prefix
Expand Down
2 changes: 2 additions & 0 deletions solutions/ibm-catalog/sap-s4hana-bw4hana/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ module "ansible_sap_install_hana" {
bastion_host_ip = local.access_host_or_ip
ansible_host_or_ip = local.ansible_host_or_ip
ssh_private_key = var.ssh_private_key
configure_ansible_host = false
ansible_vault_password = var.ansible_vault_password

src_script_template_name = "hanadb/install_hana.sh.tftpl"
Expand Down Expand Up @@ -195,6 +196,7 @@ module "ansible_sap_install_solution" {
bastion_host_ip = local.access_host_or_ip
ansible_host_or_ip = local.ansible_host_or_ip
ssh_private_key = var.ssh_private_key
configure_ansible_host = false
ansible_vault_password = var.ansible_vault_password

src_script_template_name = "s4hanab4hana-solution/install_swpm.sh.tftpl"
Expand Down
2 changes: 1 addition & 1 deletion solutions/sap-ready-to-go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The 'sap-ready-to-go' 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.3 |
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | = 1.71.3 |

### Modules

Expand Down
2 changes: 1 addition & 1 deletion solutions/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.3"
version = "= 1.71.3"
}
}
}