From 74cfdb3e0481b8534a5cd59268bbb9092fc1b0e2 Mon Sep 17 00:00:00 2001 From: sean-freeman Date: Wed, 15 Feb 2023 14:18:40 +0000 Subject: [PATCH 01/12] docs: update csp version notes --- docs/DEV_INFRASTRUCTURE_GUIDANCE.md | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/DEV_INFRASTRUCTURE_GUIDANCE.md b/docs/DEV_INFRASTRUCTURE_GUIDANCE.md index 65abe87..d6899ae 100644 --- a/docs/DEV_INFRASTRUCTURE_GUIDANCE.md +++ b/docs/DEV_INFRASTRUCTURE_GUIDANCE.md @@ -9,6 +9,7 @@ Each Terraform Template for SAP anticipates that an end user has a basic level o The below document contains guidance for: - [AWS hyperscaler](#aws-hyperscaler), Cloud Service Provider +- [Google Cloud hyperscaler](#google-cloud-hyperscaler), Cloud Service Provider - [IBM Cloud hyperscaler](#ibm-cloud-hyperscaler), Cloud Service Provider - [IBM PowerVC hypervisor](#ibm-powervc-hypervisor) - [Microsoft Azure hyperscaler](#microsoft-azure-hyperscaler), Cloud Service Provider @@ -268,3 +269,34 @@ For VMware vCenter and vSphere clusters with direct network subnet IP allocation - **DHCP Server** must be created (e.g. NSX > Networking > Networking Profiles > DHCP Profile), set in the Gateway (e.g. NSX > Networking > Gateway > Edit > DHCP Config > ), then set for the Subnet (e.g. NSX > Networking > Segment > <> > Set DHCP Config) which the VMware VM Template is attached to; this allows subsequent cloned VMs to obtain an IPv4 Address - **Internet Access**: Option 1 - Configured SNAT (e.g. rule added on NSX Gateway) set for the Subnet which the VMware VM Template is attached to; this allows Public Internet access. Option 2 - Web Proxy. - **DNS Server (Private)** is recommended to assist custom/private root domain resolution (e.g. poc.cloud) + +
+ +## Cloud service versions for hyperscaler Cloud Service Providers + +For distinction, it is important to note that each hyperscaler Cloud Service Provider has some previous generation of Cloud Services and Networking environments. + +Below is a list of previous generation Cloud Services and Networking environments which are `NOT` used within the Terraform Templates for SAP: + +### AWS hyperscaler, Cloud Service Provider + +- AWS EC2-Classic Networking environment (replaced by VPC networks environment). Deprecated in Aug-2022. See [AWS EC2-Classic documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-classic-platform.html). +- Amazon EC2 Previous Generation Instances. See [AWS EC2 Previous Generation Instances documentation](https://aws.amazon.com/ec2/previous-generation/). + +### Google Cloud hyperscaler, Cloud Service Provider + +- Google Cloud Legacy Networks (replaced by VPC Networks). Not available to provision, no deprecation (aka. Discontinuation of Service) date announced. See [Google Cloud Legacy Networks documentation](https://cloud.google.com/vpc/docs/legacy). + +### IBM Cloud hyperscaler, Cloud Service Provider + +- IBM Cloud Classic Infrastructure environment, replaced by IBM Cloud VPC Infrastructure environment. See [IBM Cloud Classic Infrastructure compared with IBM Cloud VPC Infrastructure environments documentation](https://cloud.ibm.com/docs/cloud-infrastructure?topic=cloud-infrastructure-compare-infrastructure). + - IBM Cloud Virtual Servers (Classic) based on Xen hypervisor; replaced by IBM Cloud Virtual Servers (with hardware generations) based on KVM hypervisor. See [IBM Cloud Virtual Servers (for Classic) documentation](https://cloud.ibm.com/docs/virtual-servers). + - IBM Cloud VLAN (Classic) and VLAN Subnets (Classic); replaced by IBM Cloud VPC Networks and IBM Cloud VPC Subnets. See [IBM Cloud Classic VLANs documentation](https://cloud.ibm.com/docs/vlans?topic=vlans-about-vlans). + +### Microsoft Azure hyperscaler, Cloud Service Provider + +- Azure Service Manager (ASM) control plane (aka. environment), replaced by Azure Resource Manager (ARM) control plane. + - Azure IaaS VM (Classic), managed by Azure Service Manager (ASM) control plane. Deprecation due Sept-2023. See [Azure Classic VM deprecation documentation](https://learn.microsoft.com/en-us/azure//virtual-machines/classic-vm-deprecation) and [Azure Resource Manager vs. Classic deployment models documentation](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/deployment-models). + - Azure IaaS VM using Hyper-V Generation 1 format; replaced by Hyper-V Generation 2 format. See [Azure Classic VM API reference without Generation 2 support](https://learn.microsoft.com/en-us/previous-versions/azure/reference/jj157194(v=azure.100)) compared with [Azure VM API reference with Generation 2 support](https://learn.microsoft.com/en-us/rest/api/compute/virtual-machines/create-or-update?tabs=HTTP). + - Azure VNet (Classic), part of the Azure Cloud Services (Classic). Deprecation due Aug-2024. See [Azure Classic VNet documentation](https://learn.microsoft.com/en-us/previous-versions/azure/virtual-network/create-virtual-network-classic) and [Azure Cloud Services (Classic) documentation](https://learn.microsoft.com/en-us/azure/cloud-services/). + - Azure Storage Accounts (Classic), part of the Azure Cloud Services (Classic). Deprecation due Aug-2024. See [Azure Classic Storage Account migration documentation](https://learn.microsoft.com/en-us/azure/storage/common/storage-account-migrate-classic) and [Azure Cloud Services (Classic) documentation](https://learn.microsoft.com/en-us/azure/cloud-services/). From 968c648730658fd636f93b40b879017e0b2969d7 Mon Sep 17 00:00:00 2001 From: sean-freeman Date: Sat, 4 Mar 2023 12:40:57 +0000 Subject: [PATCH 02/12] fix: remove wip iam trigger --- .../ibmcloud_powervs/main.tf | 28 +++++++++---------- .../ibmcloud_powervs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- .../ibmcloud_powervs/main.tf | 28 +++++++++---------- .../ibmcloud_powervs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- .../ibmcloud_powervs/main.tf | 28 +++++++++---------- .../ibmcloud_powervs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- .../ibmcloud_powervs/main.tf | 28 +++++++++---------- .../ibmcloud_powervs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- .../ibmcloud_powervs/main.tf | 28 +++++++++---------- .../ibmcloud_powervs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- .../ibmcloud_powervs/main.tf | 28 +++++++++---------- .../ibmcloud_powervs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- .../ibmcloud_powervs/main.tf | 28 +++++++++---------- .../ibmcloud_powervs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- .../ibmcloud_powervs/main.tf | 28 +++++++++---------- .../ibmcloud_powervs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- 52 files changed, 442 insertions(+), 442 deletions(-) diff --git a/sap_bw4hana_single_node_install/ibmcloud_powervs/main.tf b/sap_bw4hana_single_node_install/ibmcloud_powervs/main.tf index 4a30951..29baf56 100644 --- a/sap_bw4hana_single_node_install/ibmcloud_powervs/main.tf +++ b/sap_bw4hana_single_node_install/ibmcloud_powervs/main.tf @@ -65,20 +65,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_bw4hana_single_node_install/ibmcloud_powervs/variables.tf b/sap_bw4hana_single_node_install/ibmcloud_powervs/variables.tf index a04590d..7b71ece 100644 --- a/sap_bw4hana_single_node_install/ibmcloud_powervs/variables.tf +++ b/sap_bw4hana_single_node_install/ibmcloud_powervs/variables.tf @@ -20,9 +20,9 @@ variable "ibmcloud_powervs_location" { description = "Target IBM Power VS location (colocated at a IBM Cloud VPC Infrastructure Availability Zone)" } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_bw4hana_single_node_install/ibmcloud_vs/main.tf b/sap_bw4hana_single_node_install/ibmcloud_vs/main.tf index a6c2ac4..191e72a 100644 --- a/sap_bw4hana_single_node_install/ibmcloud_vs/main.tf +++ b/sap_bw4hana_single_node_install/ibmcloud_vs/main.tf @@ -65,20 +65,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_bw4hana_single_node_install/ibmcloud_vs/variables.tf b/sap_bw4hana_single_node_install/ibmcloud_vs/variables.tf index 7a8f96c..bcb2c30 100644 --- a/sap_bw4hana_single_node_install/ibmcloud_vs/variables.tf +++ b/sap_bw4hana_single_node_install/ibmcloud_vs/variables.tf @@ -26,9 +26,9 @@ variable "ibmcloud_vpc_availability_zone" { } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_ecc_hana_single_node_install/ibmcloud_powervs/main.tf b/sap_ecc_hana_single_node_install/ibmcloud_powervs/main.tf index 8aafa5b..38f595a 100644 --- a/sap_ecc_hana_single_node_install/ibmcloud_powervs/main.tf +++ b/sap_ecc_hana_single_node_install/ibmcloud_powervs/main.tf @@ -65,20 +65,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_ecc_hana_single_node_install/ibmcloud_powervs/variables.tf b/sap_ecc_hana_single_node_install/ibmcloud_powervs/variables.tf index 5f22822..eb59702 100644 --- a/sap_ecc_hana_single_node_install/ibmcloud_powervs/variables.tf +++ b/sap_ecc_hana_single_node_install/ibmcloud_powervs/variables.tf @@ -20,9 +20,9 @@ variable "ibmcloud_powervs_location" { description = "Target IBM Power VS location (colocated at a IBM Cloud VPC Infrastructure Availability Zone)" } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_ecc_hana_single_node_install/ibmcloud_vs/main.tf b/sap_ecc_hana_single_node_install/ibmcloud_vs/main.tf index f73083f..3b23204 100644 --- a/sap_ecc_hana_single_node_install/ibmcloud_vs/main.tf +++ b/sap_ecc_hana_single_node_install/ibmcloud_vs/main.tf @@ -65,20 +65,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_ecc_hana_single_node_install/ibmcloud_vs/variables.tf b/sap_ecc_hana_single_node_install/ibmcloud_vs/variables.tf index 6965cf8..d50b95b 100644 --- a/sap_ecc_hana_single_node_install/ibmcloud_vs/variables.tf +++ b/sap_ecc_hana_single_node_install/ibmcloud_vs/variables.tf @@ -26,9 +26,9 @@ variable "ibmcloud_vpc_availability_zone" { } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/main.tf b/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/main.tf index a8659bc..30c687b 100644 --- a/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/main.tf +++ b/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/main.tf @@ -68,20 +68,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variables.tf b/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variables.tf index 5b6a0ec..45b3359 100644 --- a/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variables.tf +++ b/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variables.tf @@ -20,9 +20,9 @@ variable "ibmcloud_powervs_location" { description = "Target IBM Power VS location (colocated at a IBM Cloud VPC Infrastructure Availability Zone)" } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/main.tf b/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/main.tf index ad2b946..57a608f 100644 --- a/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/main.tf +++ b/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/main.tf @@ -94,20 +94,20 @@ module "run_bastion_inject_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_host_network_access_sap_module" { diff --git a/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/variables.tf b/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/variables.tf index f2e7dca..7122c5f 100644 --- a/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/variables.tf +++ b/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/variables.tf @@ -26,9 +26,9 @@ variable "ibmcloud_vpc_availability_zone" { } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_ecc_ibmdb2_single_node_install/ibmcloud_vs/main.tf b/sap_ecc_ibmdb2_single_node_install/ibmcloud_vs/main.tf index a0fe62d..13016e0 100644 --- a/sap_ecc_ibmdb2_single_node_install/ibmcloud_vs/main.tf +++ b/sap_ecc_ibmdb2_single_node_install/ibmcloud_vs/main.tf @@ -65,20 +65,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_ecc_ibmdb2_single_node_install/ibmcloud_vs/variables.tf b/sap_ecc_ibmdb2_single_node_install/ibmcloud_vs/variables.tf index 11ae5a1..8b6b6ac 100644 --- a/sap_ecc_ibmdb2_single_node_install/ibmcloud_vs/variables.tf +++ b/sap_ecc_ibmdb2_single_node_install/ibmcloud_vs/variables.tf @@ -26,9 +26,9 @@ variable "ibmcloud_vpc_availability_zone" { } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_ecc_oracledb_single_node_install/ibmcloud_vs/main.tf b/sap_ecc_oracledb_single_node_install/ibmcloud_vs/main.tf index 93dfe9f..c51f7ee 100644 --- a/sap_ecc_oracledb_single_node_install/ibmcloud_vs/main.tf +++ b/sap_ecc_oracledb_single_node_install/ibmcloud_vs/main.tf @@ -65,20 +65,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_ecc_oracledb_single_node_install/ibmcloud_vs/variables.tf b/sap_ecc_oracledb_single_node_install/ibmcloud_vs/variables.tf index d9e77bd..d569daa 100644 --- a/sap_ecc_oracledb_single_node_install/ibmcloud_vs/variables.tf +++ b/sap_ecc_oracledb_single_node_install/ibmcloud_vs/variables.tf @@ -26,9 +26,9 @@ variable "ibmcloud_vpc_availability_zone" { } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_ecc_sapase_single_node_install/ibmcloud_vs/main.tf b/sap_ecc_sapase_single_node_install/ibmcloud_vs/main.tf index 2183f24..a6f16bc 100644 --- a/sap_ecc_sapase_single_node_install/ibmcloud_vs/main.tf +++ b/sap_ecc_sapase_single_node_install/ibmcloud_vs/main.tf @@ -65,20 +65,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_ecc_sapase_single_node_install/ibmcloud_vs/variables.tf b/sap_ecc_sapase_single_node_install/ibmcloud_vs/variables.tf index 9c1fd50..3fbef35 100644 --- a/sap_ecc_sapase_single_node_install/ibmcloud_vs/variables.tf +++ b/sap_ecc_sapase_single_node_install/ibmcloud_vs/variables.tf @@ -26,9 +26,9 @@ variable "ibmcloud_vpc_availability_zone" { } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_ecc_sapmaxdb_single_node_install/ibmcloud_vs/main.tf b/sap_ecc_sapmaxdb_single_node_install/ibmcloud_vs/main.tf index 3c4832a..558b79b 100644 --- a/sap_ecc_sapmaxdb_single_node_install/ibmcloud_vs/main.tf +++ b/sap_ecc_sapmaxdb_single_node_install/ibmcloud_vs/main.tf @@ -65,20 +65,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_ecc_sapmaxdb_single_node_install/ibmcloud_vs/variables.tf b/sap_ecc_sapmaxdb_single_node_install/ibmcloud_vs/variables.tf index da4352b..62d375e 100644 --- a/sap_ecc_sapmaxdb_single_node_install/ibmcloud_vs/variables.tf +++ b/sap_ecc_sapmaxdb_single_node_install/ibmcloud_vs/variables.tf @@ -26,9 +26,9 @@ variable "ibmcloud_vpc_availability_zone" { } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_hana_single_node_install/ibmcloud_powervs/main.tf b/sap_hana_single_node_install/ibmcloud_powervs/main.tf index bfa2988..a620935 100644 --- a/sap_hana_single_node_install/ibmcloud_powervs/main.tf +++ b/sap_hana_single_node_install/ibmcloud_powervs/main.tf @@ -62,20 +62,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_hana_single_node_install/ibmcloud_powervs/variables.tf b/sap_hana_single_node_install/ibmcloud_powervs/variables.tf index 872c8c9..be8e686 100644 --- a/sap_hana_single_node_install/ibmcloud_powervs/variables.tf +++ b/sap_hana_single_node_install/ibmcloud_powervs/variables.tf @@ -20,9 +20,9 @@ variable "ibmcloud_powervs_location" { description = "Target IBM Power VS location (colocated at a IBM Cloud VPC Infrastructure Availability Zone)" } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_hana_single_node_install/ibmcloud_vs/main.tf b/sap_hana_single_node_install/ibmcloud_vs/main.tf index e17854a..05b370f 100644 --- a/sap_hana_single_node_install/ibmcloud_vs/main.tf +++ b/sap_hana_single_node_install/ibmcloud_vs/main.tf @@ -62,20 +62,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_hana_single_node_install/ibmcloud_vs/variables.tf b/sap_hana_single_node_install/ibmcloud_vs/variables.tf index 15fa2e4..15c3a9a 100644 --- a/sap_hana_single_node_install/ibmcloud_vs/variables.tf +++ b/sap_hana_single_node_install/ibmcloud_vs/variables.tf @@ -26,9 +26,9 @@ variable "ibmcloud_vpc_availability_zone" { } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_nwas_abap_hana_install/ibmcloud_powervs/main.tf b/sap_nwas_abap_hana_install/ibmcloud_powervs/main.tf index ebc89b3..8d09e4c 100644 --- a/sap_nwas_abap_hana_install/ibmcloud_powervs/main.tf +++ b/sap_nwas_abap_hana_install/ibmcloud_powervs/main.tf @@ -65,20 +65,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_nwas_abap_hana_install/ibmcloud_powervs/variables.tf b/sap_nwas_abap_hana_install/ibmcloud_powervs/variables.tf index a9a408b..fc19f09 100644 --- a/sap_nwas_abap_hana_install/ibmcloud_powervs/variables.tf +++ b/sap_nwas_abap_hana_install/ibmcloud_powervs/variables.tf @@ -20,9 +20,9 @@ variable "ibmcloud_powervs_location" { description = "Target IBM Power VS location (colocated at a IBM Cloud VPC Infrastructure Availability Zone)" } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_nwas_abap_hana_install/ibmcloud_vs/main.tf b/sap_nwas_abap_hana_install/ibmcloud_vs/main.tf index cecb0f1..e25a352 100644 --- a/sap_nwas_abap_hana_install/ibmcloud_vs/main.tf +++ b/sap_nwas_abap_hana_install/ibmcloud_vs/main.tf @@ -65,20 +65,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_nwas_abap_hana_install/ibmcloud_vs/variables.tf b/sap_nwas_abap_hana_install/ibmcloud_vs/variables.tf index aa72060..726f593 100644 --- a/sap_nwas_abap_hana_install/ibmcloud_vs/variables.tf +++ b/sap_nwas_abap_hana_install/ibmcloud_vs/variables.tf @@ -26,9 +26,9 @@ variable "ibmcloud_vpc_availability_zone" { } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_nwas_abap_ibmdb2_install/ibmcloud_vs/main.tf b/sap_nwas_abap_ibmdb2_install/ibmcloud_vs/main.tf index 60db60a..6ae7629 100644 --- a/sap_nwas_abap_ibmdb2_install/ibmcloud_vs/main.tf +++ b/sap_nwas_abap_ibmdb2_install/ibmcloud_vs/main.tf @@ -65,20 +65,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_nwas_abap_ibmdb2_install/ibmcloud_vs/variables.tf b/sap_nwas_abap_ibmdb2_install/ibmcloud_vs/variables.tf index 275026c..ab5b43c 100644 --- a/sap_nwas_abap_ibmdb2_install/ibmcloud_vs/variables.tf +++ b/sap_nwas_abap_ibmdb2_install/ibmcloud_vs/variables.tf @@ -26,9 +26,9 @@ variable "ibmcloud_vpc_availability_zone" { } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_nwas_abap_oracledb_install/ibmcloud_vs/main.tf b/sap_nwas_abap_oracledb_install/ibmcloud_vs/main.tf index 7f20ffd..f85a6e9 100644 --- a/sap_nwas_abap_oracledb_install/ibmcloud_vs/main.tf +++ b/sap_nwas_abap_oracledb_install/ibmcloud_vs/main.tf @@ -65,20 +65,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_nwas_abap_oracledb_install/ibmcloud_vs/variables.tf b/sap_nwas_abap_oracledb_install/ibmcloud_vs/variables.tf index 41e6a50..e351ccd 100644 --- a/sap_nwas_abap_oracledb_install/ibmcloud_vs/variables.tf +++ b/sap_nwas_abap_oracledb_install/ibmcloud_vs/variables.tf @@ -26,9 +26,9 @@ variable "ibmcloud_vpc_availability_zone" { } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_nwas_abap_sapase_install/ibmcloud_vs/main.tf b/sap_nwas_abap_sapase_install/ibmcloud_vs/main.tf index 304aedf..2779022 100644 --- a/sap_nwas_abap_sapase_install/ibmcloud_vs/main.tf +++ b/sap_nwas_abap_sapase_install/ibmcloud_vs/main.tf @@ -65,20 +65,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_nwas_abap_sapase_install/ibmcloud_vs/variables.tf b/sap_nwas_abap_sapase_install/ibmcloud_vs/variables.tf index 408d370..ba20037 100644 --- a/sap_nwas_abap_sapase_install/ibmcloud_vs/variables.tf +++ b/sap_nwas_abap_sapase_install/ibmcloud_vs/variables.tf @@ -26,9 +26,9 @@ variable "ibmcloud_vpc_availability_zone" { } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_nwas_abap_sapmaxdb_install/ibmcloud_vs/main.tf b/sap_nwas_abap_sapmaxdb_install/ibmcloud_vs/main.tf index 6a5d163..b920fd2 100644 --- a/sap_nwas_abap_sapmaxdb_install/ibmcloud_vs/main.tf +++ b/sap_nwas_abap_sapmaxdb_install/ibmcloud_vs/main.tf @@ -65,20 +65,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_nwas_abap_sapmaxdb_install/ibmcloud_vs/variables.tf b/sap_nwas_abap_sapmaxdb_install/ibmcloud_vs/variables.tf index 63f207b..6637094 100644 --- a/sap_nwas_abap_sapmaxdb_install/ibmcloud_vs/variables.tf +++ b/sap_nwas_abap_sapmaxdb_install/ibmcloud_vs/variables.tf @@ -26,9 +26,9 @@ variable "ibmcloud_vpc_availability_zone" { } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_nwas_java_ibmdb2_install/ibmcloud_vs/main.tf b/sap_nwas_java_ibmdb2_install/ibmcloud_vs/main.tf index 438fc7a..3d4dd28 100644 --- a/sap_nwas_java_ibmdb2_install/ibmcloud_vs/main.tf +++ b/sap_nwas_java_ibmdb2_install/ibmcloud_vs/main.tf @@ -65,20 +65,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_nwas_java_ibmdb2_install/ibmcloud_vs/variables.tf b/sap_nwas_java_ibmdb2_install/ibmcloud_vs/variables.tf index 180a79d..33d2d3e 100644 --- a/sap_nwas_java_ibmdb2_install/ibmcloud_vs/variables.tf +++ b/sap_nwas_java_ibmdb2_install/ibmcloud_vs/variables.tf @@ -26,9 +26,9 @@ variable "ibmcloud_vpc_availability_zone" { } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_nwas_java_sapase_install/ibmcloud_vs/main.tf b/sap_nwas_java_sapase_install/ibmcloud_vs/main.tf index 0229973..c7a04c9 100644 --- a/sap_nwas_java_sapase_install/ibmcloud_vs/main.tf +++ b/sap_nwas_java_sapase_install/ibmcloud_vs/main.tf @@ -65,20 +65,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_nwas_java_sapase_install/ibmcloud_vs/variables.tf b/sap_nwas_java_sapase_install/ibmcloud_vs/variables.tf index eb5efa0..cf7e99c 100644 --- a/sap_nwas_java_sapase_install/ibmcloud_vs/variables.tf +++ b/sap_nwas_java_sapase_install/ibmcloud_vs/variables.tf @@ -26,9 +26,9 @@ variable "ibmcloud_vpc_availability_zone" { } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_s4hana_single_node_install/ibmcloud_powervs/main.tf b/sap_s4hana_single_node_install/ibmcloud_powervs/main.tf index 782e884..fe834b7 100644 --- a/sap_s4hana_single_node_install/ibmcloud_powervs/main.tf +++ b/sap_s4hana_single_node_install/ibmcloud_powervs/main.tf @@ -65,20 +65,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_s4hana_single_node_install/ibmcloud_powervs/variables.tf b/sap_s4hana_single_node_install/ibmcloud_powervs/variables.tf index 56e4f2f..0e5efee 100644 --- a/sap_s4hana_single_node_install/ibmcloud_powervs/variables.tf +++ b/sap_s4hana_single_node_install/ibmcloud_powervs/variables.tf @@ -20,9 +20,9 @@ variable "ibmcloud_powervs_location" { description = "Target IBM Power VS location (colocated at a IBM Cloud VPC Infrastructure Availability Zone)" } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name , or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_s4hana_single_node_install/ibmcloud_vs/main.tf b/sap_s4hana_single_node_install/ibmcloud_vs/main.tf index 3d6f6ae..71f608b 100644 --- a/sap_s4hana_single_node_install/ibmcloud_vs/main.tf +++ b/sap_s4hana_single_node_install/ibmcloud_vs/main.tf @@ -65,20 +65,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_s4hana_single_node_install/ibmcloud_vs/variables.tf b/sap_s4hana_single_node_install/ibmcloud_vs/variables.tf index 4278c89..fb33bb5 100644 --- a/sap_s4hana_single_node_install/ibmcloud_vs/variables.tf +++ b/sap_s4hana_single_node_install/ibmcloud_vs/variables.tf @@ -26,9 +26,9 @@ variable "ibmcloud_vpc_availability_zone" { } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_powervs/main.tf b/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_powervs/main.tf index 7d25845..6df6c1e 100644 --- a/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_powervs/main.tf +++ b/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_powervs/main.tf @@ -66,20 +66,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_powervs/variables.tf b/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_powervs/variables.tf index 73017f3..081454f 100644 --- a/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_powervs/variables.tf +++ b/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_powervs/variables.tf @@ -20,9 +20,9 @@ variable "ibmcloud_powervs_location" { description = "Target IBM Power VS location (colocated at a IBM Cloud VPC Infrastructure Availability Zone)" } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_vs/main.tf b/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_vs/main.tf index aafbf5a..6faca7b 100644 --- a/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_vs/main.tf +++ b/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_vs/main.tf @@ -66,20 +66,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_vs/variables.tf b/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_vs/variables.tf index cdb560a..afd3887 100644 --- a/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_vs/variables.tf +++ b/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_vs/variables.tf @@ -26,9 +26,9 @@ variable "ibmcloud_vpc_availability_zone" { } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/main.tf b/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/main.tf index 2ed8d3f..7161f33 100644 --- a/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/main.tf +++ b/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/main.tf @@ -68,20 +68,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variables.tf b/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variables.tf index 267315e..218539a 100644 --- a/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variables.tf +++ b/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variables.tf @@ -20,9 +20,9 @@ variable "ibmcloud_powervs_location" { description = "Target IBM Power VS location (colocated at a IBM Cloud VPC Infrastructure Availability Zone)" } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" diff --git a/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/main.tf b/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/main.tf index a947ebb..67608b0 100644 --- a/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/main.tf +++ b/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/main.tf @@ -94,20 +94,20 @@ module "run_bastion_inject_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_host_network_access_sap_module" { diff --git a/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/variables.tf b/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/variables.tf index b486104..c1e0da9 100644 --- a/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/variables.tf +++ b/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/variables.tf @@ -26,9 +26,9 @@ variable "ibmcloud_vpc_availability_zone" { } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" From 4b5261774b617b0eb77dd59bca68f996fb192161 Mon Sep 17 00:00:00 2001 From: sean-freeman Date: Sat, 4 Mar 2023 16:12:07 +0000 Subject: [PATCH 03/12] fix: update var desc --- sap_bw4hana_single_node_install/ibmcloud_powervs/variables.tf | 2 +- sap_bw4hana_single_node_install/ibmcloud_vs/variables.tf | 2 +- sap_ecc_hana_single_node_install/ibmcloud_powervs/variables.tf | 2 +- sap_ecc_hana_single_node_install/ibmcloud_vs/variables.tf | 2 +- .../ibmcloud_powervs/variables.tf | 2 +- .../ibmcloud_vs/variables.tf | 2 +- sap_ecc_ibmdb2_single_node_install/ibmcloud_vs/variables.tf | 2 +- sap_ecc_oracledb_single_node_install/ibmcloud_vs/variables.tf | 2 +- sap_ecc_sapase_single_node_install/ibmcloud_vs/variables.tf | 2 +- sap_ecc_sapmaxdb_single_node_install/ibmcloud_vs/variables.tf | 2 +- sap_hana_single_node_install/ibmcloud_powervs/variables.tf | 2 +- sap_hana_single_node_install/ibmcloud_vs/variables.tf | 2 +- sap_nwas_abap_hana_install/ibmcloud_powervs/variables.tf | 2 +- sap_nwas_abap_hana_install/ibmcloud_vs/variables.tf | 2 +- sap_nwas_abap_ibmdb2_install/ibmcloud_vs/variables.tf | 2 +- sap_nwas_abap_oracledb_install/ibmcloud_vs/variables.tf | 2 +- sap_nwas_abap_sapase_install/ibmcloud_vs/variables.tf | 2 +- sap_nwas_abap_sapmaxdb_install/ibmcloud_vs/variables.tf | 2 +- sap_nwas_java_ibmdb2_install/ibmcloud_vs/variables.tf | 2 +- sap_nwas_java_sapase_install/ibmcloud_vs/variables.tf | 2 +- sap_s4hana_single_node_install/ibmcloud_powervs/variables.tf | 2 +- sap_s4hana_single_node_install/ibmcloud_vs/variables.tf | 2 +- .../ibmcloud_powervs/variables.tf | 2 +- .../ibmcloud_vs/variables.tf | 2 +- .../ibmcloud_powervs/variables.tf | 2 +- .../ibmcloud_vs/variables.tf | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/sap_bw4hana_single_node_install/ibmcloud_powervs/variables.tf b/sap_bw4hana_single_node_install/ibmcloud_powervs/variables.tf index 7b71ece..1524641 100644 --- a/sap_bw4hana_single_node_install/ibmcloud_powervs/variables.tf +++ b/sap_bw4hana_single_node_install/ibmcloud_powervs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_powervs_location" { - description = "Target IBM Power VS location (colocated at a IBM Cloud VPC Infrastructure Availability Zone)" + description = "Target IBM Power VS location (e.g. WDC06). Each location is colocated at a IBM Cloud VPC Infrastructure Availability Zone (e.g. us-east-2)" } #variable "ibmcloud_iam_yesno" { diff --git a/sap_bw4hana_single_node_install/ibmcloud_vs/variables.tf b/sap_bw4hana_single_node_install/ibmcloud_vs/variables.tf index bcb2c30..7f6c4b2 100644 --- a/sap_bw4hana_single_node_install/ibmcloud_vs/variables.tf +++ b/sap_bw4hana_single_node_install/ibmcloud_vs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_vpc_availability_zone" { - description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" validation { error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." diff --git a/sap_ecc_hana_single_node_install/ibmcloud_powervs/variables.tf b/sap_ecc_hana_single_node_install/ibmcloud_powervs/variables.tf index eb59702..0e344b2 100644 --- a/sap_ecc_hana_single_node_install/ibmcloud_powervs/variables.tf +++ b/sap_ecc_hana_single_node_install/ibmcloud_powervs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_powervs_location" { - description = "Target IBM Power VS location (colocated at a IBM Cloud VPC Infrastructure Availability Zone)" + description = "Target IBM Power VS location (e.g. WDC06). Each location is colocated at a IBM Cloud VPC Infrastructure Availability Zone (e.g. us-east-2)" } #variable "ibmcloud_iam_yesno" { diff --git a/sap_ecc_hana_single_node_install/ibmcloud_vs/variables.tf b/sap_ecc_hana_single_node_install/ibmcloud_vs/variables.tf index d50b95b..b8d348b 100644 --- a/sap_ecc_hana_single_node_install/ibmcloud_vs/variables.tf +++ b/sap_ecc_hana_single_node_install/ibmcloud_vs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_vpc_availability_zone" { - description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" validation { error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." diff --git a/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variables.tf b/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variables.tf index 45b3359..0bcd159 100644 --- a/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variables.tf +++ b/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_powervs_location" { - description = "Target IBM Power VS location (colocated at a IBM Cloud VPC Infrastructure Availability Zone)" + description = "Target IBM Power VS location (e.g. WDC06). Each location is colocated at a IBM Cloud VPC Infrastructure Availability Zone (e.g. us-east-2)" } #variable "ibmcloud_iam_yesno" { diff --git a/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/variables.tf b/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/variables.tf index 7122c5f..00b650e 100644 --- a/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/variables.tf +++ b/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_vpc_availability_zone" { - description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" validation { error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." diff --git a/sap_ecc_ibmdb2_single_node_install/ibmcloud_vs/variables.tf b/sap_ecc_ibmdb2_single_node_install/ibmcloud_vs/variables.tf index 8b6b6ac..023d437 100644 --- a/sap_ecc_ibmdb2_single_node_install/ibmcloud_vs/variables.tf +++ b/sap_ecc_ibmdb2_single_node_install/ibmcloud_vs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_vpc_availability_zone" { - description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" validation { error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." diff --git a/sap_ecc_oracledb_single_node_install/ibmcloud_vs/variables.tf b/sap_ecc_oracledb_single_node_install/ibmcloud_vs/variables.tf index d569daa..76fdc99 100644 --- a/sap_ecc_oracledb_single_node_install/ibmcloud_vs/variables.tf +++ b/sap_ecc_oracledb_single_node_install/ibmcloud_vs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_vpc_availability_zone" { - description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" validation { error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." diff --git a/sap_ecc_sapase_single_node_install/ibmcloud_vs/variables.tf b/sap_ecc_sapase_single_node_install/ibmcloud_vs/variables.tf index 3fbef35..a28ad71 100644 --- a/sap_ecc_sapase_single_node_install/ibmcloud_vs/variables.tf +++ b/sap_ecc_sapase_single_node_install/ibmcloud_vs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_vpc_availability_zone" { - description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" validation { error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." diff --git a/sap_ecc_sapmaxdb_single_node_install/ibmcloud_vs/variables.tf b/sap_ecc_sapmaxdb_single_node_install/ibmcloud_vs/variables.tf index 62d375e..adee444 100644 --- a/sap_ecc_sapmaxdb_single_node_install/ibmcloud_vs/variables.tf +++ b/sap_ecc_sapmaxdb_single_node_install/ibmcloud_vs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_vpc_availability_zone" { - description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" validation { error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." diff --git a/sap_hana_single_node_install/ibmcloud_powervs/variables.tf b/sap_hana_single_node_install/ibmcloud_powervs/variables.tf index be8e686..84a7031 100644 --- a/sap_hana_single_node_install/ibmcloud_powervs/variables.tf +++ b/sap_hana_single_node_install/ibmcloud_powervs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_powervs_location" { - description = "Target IBM Power VS location (colocated at a IBM Cloud VPC Infrastructure Availability Zone)" + description = "Target IBM Power VS location (e.g. WDC06). Each location is colocated at a IBM Cloud VPC Infrastructure Availability Zone (e.g. us-east-2)" } #variable "ibmcloud_iam_yesno" { diff --git a/sap_hana_single_node_install/ibmcloud_vs/variables.tf b/sap_hana_single_node_install/ibmcloud_vs/variables.tf index 15c3a9a..703f39c 100644 --- a/sap_hana_single_node_install/ibmcloud_vs/variables.tf +++ b/sap_hana_single_node_install/ibmcloud_vs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_vpc_availability_zone" { - description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" validation { error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." diff --git a/sap_nwas_abap_hana_install/ibmcloud_powervs/variables.tf b/sap_nwas_abap_hana_install/ibmcloud_powervs/variables.tf index fc19f09..43a18bb 100644 --- a/sap_nwas_abap_hana_install/ibmcloud_powervs/variables.tf +++ b/sap_nwas_abap_hana_install/ibmcloud_powervs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_powervs_location" { - description = "Target IBM Power VS location (colocated at a IBM Cloud VPC Infrastructure Availability Zone)" + description = "Target IBM Power VS location (e.g. WDC06). Each location is colocated at a IBM Cloud VPC Infrastructure Availability Zone (e.g. us-east-2)" } #variable "ibmcloud_iam_yesno" { diff --git a/sap_nwas_abap_hana_install/ibmcloud_vs/variables.tf b/sap_nwas_abap_hana_install/ibmcloud_vs/variables.tf index 726f593..dd90398 100644 --- a/sap_nwas_abap_hana_install/ibmcloud_vs/variables.tf +++ b/sap_nwas_abap_hana_install/ibmcloud_vs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_vpc_availability_zone" { - description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" validation { error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." diff --git a/sap_nwas_abap_ibmdb2_install/ibmcloud_vs/variables.tf b/sap_nwas_abap_ibmdb2_install/ibmcloud_vs/variables.tf index ab5b43c..d632234 100644 --- a/sap_nwas_abap_ibmdb2_install/ibmcloud_vs/variables.tf +++ b/sap_nwas_abap_ibmdb2_install/ibmcloud_vs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_vpc_availability_zone" { - description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" validation { error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." diff --git a/sap_nwas_abap_oracledb_install/ibmcloud_vs/variables.tf b/sap_nwas_abap_oracledb_install/ibmcloud_vs/variables.tf index e351ccd..57f9768 100644 --- a/sap_nwas_abap_oracledb_install/ibmcloud_vs/variables.tf +++ b/sap_nwas_abap_oracledb_install/ibmcloud_vs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_vpc_availability_zone" { - description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" validation { error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." diff --git a/sap_nwas_abap_sapase_install/ibmcloud_vs/variables.tf b/sap_nwas_abap_sapase_install/ibmcloud_vs/variables.tf index ba20037..3c71484 100644 --- a/sap_nwas_abap_sapase_install/ibmcloud_vs/variables.tf +++ b/sap_nwas_abap_sapase_install/ibmcloud_vs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_vpc_availability_zone" { - description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" validation { error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." diff --git a/sap_nwas_abap_sapmaxdb_install/ibmcloud_vs/variables.tf b/sap_nwas_abap_sapmaxdb_install/ibmcloud_vs/variables.tf index 6637094..e6be1a3 100644 --- a/sap_nwas_abap_sapmaxdb_install/ibmcloud_vs/variables.tf +++ b/sap_nwas_abap_sapmaxdb_install/ibmcloud_vs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_vpc_availability_zone" { - description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" validation { error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." diff --git a/sap_nwas_java_ibmdb2_install/ibmcloud_vs/variables.tf b/sap_nwas_java_ibmdb2_install/ibmcloud_vs/variables.tf index 33d2d3e..0733598 100644 --- a/sap_nwas_java_ibmdb2_install/ibmcloud_vs/variables.tf +++ b/sap_nwas_java_ibmdb2_install/ibmcloud_vs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_vpc_availability_zone" { - description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" validation { error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." diff --git a/sap_nwas_java_sapase_install/ibmcloud_vs/variables.tf b/sap_nwas_java_sapase_install/ibmcloud_vs/variables.tf index cf7e99c..af57a14 100644 --- a/sap_nwas_java_sapase_install/ibmcloud_vs/variables.tf +++ b/sap_nwas_java_sapase_install/ibmcloud_vs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_vpc_availability_zone" { - description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" validation { error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." diff --git a/sap_s4hana_single_node_install/ibmcloud_powervs/variables.tf b/sap_s4hana_single_node_install/ibmcloud_powervs/variables.tf index 0e5efee..62df6f4 100644 --- a/sap_s4hana_single_node_install/ibmcloud_powervs/variables.tf +++ b/sap_s4hana_single_node_install/ibmcloud_powervs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_powervs_location" { - description = "Target IBM Power VS location (colocated at a IBM Cloud VPC Infrastructure Availability Zone)" + description = "Target IBM Power VS location (e.g. WDC06). Each location is colocated at a IBM Cloud VPC Infrastructure Availability Zone (e.g. us-east-2)" } #variable "ibmcloud_iam_yesno" { diff --git a/sap_s4hana_single_node_install/ibmcloud_vs/variables.tf b/sap_s4hana_single_node_install/ibmcloud_vs/variables.tf index fb33bb5..1fc08b6 100644 --- a/sap_s4hana_single_node_install/ibmcloud_vs/variables.tf +++ b/sap_s4hana_single_node_install/ibmcloud_vs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_vpc_availability_zone" { - description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" validation { error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." diff --git a/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_powervs/variables.tf b/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_powervs/variables.tf index 081454f..0e8827d 100644 --- a/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_powervs/variables.tf +++ b/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_powervs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_powervs_location" { - description = "Target IBM Power VS location (colocated at a IBM Cloud VPC Infrastructure Availability Zone)" + description = "Target IBM Power VS location (e.g. WDC06). Each location is colocated at a IBM Cloud VPC Infrastructure Availability Zone (e.g. us-east-2)" } #variable "ibmcloud_iam_yesno" { diff --git a/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_vs/variables.tf b/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_vs/variables.tf index afd3887..0cc45fb 100644 --- a/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_vs/variables.tf +++ b/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_vs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_vpc_availability_zone" { - description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" validation { error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." diff --git a/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variables.tf b/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variables.tf index 218539a..95757e0 100644 --- a/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variables.tf +++ b/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_powervs_location" { - description = "Target IBM Power VS location (colocated at a IBM Cloud VPC Infrastructure Availability Zone)" + description = "Target IBM Power VS location (e.g. WDC06). Each location is colocated at a IBM Cloud VPC Infrastructure Availability Zone (e.g. us-east-2)" } #variable "ibmcloud_iam_yesno" { diff --git a/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/variables.tf b/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/variables.tf index c1e0da9..844ea2c 100644 --- a/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/variables.tf +++ b/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/variables.tf @@ -17,7 +17,7 @@ variable "ibmcloud_resource_group" { } variable "ibmcloud_vpc_availability_zone" { - description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" validation { error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." From 3bfd4df661cc9b2c8935d0948557f81b399f6ced Mon Sep 17 00:00:00 2001 From: sean-freeman Date: Thu, 23 Mar 2023 16:34:06 +0000 Subject: [PATCH 04/12] docs: clarity on table key --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e5fc49e..4bf8524 100644 --- a/README.md +++ b/README.md @@ -65,12 +65,12 @@ The following is an overview of the Infrastructure-as-Code (IaC) provisioning, f |:---|:---:|:---:|:---:|:---:|:---:|:---:|:---:| |   *Product* | EC2 Virtual Server | VM | VM | Virtual Server | IBM Power Virtual Server | LPAR | VM | |

***Account Init*** | | | | | | | | -| Create Resource Group. Or re-use existing Resource Group | :x: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | N/A | N/A | +| Create Resource Group. Or re-use existing Resource Group | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | N/A | N/A | | Create Networks (VPC/VNet), Subnets, and Internet Access. Or re-use existing VPC/VNet | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | N/A | N/A | |
***Account Bootstrap
(aka. minimal landing zone)*** | | | | | | | | | Create Private DNS, Network Security | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | N/A | N/A | -| Create Network Interconnectivity hub | :white_check_mark: | :x: | :x: | :white_check_mark: | :white_check_mark: | N/A | N/A | -| Create TLS key pair for SSH and Import to Cloud Platform | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Create Network Interconnectivity hub | :white_check_mark: | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :white_check_mark: | N/A | N/A | +| Create TLS key pair for SSH and Import to Cloud Platform | :white_check_mark: | :no_entry_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
***Bastion Injection*** | | | | | | | | | Create Subnet and Network Security for Bastion | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | N/A | N/A | | Create Bastion host and Public IP address | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | N/A | N/A | @@ -82,6 +82,12 @@ The following is an overview of the Infrastructure-as-Code (IaC) provisioning, f | Create Host/s | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +**Key:** +- :white_check_mark: Ready and Tested +- :warning: Pending work +- :x: Not available yet +- :no_entry_sign: Capability not provided by vendor (or construct concept does not exist) + --- # Disclaimer From 4309be6137c7a3df073d3f621fc1ef327fdb78f9 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Thu, 13 Apr 2023 02:44:47 +0100 Subject: [PATCH 05/12] docs: update svg --- docs/terraform_sap_summary.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/terraform_sap_summary.svg b/docs/terraform_sap_summary.svg index 9371143..a387467 100644 --- a/docs/terraform_sap_summary.svg +++ b/docs/terraform_sap_summary.svg @@ -1,3 +1,3 @@ -
Terraform Templates for SAP

SAP Software solution scenario deployment
Terraform Templates...
Ansible Collection:
SAP install
Ansible Collection:...
Ansible Roles
Ansible Ro...
Terraform Modules for SAP:
Infrastructure Automation
aka. Infrastructure-as-Code
Terraform Modules for SAP:...
Terraform Modules for SAP:
Build Automation
aka. Configuration-as-Code
Terraform Modules for SAP:...
Shell or Python commands
Shell or Python comm...
Text is not SVG - cannot display
\ No newline at end of file +
Terraform Templates for SAP

SAP Software solution scenario deployment
Terraform Templates...
Ansible
Playbook:
SAP Scenario
(e.g. SAP S/4HANA)
Ansible...
Ansible Roles
Ansible Ro...
Terraform Modules for SAP:
Infrastructure Automation
aka. Infrastructure-as-Code
Terraform Modules for SAP:...
Terraform Modules for SAP:
Build Automation
aka. Configuration-as-Code
Terraform Modules for SAP:...
Ansible
Roles:
sap_hana_install
sap_swpm
Ansible...
Ansible
Collection:
sap_install
Ansible...
Shell or Python commands
Shell or Python comm...
Text is not SVG - cannot display
\ No newline at end of file From e7296bc99c079f96c6e62cc8a9a65dce0fe44058 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Mon, 17 Apr 2023 16:51:40 +0100 Subject: [PATCH 06/12] fix: re-baseline all storage configs --- .../aws_ec2_instance/variable_map_hosts.tf | 10 ++++----- .../gcp_ce_vm/variable_map_hosts.tf | 10 ++++----- .../ibmcloud_powervs/variable_map_hosts.tf | 10 ++++----- .../ibmpowervc/variable_map_hosts.tf | 8 +++---- .../msazure_vm/variable_map_hosts.tf | 2 +- .../aws_ec2_instance/variable_map_hosts.tf | 2 +- .../gcp_ce_vm/variable_map_hosts.tf | 10 ++++----- .../ibmcloud_powervs/variable_map_hosts.tf | 10 ++++----- .../ibmpowervc/variable_map_hosts.tf | 8 +++---- .../msazure_vm/variable_map_hosts.tf | 2 +- .../ibmcloud_powervs/variable_map_hosts.tf | 10 ++++----- .../gcp_ce_vm/variable_map_hosts.tf | 19 +++++++++++++--- .../gcp_ce_vm/variable_map_hosts.tf | 19 +++++++++++++--- .../gcp_ce_vm/variable_map_hosts.tf | 19 +++++++++++++--- .../gcp_ce_vm/variable_map_hosts.tf | 19 +++++++++++++--- .../aws_ec2_instance/variable_map_hosts.tf | 2 +- .../gcp_ce_vm/variable_map_hosts.tf | 10 ++++----- .../ibmcloud_powervs/variable_map_hosts.tf | 10 ++++----- .../ibmpowervc/variable_map_hosts.tf | 8 +++---- .../msazure_vm/variable_map_hosts.tf | 2 +- .../gcp_ce_vm/variable_map_hosts.tf | 19 ++++++++++++---- .../gcp_ce_vm/variable_map_hosts.tf | 19 +++++++++++++--- .../gcp_ce_vm/variable_map_hosts.tf | 19 +++++++++++++--- .../gcp_ce_vm/variable_map_hosts.tf | 19 +++++++++++++--- .../gcp_ce_vm/variable_map_hosts.tf | 19 +++++++++++++--- .../gcp_ce_vm/variable_map_hosts.tf | 19 +++++++++++++--- .../aws_ec2_instance/variable_map_hosts.tf | 10 ++++----- .../gcp_ce_vm/variable_map_hosts.tf | 10 ++++----- .../ibmcloud_powervs/variable_map_hosts.tf | 10 ++++----- .../ibmpowervc/variable_map_hosts.tf | 8 +++---- .../msazure_vm/variable_map_hosts.tf | 22 +++++++++---------- .../aws_ec2_instance/variable_map_hosts.tf | 10 ++++----- .../gcp_ce_vm/variable_map_hosts.tf | 10 ++++----- .../ibmcloud_powervs/variable_map_hosts.tf | 10 ++++----- .../ibmpowervc/variable_map_hosts.tf | 8 +++---- .../msazure_vm/variable_map_hosts.tf | 16 +++++++------- .../ibmcloud_powervs/variable_map_hosts.tf | 10 ++++----- 37 files changed, 278 insertions(+), 150 deletions(-) diff --git a/sap_bw4hana_single_node_install/aws_ec2_instance/variable_map_hosts.tf b/sap_bw4hana_single_node_install/aws_ec2_instance/variable_map_hosts.tf index 1fe2237..db4e53e 100644 --- a/sap_bw4hana_single_node_install/aws_ec2_instance/variable_map_hosts.tf +++ b/sap_bw4hana_single_node_install/aws_ec2_instance/variable_map_hosts.tf @@ -62,11 +62,11 @@ variable "map_host_specifications" { disk_volume_capacity_sapmnt = 50 filesystem_sapmnt = "xfs" - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 - #disk_volume_type_swap = "gp3" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "gp3" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" } } diff --git a/sap_bw4hana_single_node_install/gcp_ce_vm/variable_map_hosts.tf b/sap_bw4hana_single_node_install/gcp_ce_vm/variable_map_hosts.tf index 9d596f8..6a75e2f 100644 --- a/sap_bw4hana_single_node_install/gcp_ce_vm/variable_map_hosts.tf +++ b/sap_bw4hana_single_node_install/gcp_ce_vm/variable_map_hosts.tf @@ -63,11 +63,11 @@ variable "map_host_specifications" { filesystem_sapmnt = "xfs" nfs_boolean_sapmnt = false - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 - #disk_volume_type_swap = "pd-standard" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "pd-standard" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" disk_volume_type_software = "pd-standard" disk_volume_capacity_software = 100 diff --git a/sap_bw4hana_single_node_install/ibmcloud_powervs/variable_map_hosts.tf b/sap_bw4hana_single_node_install/ibmcloud_powervs/variable_map_hosts.tf index 4b8a6a5..06fe309 100644 --- a/sap_bw4hana_single_node_install/ibmcloud_powervs/variable_map_hosts.tf +++ b/sap_bw4hana_single_node_install/ibmcloud_powervs/variable_map_hosts.tf @@ -64,11 +64,11 @@ variable "map_host_specifications" { disk_volume_capacity_sapmnt = 50 filesystem_sapmnt = "xfs" - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 - #disk_volume_type_swap = "5iops-tier" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "tier1" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" } } diff --git a/sap_bw4hana_single_node_install/ibmpowervc/variable_map_hosts.tf b/sap_bw4hana_single_node_install/ibmpowervc/variable_map_hosts.tf index ee6a7b7..92449b6 100644 --- a/sap_bw4hana_single_node_install/ibmpowervc/variable_map_hosts.tf +++ b/sap_bw4hana_single_node_install/ibmpowervc/variable_map_hosts.tf @@ -57,11 +57,11 @@ variable "map_host_specifications" { disk_volume_capacity_sapmnt = 50 filesystem_sapmnt = "xfs" - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 disk_volume_type_swap = "" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" } } diff --git a/sap_bw4hana_single_node_install/msazure_vm/variable_map_hosts.tf b/sap_bw4hana_single_node_install/msazure_vm/variable_map_hosts.tf index 78f6f66..900ab04 100644 --- a/sap_bw4hana_single_node_install/msazure_vm/variable_map_hosts.tf +++ b/sap_bw4hana_single_node_install/msazure_vm/variable_map_hosts.tf @@ -54,7 +54,7 @@ variable "map_host_specifications" { disk_volume_count_usr_sap = 1 // max of 1 disk_volume_type_usr_sap = "E20" - disk_volume_capacity_usr_sap = 512 + disk_volume_capacity_usr_sap = 512 // bad sizing, but use this so each drive size is unique filesystem_usr_sap = "xfs" disk_volume_count_sapmnt = 1 // max of 1 diff --git a/sap_ecc_hana_single_node_install/aws_ec2_instance/variable_map_hosts.tf b/sap_ecc_hana_single_node_install/aws_ec2_instance/variable_map_hosts.tf index b12d292..22f275e 100644 --- a/sap_ecc_hana_single_node_install/aws_ec2_instance/variable_map_hosts.tf +++ b/sap_ecc_hana_single_node_install/aws_ec2_instance/variable_map_hosts.tf @@ -65,7 +65,7 @@ variable "map_host_specifications" { #disk_swapfile_size_gb = 2 // not required if disk volume set disk_volume_count_swap = 1 // max of 1 disk_volume_type_swap = "gp3" - disk_volume_capacity_swap = 64 + disk_volume_capacity_swap = 32 filesystem_swap = "xfs" } diff --git a/sap_ecc_hana_single_node_install/gcp_ce_vm/variable_map_hosts.tf b/sap_ecc_hana_single_node_install/gcp_ce_vm/variable_map_hosts.tf index df9693d..17f48aa 100644 --- a/sap_ecc_hana_single_node_install/gcp_ce_vm/variable_map_hosts.tf +++ b/sap_ecc_hana_single_node_install/gcp_ce_vm/variable_map_hosts.tf @@ -63,11 +63,11 @@ variable "map_host_specifications" { filesystem_sapmnt = "xfs" nfs_boolean_sapmnt = false - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 - #disk_volume_type_swap = "pd-standard" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "pd-standard" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" disk_volume_type_software = "pd-standard" disk_volume_capacity_software = 100 diff --git a/sap_ecc_hana_single_node_install/ibmcloud_powervs/variable_map_hosts.tf b/sap_ecc_hana_single_node_install/ibmcloud_powervs/variable_map_hosts.tf index da14e33..08b7177 100644 --- a/sap_ecc_hana_single_node_install/ibmcloud_powervs/variable_map_hosts.tf +++ b/sap_ecc_hana_single_node_install/ibmcloud_powervs/variable_map_hosts.tf @@ -64,11 +64,11 @@ variable "map_host_specifications" { disk_volume_capacity_sapmnt = 50 filesystem_sapmnt = "xfs" - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 - #disk_volume_type_swap = "5iops-tier" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "tier1" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" } } diff --git a/sap_ecc_hana_single_node_install/ibmpowervc/variable_map_hosts.tf b/sap_ecc_hana_single_node_install/ibmpowervc/variable_map_hosts.tf index 144951d..5ba9984 100644 --- a/sap_ecc_hana_single_node_install/ibmpowervc/variable_map_hosts.tf +++ b/sap_ecc_hana_single_node_install/ibmpowervc/variable_map_hosts.tf @@ -57,11 +57,11 @@ variable "map_host_specifications" { disk_volume_capacity_sapmnt = 50 filesystem_sapmnt = "xfs" - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 disk_volume_type_swap = "" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" } } diff --git a/sap_ecc_hana_single_node_install/msazure_vm/variable_map_hosts.tf b/sap_ecc_hana_single_node_install/msazure_vm/variable_map_hosts.tf index b4ee78e..b2415e4 100644 --- a/sap_ecc_hana_single_node_install/msazure_vm/variable_map_hosts.tf +++ b/sap_ecc_hana_single_node_install/msazure_vm/variable_map_hosts.tf @@ -54,7 +54,7 @@ variable "map_host_specifications" { disk_volume_count_usr_sap = 1 // max of 1 disk_volume_type_usr_sap = "E20" - disk_volume_capacity_usr_sap = 512 + disk_volume_capacity_usr_sap = 512 // bad sizing, but use this so each drive size is unique filesystem_usr_sap = "xfs" disk_volume_count_sapmnt = 1 // max of 1 diff --git a/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variable_map_hosts.tf b/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variable_map_hosts.tf index 9193c28..4d25380 100644 --- a/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variable_map_hosts.tf +++ b/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variable_map_hosts.tf @@ -64,11 +64,11 @@ variable "map_host_specifications" { disk_volume_capacity_sapmnt = 50 filesystem_sapmnt = "xfs" - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 - #disk_volume_type_swap = "5iops-tier" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "tier1" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" } } diff --git a/sap_ecc_ibmdb2_single_node_install/gcp_ce_vm/variable_map_hosts.tf b/sap_ecc_ibmdb2_single_node_install/gcp_ce_vm/variable_map_hosts.tf index 6873463..45f9188 100644 --- a/sap_ecc_ibmdb2_single_node_install/gcp_ce_vm/variable_map_hosts.tf +++ b/sap_ecc_ibmdb2_single_node_install/gcp_ce_vm/variable_map_hosts.tf @@ -22,12 +22,25 @@ variable "map_host_specifications" { disk_volume_count_anydb = 0 + disk_volume_count_anydb = 2 + disk_volume_type_anydb = "pd-standard" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_anydb = 320 + #disk_volume_iops_anydb = + lvm_enable_anydb = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_anydb = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_anydb = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_mount_path_anydb = "/db2" + filesystem_anydb = "xfs" + physical_partition_filesystem_block_size_anydb = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + disk_volume_count_usr_sap = 1 // max of 1 disk_volume_type_usr_sap = "pd-standard" - disk_volume_capacity_usr_sap = 64 + disk_volume_capacity_usr_sap = 256 filesystem_usr_sap = "xfs" - disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_count_sapmnt = 1 // max of 1 disk_volume_type_sapmnt = "pd-standard" disk_volume_capacity_sapmnt = 56 filesystem_sapmnt = "xfs" @@ -36,7 +49,7 @@ variable "map_host_specifications" { #disk_swapfile_size_gb = 2 // not required if disk volume set disk_volume_count_swap = 1 // max of 1 disk_volume_type_swap = "pd-standard" - disk_volume_capacity_swap = 96 + disk_volume_capacity_swap = 64 filesystem_swap = "xfs" disk_volume_type_software = "pd-standard" diff --git a/sap_ecc_oracledb_single_node_install/gcp_ce_vm/variable_map_hosts.tf b/sap_ecc_oracledb_single_node_install/gcp_ce_vm/variable_map_hosts.tf index 254b266..6657d7d 100644 --- a/sap_ecc_oracledb_single_node_install/gcp_ce_vm/variable_map_hosts.tf +++ b/sap_ecc_oracledb_single_node_install/gcp_ce_vm/variable_map_hosts.tf @@ -22,12 +22,25 @@ variable "map_host_specifications" { disk_volume_count_anydb = 0 + disk_volume_count_anydb = 2 + disk_volume_type_anydb = "pd-standard" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_anydb = 320 + #disk_volume_iops_anydb = + lvm_enable_anydb = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_anydb = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_anydb = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_mount_path_anydb = "/oracle" + filesystem_anydb = "xfs" + physical_partition_filesystem_block_size_anydb = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + disk_volume_count_usr_sap = 1 // max of 1 disk_volume_type_usr_sap = "pd-standard" - disk_volume_capacity_usr_sap = 64 + disk_volume_capacity_usr_sap = 256 filesystem_usr_sap = "xfs" - disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_count_sapmnt = 1 // max of 1 disk_volume_type_sapmnt = "pd-standard" disk_volume_capacity_sapmnt = 56 filesystem_sapmnt = "xfs" @@ -36,7 +49,7 @@ variable "map_host_specifications" { #disk_swapfile_size_gb = 2 // not required if disk volume set disk_volume_count_swap = 1 // max of 1 disk_volume_type_swap = "pd-standard" - disk_volume_capacity_swap = 96 + disk_volume_capacity_swap = 64 filesystem_swap = "xfs" disk_volume_type_software = "pd-standard" diff --git a/sap_ecc_sapase_single_node_install/gcp_ce_vm/variable_map_hosts.tf b/sap_ecc_sapase_single_node_install/gcp_ce_vm/variable_map_hosts.tf index cfc8f1f..13a9fdb 100644 --- a/sap_ecc_sapase_single_node_install/gcp_ce_vm/variable_map_hosts.tf +++ b/sap_ecc_sapase_single_node_install/gcp_ce_vm/variable_map_hosts.tf @@ -22,12 +22,25 @@ variable "map_host_specifications" { disk_volume_count_anydb = 0 + disk_volume_count_anydb = 2 + disk_volume_type_anydb = "pd-standard" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_anydb = 320 + #disk_volume_iops_anydb = + lvm_enable_anydb = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_anydb = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_anydb = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_mount_path_anydb = "/sybase" + filesystem_anydb = "xfs" + physical_partition_filesystem_block_size_anydb = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + disk_volume_count_usr_sap = 1 // max of 1 disk_volume_type_usr_sap = "pd-standard" - disk_volume_capacity_usr_sap = 64 + disk_volume_capacity_usr_sap = 256 filesystem_usr_sap = "xfs" - disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_count_sapmnt = 1 // max of 1 disk_volume_type_sapmnt = "pd-standard" disk_volume_capacity_sapmnt = 56 filesystem_sapmnt = "xfs" @@ -36,7 +49,7 @@ variable "map_host_specifications" { #disk_swapfile_size_gb = 2 // not required if disk volume set disk_volume_count_swap = 1 // max of 1 disk_volume_type_swap = "pd-standard" - disk_volume_capacity_swap = 96 + disk_volume_capacity_swap = 64 filesystem_swap = "xfs" disk_volume_type_software = "pd-standard" diff --git a/sap_ecc_sapmaxdb_single_node_install/gcp_ce_vm/variable_map_hosts.tf b/sap_ecc_sapmaxdb_single_node_install/gcp_ce_vm/variable_map_hosts.tf index 0f8e267..8708cec 100644 --- a/sap_ecc_sapmaxdb_single_node_install/gcp_ce_vm/variable_map_hosts.tf +++ b/sap_ecc_sapmaxdb_single_node_install/gcp_ce_vm/variable_map_hosts.tf @@ -22,12 +22,25 @@ variable "map_host_specifications" { disk_volume_count_anydb = 0 + disk_volume_count_anydb = 2 + disk_volume_type_anydb = "pd-standard" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_anydb = 320 + #disk_volume_iops_anydb = + lvm_enable_anydb = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_anydb = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_anydb = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_mount_path_anydb = "/sapdb" + filesystem_anydb = "xfs" + physical_partition_filesystem_block_size_anydb = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + disk_volume_count_usr_sap = 1 // max of 1 disk_volume_type_usr_sap = "pd-standard" - disk_volume_capacity_usr_sap = 64 + disk_volume_capacity_usr_sap = 256 filesystem_usr_sap = "xfs" - disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_count_sapmnt = 1 // max of 1 disk_volume_type_sapmnt = "pd-standard" disk_volume_capacity_sapmnt = 56 filesystem_sapmnt = "xfs" @@ -36,7 +49,7 @@ variable "map_host_specifications" { #disk_swapfile_size_gb = 2 // not required if disk volume set disk_volume_count_swap = 1 // max of 1 disk_volume_type_swap = "pd-standard" - disk_volume_capacity_swap = 96 + disk_volume_capacity_swap = 64 filesystem_swap = "xfs" disk_volume_type_software = "pd-standard" diff --git a/sap_nwas_abap_hana_install/aws_ec2_instance/variable_map_hosts.tf b/sap_nwas_abap_hana_install/aws_ec2_instance/variable_map_hosts.tf index f047c5e..0807532 100644 --- a/sap_nwas_abap_hana_install/aws_ec2_instance/variable_map_hosts.tf +++ b/sap_nwas_abap_hana_install/aws_ec2_instance/variable_map_hosts.tf @@ -65,7 +65,7 @@ variable "map_host_specifications" { #disk_swapfile_size_gb = 2 // not required if disk volume set disk_volume_count_swap = 1 // max of 1 disk_volume_type_swap = "gp3" - disk_volume_capacity_swap = 64 + disk_volume_capacity_swap = 32 filesystem_swap = "xfs" } diff --git a/sap_nwas_abap_hana_install/gcp_ce_vm/variable_map_hosts.tf b/sap_nwas_abap_hana_install/gcp_ce_vm/variable_map_hosts.tf index e5c3290..2bf6c07 100644 --- a/sap_nwas_abap_hana_install/gcp_ce_vm/variable_map_hosts.tf +++ b/sap_nwas_abap_hana_install/gcp_ce_vm/variable_map_hosts.tf @@ -63,11 +63,11 @@ variable "map_host_specifications" { filesystem_sapmnt = "xfs" nfs_boolean_sapmnt = false - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 - #disk_volume_type_swap = "pd-standard" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "pd-standard" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" disk_volume_type_software = "pd-standard" disk_volume_capacity_software = 100 diff --git a/sap_nwas_abap_hana_install/ibmcloud_powervs/variable_map_hosts.tf b/sap_nwas_abap_hana_install/ibmcloud_powervs/variable_map_hosts.tf index d00121b..82c24c9 100644 --- a/sap_nwas_abap_hana_install/ibmcloud_powervs/variable_map_hosts.tf +++ b/sap_nwas_abap_hana_install/ibmcloud_powervs/variable_map_hosts.tf @@ -64,11 +64,11 @@ variable "map_host_specifications" { disk_volume_capacity_sapmnt = 50 filesystem_sapmnt = "xfs" - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 - #disk_volume_type_swap = "5iops-tier" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "tier1" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" } } diff --git a/sap_nwas_abap_hana_install/ibmpowervc/variable_map_hosts.tf b/sap_nwas_abap_hana_install/ibmpowervc/variable_map_hosts.tf index 52db6b1..ca72754 100644 --- a/sap_nwas_abap_hana_install/ibmpowervc/variable_map_hosts.tf +++ b/sap_nwas_abap_hana_install/ibmpowervc/variable_map_hosts.tf @@ -57,11 +57,11 @@ variable "map_host_specifications" { disk_volume_capacity_sapmnt = 50 filesystem_sapmnt = "xfs" - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 disk_volume_type_swap = "" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" } } diff --git a/sap_nwas_abap_hana_install/msazure_vm/variable_map_hosts.tf b/sap_nwas_abap_hana_install/msazure_vm/variable_map_hosts.tf index 79c3b25..6531ff9 100644 --- a/sap_nwas_abap_hana_install/msazure_vm/variable_map_hosts.tf +++ b/sap_nwas_abap_hana_install/msazure_vm/variable_map_hosts.tf @@ -54,7 +54,7 @@ variable "map_host_specifications" { disk_volume_count_usr_sap = 1 // max of 1 disk_volume_type_usr_sap = "E20" - disk_volume_capacity_usr_sap = 512 + disk_volume_capacity_usr_sap = 512 // bad sizing, but use this so each drive size is unique filesystem_usr_sap = "xfs" disk_volume_count_sapmnt = 1 // max of 1 diff --git a/sap_nwas_abap_ibmdb2_install/gcp_ce_vm/variable_map_hosts.tf b/sap_nwas_abap_ibmdb2_install/gcp_ce_vm/variable_map_hosts.tf index 7ca2594..776584f 100644 --- a/sap_nwas_abap_ibmdb2_install/gcp_ce_vm/variable_map_hosts.tf +++ b/sap_nwas_abap_ibmdb2_install/gcp_ce_vm/variable_map_hosts.tf @@ -20,14 +20,25 @@ variable "map_host_specifications" { disk_volume_count_hana_shared = 0 - disk_volume_count_anydb = 0 + disk_volume_count_anydb = 2 + disk_volume_type_anydb = "pd-standard" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_anydb = 320 + #disk_volume_iops_anydb = + lvm_enable_anydb = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_anydb = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_anydb = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_mount_path_anydb = "/db2" + filesystem_anydb = "xfs" + physical_partition_filesystem_block_size_anydb = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) disk_volume_count_usr_sap = 1 // max of 1 disk_volume_type_usr_sap = "pd-standard" - disk_volume_capacity_usr_sap = 64 + disk_volume_capacity_usr_sap = 256 filesystem_usr_sap = "xfs" - disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_count_sapmnt = 1 // max of 1 disk_volume_type_sapmnt = "pd-standard" disk_volume_capacity_sapmnt = 56 filesystem_sapmnt = "xfs" @@ -36,7 +47,7 @@ variable "map_host_specifications" { #disk_swapfile_size_gb = 2 // not required if disk volume set disk_volume_count_swap = 1 // max of 1 disk_volume_type_swap = "pd-standard" - disk_volume_capacity_swap = 96 + disk_volume_capacity_swap = 64 filesystem_swap = "xfs" disk_volume_type_software = "pd-standard" diff --git a/sap_nwas_abap_oracledb_install/gcp_ce_vm/variable_map_hosts.tf b/sap_nwas_abap_oracledb_install/gcp_ce_vm/variable_map_hosts.tf index 4c77f58..96a0f86 100644 --- a/sap_nwas_abap_oracledb_install/gcp_ce_vm/variable_map_hosts.tf +++ b/sap_nwas_abap_oracledb_install/gcp_ce_vm/variable_map_hosts.tf @@ -22,12 +22,25 @@ variable "map_host_specifications" { disk_volume_count_anydb = 0 + disk_volume_count_anydb = 2 + disk_volume_type_anydb = "pd-standard" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_anydb = 320 + #disk_volume_iops_anydb = + lvm_enable_anydb = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_anydb = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_anydb = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_mount_path_anydb = "/oracle" + filesystem_anydb = "xfs" + physical_partition_filesystem_block_size_anydb = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + disk_volume_count_usr_sap = 1 // max of 1 disk_volume_type_usr_sap = "pd-standard" - disk_volume_capacity_usr_sap = 64 + disk_volume_capacity_usr_sap = 256 filesystem_usr_sap = "xfs" - disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_count_sapmnt = 1 // max of 1 disk_volume_type_sapmnt = "pd-standard" disk_volume_capacity_sapmnt = 56 filesystem_sapmnt = "xfs" @@ -36,7 +49,7 @@ variable "map_host_specifications" { #disk_swapfile_size_gb = 2 // not required if disk volume set disk_volume_count_swap = 1 // max of 1 disk_volume_type_swap = "pd-standard" - disk_volume_capacity_swap = 96 + disk_volume_capacity_swap = 64 filesystem_swap = "xfs" disk_volume_type_software = "pd-standard" diff --git a/sap_nwas_abap_sapase_install/gcp_ce_vm/variable_map_hosts.tf b/sap_nwas_abap_sapase_install/gcp_ce_vm/variable_map_hosts.tf index 141548d..2cb1ed1 100644 --- a/sap_nwas_abap_sapase_install/gcp_ce_vm/variable_map_hosts.tf +++ b/sap_nwas_abap_sapase_install/gcp_ce_vm/variable_map_hosts.tf @@ -22,12 +22,25 @@ variable "map_host_specifications" { disk_volume_count_anydb = 0 + disk_volume_count_anydb = 2 + disk_volume_type_anydb = "pd-standard" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_anydb = 320 + #disk_volume_iops_anydb = + lvm_enable_anydb = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_anydb = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_anydb = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_mount_path_anydb = "/sybase" + filesystem_anydb = "xfs" + physical_partition_filesystem_block_size_anydb = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + disk_volume_count_usr_sap = 1 // max of 1 disk_volume_type_usr_sap = "pd-standard" - disk_volume_capacity_usr_sap = 64 + disk_volume_capacity_usr_sap = 256 filesystem_usr_sap = "xfs" - disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_count_sapmnt = 1 // max of 1 disk_volume_type_sapmnt = "pd-standard" disk_volume_capacity_sapmnt = 56 filesystem_sapmnt = "xfs" @@ -36,7 +49,7 @@ variable "map_host_specifications" { #disk_swapfile_size_gb = 2 // not required if disk volume set disk_volume_count_swap = 1 // max of 1 disk_volume_type_swap = "pd-standard" - disk_volume_capacity_swap = 96 + disk_volume_capacity_swap = 64 filesystem_swap = "xfs" disk_volume_type_software = "pd-standard" diff --git a/sap_nwas_abap_sapmaxdb_install/gcp_ce_vm/variable_map_hosts.tf b/sap_nwas_abap_sapmaxdb_install/gcp_ce_vm/variable_map_hosts.tf index c70eda0..e458329 100644 --- a/sap_nwas_abap_sapmaxdb_install/gcp_ce_vm/variable_map_hosts.tf +++ b/sap_nwas_abap_sapmaxdb_install/gcp_ce_vm/variable_map_hosts.tf @@ -22,12 +22,25 @@ variable "map_host_specifications" { disk_volume_count_anydb = 0 + disk_volume_count_anydb = 2 + disk_volume_type_anydb = "pd-standard" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_anydb = 320 + #disk_volume_iops_anydb = + lvm_enable_anydb = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_anydb = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_anydb = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_mount_path_anydb = "/sapdb" + filesystem_anydb = "xfs" + physical_partition_filesystem_block_size_anydb = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + disk_volume_count_usr_sap = 1 // max of 1 disk_volume_type_usr_sap = "pd-standard" - disk_volume_capacity_usr_sap = 64 + disk_volume_capacity_usr_sap = 256 filesystem_usr_sap = "xfs" - disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_count_sapmnt = 1 // max of 1 disk_volume_type_sapmnt = "pd-standard" disk_volume_capacity_sapmnt = 56 filesystem_sapmnt = "xfs" @@ -36,7 +49,7 @@ variable "map_host_specifications" { #disk_swapfile_size_gb = 2 // not required if disk volume set disk_volume_count_swap = 1 // max of 1 disk_volume_type_swap = "pd-standard" - disk_volume_capacity_swap = 96 + disk_volume_capacity_swap = 64 filesystem_swap = "xfs" disk_volume_type_software = "pd-standard" diff --git a/sap_nwas_java_ibmdb2_install/gcp_ce_vm/variable_map_hosts.tf b/sap_nwas_java_ibmdb2_install/gcp_ce_vm/variable_map_hosts.tf index d9dd391..d857c8e 100644 --- a/sap_nwas_java_ibmdb2_install/gcp_ce_vm/variable_map_hosts.tf +++ b/sap_nwas_java_ibmdb2_install/gcp_ce_vm/variable_map_hosts.tf @@ -22,12 +22,25 @@ variable "map_host_specifications" { disk_volume_count_anydb = 0 + disk_volume_count_anydb = 2 + disk_volume_type_anydb = "pd-standard" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_anydb = 320 + #disk_volume_iops_anydb = + lvm_enable_anydb = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_anydb = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_anydb = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_mount_path_anydb = "/db2" + filesystem_anydb = "xfs" + physical_partition_filesystem_block_size_anydb = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + disk_volume_count_usr_sap = 1 // max of 1 disk_volume_type_usr_sap = "pd-standard" - disk_volume_capacity_usr_sap = 64 + disk_volume_capacity_usr_sap = 256 filesystem_usr_sap = "xfs" - disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_count_sapmnt = 1 // max of 1 disk_volume_type_sapmnt = "pd-standard" disk_volume_capacity_sapmnt = 56 filesystem_sapmnt = "xfs" @@ -36,7 +49,7 @@ variable "map_host_specifications" { #disk_swapfile_size_gb = 2 // not required if disk volume set disk_volume_count_swap = 1 // max of 1 disk_volume_type_swap = "pd-standard" - disk_volume_capacity_swap = 96 + disk_volume_capacity_swap = 64 filesystem_swap = "xfs" disk_volume_type_software = "pd-standard" diff --git a/sap_nwas_java_sapase_install/gcp_ce_vm/variable_map_hosts.tf b/sap_nwas_java_sapase_install/gcp_ce_vm/variable_map_hosts.tf index f878d1e..092a1b3 100644 --- a/sap_nwas_java_sapase_install/gcp_ce_vm/variable_map_hosts.tf +++ b/sap_nwas_java_sapase_install/gcp_ce_vm/variable_map_hosts.tf @@ -22,12 +22,25 @@ variable "map_host_specifications" { disk_volume_count_anydb = 0 + disk_volume_count_anydb = 2 + disk_volume_type_anydb = "pd-standard" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_anydb = 320 + #disk_volume_iops_anydb = + lvm_enable_anydb = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_anydb = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_anydb = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_mount_path_anydb = "/sybase" + filesystem_anydb = "xfs" + physical_partition_filesystem_block_size_anydb = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + disk_volume_count_usr_sap = 1 // max of 1 disk_volume_type_usr_sap = "pd-standard" - disk_volume_capacity_usr_sap = 64 + disk_volume_capacity_usr_sap = 256 filesystem_usr_sap = "xfs" - disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_count_sapmnt = 1 // max of 1 disk_volume_type_sapmnt = "pd-standard" disk_volume_capacity_sapmnt = 56 filesystem_sapmnt = "xfs" @@ -36,7 +49,7 @@ variable "map_host_specifications" { #disk_swapfile_size_gb = 2 // not required if disk volume set disk_volume_count_swap = 1 // max of 1 disk_volume_type_swap = "pd-standard" - disk_volume_capacity_swap = 96 + disk_volume_capacity_swap = 64 filesystem_swap = "xfs" disk_volume_type_software = "pd-standard" diff --git a/sap_s4hana_single_node_install/aws_ec2_instance/variable_map_hosts.tf b/sap_s4hana_single_node_install/aws_ec2_instance/variable_map_hosts.tf index 7dcc7ae..1c83568 100644 --- a/sap_s4hana_single_node_install/aws_ec2_instance/variable_map_hosts.tf +++ b/sap_s4hana_single_node_install/aws_ec2_instance/variable_map_hosts.tf @@ -62,11 +62,11 @@ variable "map_host_specifications" { disk_volume_capacity_sapmnt = 50 filesystem_sapmnt = "xfs" - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 - #disk_volume_type_swap = "gp3" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "gp3" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" } } diff --git a/sap_s4hana_single_node_install/gcp_ce_vm/variable_map_hosts.tf b/sap_s4hana_single_node_install/gcp_ce_vm/variable_map_hosts.tf index 77bafd8..883ea34 100644 --- a/sap_s4hana_single_node_install/gcp_ce_vm/variable_map_hosts.tf +++ b/sap_s4hana_single_node_install/gcp_ce_vm/variable_map_hosts.tf @@ -63,11 +63,11 @@ variable "map_host_specifications" { filesystem_sapmnt = "xfs" nfs_boolean_sapmnt = false - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 - #disk_volume_type_swap = "pd-standard" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "pd-standard" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" disk_volume_type_software = "pd-standard" disk_volume_capacity_software = 100 diff --git a/sap_s4hana_single_node_install/ibmcloud_powervs/variable_map_hosts.tf b/sap_s4hana_single_node_install/ibmcloud_powervs/variable_map_hosts.tf index 97cfed7..f3ed07a 100644 --- a/sap_s4hana_single_node_install/ibmcloud_powervs/variable_map_hosts.tf +++ b/sap_s4hana_single_node_install/ibmcloud_powervs/variable_map_hosts.tf @@ -64,11 +64,11 @@ variable "map_host_specifications" { disk_volume_capacity_sapmnt = 50 filesystem_sapmnt = "xfs" - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 - #disk_volume_type_swap = "5iops-tier" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "tier1" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" } } diff --git a/sap_s4hana_single_node_install/ibmpowervc/variable_map_hosts.tf b/sap_s4hana_single_node_install/ibmpowervc/variable_map_hosts.tf index fc6cefb..7d58c1c 100644 --- a/sap_s4hana_single_node_install/ibmpowervc/variable_map_hosts.tf +++ b/sap_s4hana_single_node_install/ibmpowervc/variable_map_hosts.tf @@ -57,11 +57,11 @@ variable "map_host_specifications" { disk_volume_capacity_sapmnt = 50 filesystem_sapmnt = "xfs" - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 disk_volume_type_swap = "" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" } } diff --git a/sap_s4hana_single_node_install/msazure_vm/variable_map_hosts.tf b/sap_s4hana_single_node_install/msazure_vm/variable_map_hosts.tf index 76f341b..17f1eff 100644 --- a/sap_s4hana_single_node_install/msazure_vm/variable_map_hosts.tf +++ b/sap_s4hana_single_node_install/msazure_vm/variable_map_hosts.tf @@ -52,21 +52,21 @@ variable "map_host_specifications" { disk_volume_count_anydb = 0 - disk_volume_count_usr_sap = 0 // max of 1 - disk_volume_type_usr_sap = "P15" - disk_volume_capacity_usr_sap = 72 + disk_volume_count_usr_sap = 1 // max of 1 + disk_volume_type_usr_sap = "E20" + disk_volume_capacity_usr_sap = 512 // bad sizing, but use this so each drive size is unique filesystem_usr_sap = "xfs" - disk_volume_count_sapmnt = 0 // max of 1 - disk_volume_type_sapmnt = "P15" - disk_volume_capacity_sapmnt = 50 + disk_volume_count_sapmnt = 1 // max of 1 + disk_volume_type_sapmnt = "E4" + disk_volume_capacity_sapmnt = 32 // bad sizing, but use this so each drive size is unique filesystem_sapmnt = "xfs" - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 - #disk_volume_type_swap = "5iops-tier" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "E3" + disk_volume_capacity_swap = 16 // bad sizing, but use this so each drive size is unique + filesystem_swap = "xfs" } } diff --git a/sap_s4hana_single_node_install_maintenance_plan/aws_ec2_instance/variable_map_hosts.tf b/sap_s4hana_single_node_install_maintenance_plan/aws_ec2_instance/variable_map_hosts.tf index 7dcc7ae..1c83568 100644 --- a/sap_s4hana_single_node_install_maintenance_plan/aws_ec2_instance/variable_map_hosts.tf +++ b/sap_s4hana_single_node_install_maintenance_plan/aws_ec2_instance/variable_map_hosts.tf @@ -62,11 +62,11 @@ variable "map_host_specifications" { disk_volume_capacity_sapmnt = 50 filesystem_sapmnt = "xfs" - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 - #disk_volume_type_swap = "gp3" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "gp3" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" } } diff --git a/sap_s4hana_single_node_install_maintenance_plan/gcp_ce_vm/variable_map_hosts.tf b/sap_s4hana_single_node_install_maintenance_plan/gcp_ce_vm/variable_map_hosts.tf index 77bafd8..883ea34 100644 --- a/sap_s4hana_single_node_install_maintenance_plan/gcp_ce_vm/variable_map_hosts.tf +++ b/sap_s4hana_single_node_install_maintenance_plan/gcp_ce_vm/variable_map_hosts.tf @@ -63,11 +63,11 @@ variable "map_host_specifications" { filesystem_sapmnt = "xfs" nfs_boolean_sapmnt = false - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 - #disk_volume_type_swap = "pd-standard" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "pd-standard" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" disk_volume_type_software = "pd-standard" disk_volume_capacity_software = 100 diff --git a/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_powervs/variable_map_hosts.tf b/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_powervs/variable_map_hosts.tf index 97cfed7..f3ed07a 100644 --- a/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_powervs/variable_map_hosts.tf +++ b/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_powervs/variable_map_hosts.tf @@ -64,11 +64,11 @@ variable "map_host_specifications" { disk_volume_capacity_sapmnt = 50 filesystem_sapmnt = "xfs" - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 - #disk_volume_type_swap = "5iops-tier" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "tier1" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" } } diff --git a/sap_s4hana_single_node_install_maintenance_plan/ibmpowervc/variable_map_hosts.tf b/sap_s4hana_single_node_install_maintenance_plan/ibmpowervc/variable_map_hosts.tf index fc6cefb..7d58c1c 100644 --- a/sap_s4hana_single_node_install_maintenance_plan/ibmpowervc/variable_map_hosts.tf +++ b/sap_s4hana_single_node_install_maintenance_plan/ibmpowervc/variable_map_hosts.tf @@ -57,11 +57,11 @@ variable "map_host_specifications" { disk_volume_capacity_sapmnt = 50 filesystem_sapmnt = "xfs" - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 disk_volume_type_swap = "" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" } } diff --git a/sap_s4hana_single_node_install_maintenance_plan/msazure_vm/variable_map_hosts.tf b/sap_s4hana_single_node_install_maintenance_plan/msazure_vm/variable_map_hosts.tf index 2d0f5ab..17f1eff 100644 --- a/sap_s4hana_single_node_install_maintenance_plan/msazure_vm/variable_map_hosts.tf +++ b/sap_s4hana_single_node_install_maintenance_plan/msazure_vm/variable_map_hosts.tf @@ -52,21 +52,21 @@ variable "map_host_specifications" { disk_volume_count_anydb = 0 - disk_volume_count_usr_sap = 0 // max of 1 + disk_volume_count_usr_sap = 1 // max of 1 disk_volume_type_usr_sap = "E20" - disk_volume_capacity_usr_sap = 512 + disk_volume_capacity_usr_sap = 512 // bad sizing, but use this so each drive size is unique filesystem_usr_sap = "xfs" - disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_count_sapmnt = 1 // max of 1 disk_volume_type_sapmnt = "E4" disk_volume_capacity_sapmnt = 32 // bad sizing, but use this so each drive size is unique filesystem_sapmnt = "xfs" - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 - #disk_volume_type_swap = "E3" - #disk_volume_capacity_swap = 16 // bad sizing, but use this so each drive size is unique - #filesystem_swap = "xfs" + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "E3" + disk_volume_capacity_swap = 16 // bad sizing, but use this so each drive size is unique + filesystem_swap = "xfs" } } diff --git a/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variable_map_hosts.tf b/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variable_map_hosts.tf index 367c339..0fbf7d9 100644 --- a/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variable_map_hosts.tf +++ b/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_powervs/variable_map_hosts.tf @@ -64,11 +64,11 @@ variable "map_host_specifications" { disk_volume_capacity_sapmnt = 50 filesystem_sapmnt = "xfs" - disk_swapfile_size_gb = 2 // not required if disk volume set - disk_volume_count_swap = 0 // max of 1 - #disk_volume_type_swap = "5iops-tier" - #disk_volume_capacity_swap = 10 - #filesystem_swap = "xfs" + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "tier1" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" } } From 6824d9512a62b5135ca91250f37b45dc747c51ba Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Sun, 14 May 2023 18:31:54 +0100 Subject: [PATCH 07/12] fix: trigger all validate for nfs --- sap_bw4hana_single_node_install/ibmcloud_vs/main.tf | 2 ++ sap_ecc_hana_single_node_install/ibmcloud_vs/main.tf | 2 ++ .../ibmcloud_vs/main.tf | 2 ++ sap_ecc_ibmdb2_single_node_install/ibmcloud_vs/main.tf | 2 ++ sap_ecc_oracledb_single_node_install/ibmcloud_vs/main.tf | 2 ++ sap_ecc_sapase_single_node_install/aws_ec2_instance/main.tf | 4 ++-- sap_ecc_sapase_single_node_install/ibmcloud_vs/main.tf | 2 ++ sap_ecc_sapmaxdb_single_node_install/ibmcloud_vs/main.tf | 2 ++ sap_hana_single_node_install/ibmcloud_vs/main.tf | 2 ++ sap_nwas_abap_hana_install/ibmcloud_vs/main.tf | 2 ++ sap_nwas_abap_ibmdb2_install/ibmcloud_vs/main.tf | 2 ++ sap_nwas_abap_oracledb_install/ibmcloud_vs/main.tf | 2 ++ sap_nwas_abap_sapase_install/ibmcloud_vs/main.tf | 2 ++ sap_nwas_abap_sapmaxdb_install/ibmcloud_vs/main.tf | 2 ++ sap_nwas_java_ibmdb2_install/ibmcloud_vs/main.tf | 2 ++ sap_nwas_java_sapase_install/ibmcloud_vs/main.tf | 2 ++ sap_s4hana_single_node_install/ibmcloud_vs/main.tf | 2 ++ .../ibmcloud_vs/main.tf | 4 +++- .../ibmcloud_vs/main.tf | 2 ++ 19 files changed, 39 insertions(+), 3 deletions(-) diff --git a/sap_bw4hana_single_node_install/ibmcloud_vs/main.tf b/sap_bw4hana_single_node_install/ibmcloud_vs/main.tf index 191e72a..e28d3a3 100644 --- a/sap_bw4hana_single_node_install/ibmcloud_vs/main.tf +++ b/sap_bw4hana_single_node_install/ibmcloud_vs/main.tf @@ -251,6 +251,8 @@ module "run_host_provision_module" { module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap diff --git a/sap_ecc_hana_single_node_install/ibmcloud_vs/main.tf b/sap_ecc_hana_single_node_install/ibmcloud_vs/main.tf index 3b23204..bf82225 100644 --- a/sap_ecc_hana_single_node_install/ibmcloud_vs/main.tf +++ b/sap_ecc_hana_single_node_install/ibmcloud_vs/main.tf @@ -251,6 +251,8 @@ module "run_host_provision_module" { module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap diff --git a/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/main.tf b/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/main.tf index 57a608f..43f1870 100644 --- a/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/main.tf +++ b/sap_ecc_hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/main.tf @@ -254,6 +254,8 @@ module "run_host_provision_module" { module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap diff --git a/sap_ecc_ibmdb2_single_node_install/ibmcloud_vs/main.tf b/sap_ecc_ibmdb2_single_node_install/ibmcloud_vs/main.tf index 13016e0..a7fe55d 100644 --- a/sap_ecc_ibmdb2_single_node_install/ibmcloud_vs/main.tf +++ b/sap_ecc_ibmdb2_single_node_install/ibmcloud_vs/main.tf @@ -251,6 +251,8 @@ module "run_host_provision_module" { module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap diff --git a/sap_ecc_oracledb_single_node_install/ibmcloud_vs/main.tf b/sap_ecc_oracledb_single_node_install/ibmcloud_vs/main.tf index c51f7ee..199feea 100644 --- a/sap_ecc_oracledb_single_node_install/ibmcloud_vs/main.tf +++ b/sap_ecc_oracledb_single_node_install/ibmcloud_vs/main.tf @@ -251,6 +251,8 @@ module "run_host_provision_module" { module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap diff --git a/sap_ecc_sapase_single_node_install/aws_ec2_instance/main.tf b/sap_ecc_sapase_single_node_install/aws_ec2_instance/main.tf index 1896449..7c341af 100644 --- a/sap_ecc_sapase_single_node_install/aws_ec2_instance/main.tf +++ b/sap_ecc_sapase_single_node_install/aws_ec2_instance/main.tf @@ -233,14 +233,14 @@ module "run_host_provision_module" { module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap module_var_disk_volume_type_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_swap : 0 module_var_disk_volume_capacity_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_swap : 0 module_var_filesystem_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].filesystem_swap : 0 - module_var_nfs_boolean_sapmnt = false // always false, single node installation - module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_volume_type_software = var.disk_volume_type_software module_var_disk_volume_capacity_software = var.disk_volume_capacity_software diff --git a/sap_ecc_sapase_single_node_install/ibmcloud_vs/main.tf b/sap_ecc_sapase_single_node_install/ibmcloud_vs/main.tf index a6f16bc..035edd9 100644 --- a/sap_ecc_sapase_single_node_install/ibmcloud_vs/main.tf +++ b/sap_ecc_sapase_single_node_install/ibmcloud_vs/main.tf @@ -251,6 +251,8 @@ module "run_host_provision_module" { module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap diff --git a/sap_ecc_sapmaxdb_single_node_install/ibmcloud_vs/main.tf b/sap_ecc_sapmaxdb_single_node_install/ibmcloud_vs/main.tf index 558b79b..a899bc6 100644 --- a/sap_ecc_sapmaxdb_single_node_install/ibmcloud_vs/main.tf +++ b/sap_ecc_sapmaxdb_single_node_install/ibmcloud_vs/main.tf @@ -251,6 +251,8 @@ module "run_host_provision_module" { module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap diff --git a/sap_hana_single_node_install/ibmcloud_vs/main.tf b/sap_hana_single_node_install/ibmcloud_vs/main.tf index 05b370f..cce025d 100644 --- a/sap_hana_single_node_install/ibmcloud_vs/main.tf +++ b/sap_hana_single_node_install/ibmcloud_vs/main.tf @@ -246,6 +246,8 @@ module "run_host_provision_module" { module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap diff --git a/sap_nwas_abap_hana_install/ibmcloud_vs/main.tf b/sap_nwas_abap_hana_install/ibmcloud_vs/main.tf index e25a352..156472e 100644 --- a/sap_nwas_abap_hana_install/ibmcloud_vs/main.tf +++ b/sap_nwas_abap_hana_install/ibmcloud_vs/main.tf @@ -251,6 +251,8 @@ module "run_host_provision_module" { module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap diff --git a/sap_nwas_abap_ibmdb2_install/ibmcloud_vs/main.tf b/sap_nwas_abap_ibmdb2_install/ibmcloud_vs/main.tf index 6ae7629..971b257 100644 --- a/sap_nwas_abap_ibmdb2_install/ibmcloud_vs/main.tf +++ b/sap_nwas_abap_ibmdb2_install/ibmcloud_vs/main.tf @@ -251,6 +251,8 @@ module "run_host_provision_module" { module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap diff --git a/sap_nwas_abap_oracledb_install/ibmcloud_vs/main.tf b/sap_nwas_abap_oracledb_install/ibmcloud_vs/main.tf index f85a6e9..a7cd999 100644 --- a/sap_nwas_abap_oracledb_install/ibmcloud_vs/main.tf +++ b/sap_nwas_abap_oracledb_install/ibmcloud_vs/main.tf @@ -251,6 +251,8 @@ module "run_host_provision_module" { module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap diff --git a/sap_nwas_abap_sapase_install/ibmcloud_vs/main.tf b/sap_nwas_abap_sapase_install/ibmcloud_vs/main.tf index 2779022..ea9a625 100644 --- a/sap_nwas_abap_sapase_install/ibmcloud_vs/main.tf +++ b/sap_nwas_abap_sapase_install/ibmcloud_vs/main.tf @@ -251,6 +251,8 @@ module "run_host_provision_module" { module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap diff --git a/sap_nwas_abap_sapmaxdb_install/ibmcloud_vs/main.tf b/sap_nwas_abap_sapmaxdb_install/ibmcloud_vs/main.tf index b920fd2..e87b07e 100644 --- a/sap_nwas_abap_sapmaxdb_install/ibmcloud_vs/main.tf +++ b/sap_nwas_abap_sapmaxdb_install/ibmcloud_vs/main.tf @@ -251,6 +251,8 @@ module "run_host_provision_module" { module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap diff --git a/sap_nwas_java_ibmdb2_install/ibmcloud_vs/main.tf b/sap_nwas_java_ibmdb2_install/ibmcloud_vs/main.tf index 3d4dd28..eb86b67 100644 --- a/sap_nwas_java_ibmdb2_install/ibmcloud_vs/main.tf +++ b/sap_nwas_java_ibmdb2_install/ibmcloud_vs/main.tf @@ -253,6 +253,8 @@ module "run_host_provision_module" { module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap diff --git a/sap_nwas_java_sapase_install/ibmcloud_vs/main.tf b/sap_nwas_java_sapase_install/ibmcloud_vs/main.tf index c7a04c9..e2c920b 100644 --- a/sap_nwas_java_sapase_install/ibmcloud_vs/main.tf +++ b/sap_nwas_java_sapase_install/ibmcloud_vs/main.tf @@ -253,6 +253,8 @@ module "run_host_provision_module" { module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap diff --git a/sap_s4hana_single_node_install/ibmcloud_vs/main.tf b/sap_s4hana_single_node_install/ibmcloud_vs/main.tf index 71f608b..e3fd407 100644 --- a/sap_s4hana_single_node_install/ibmcloud_vs/main.tf +++ b/sap_s4hana_single_node_install/ibmcloud_vs/main.tf @@ -251,6 +251,8 @@ module "run_host_provision_module" { module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap diff --git a/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_vs/main.tf b/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_vs/main.tf index 6faca7b..cc844fa 100644 --- a/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_vs/main.tf +++ b/sap_s4hana_single_node_install_maintenance_plan/ibmcloud_vs/main.tf @@ -251,7 +251,9 @@ module "run_host_provision_module" { module_var_disk_volume_count_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_sapmnt module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt - module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap diff --git a/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/main.tf b/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/main.tf index 67608b0..63f241a 100644 --- a/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/main.tf +++ b/sap_s4hana_single_node_system_copy_homogeneous_hdb/ibmcloud_vs/main.tf @@ -254,6 +254,8 @@ module "run_host_provision_module" { module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap From d488ab48e1d766d452c0ca498a15061f662db929 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Sun, 14 May 2023 19:34:58 +0100 Subject: [PATCH 08/12] feat: new templates --- .../aws_ec2_instance/main.tf | 333 ++++++++++++++++ .../aws_ec2_instance/outputs.tf | 234 +++++++++++ .../aws_ec2_instance/outputs_debug.tf | 4 + .../aws_ec2_instance/variable_locals.tf | 19 + .../aws_ec2_instance/variable_map_hosts.tf | 184 +++++++++ .../aws_ec2_instance/variable_map_os.tf | 48 +++ .../aws_ec2_instance/variables.tf | 120 ++++++ .../variables_generic_for_cli.tfvars | 27 ++ .../aws_ec2_instance/versions.tf | 29 ++ .../gcp_ce_vm/main.tf | 317 +++++++++++++++ .../gcp_ce_vm/outputs.tf | 235 +++++++++++ .../gcp_ce_vm/variable_locals.tf | 19 + .../gcp_ce_vm/variable_map_hosts.tf | 195 +++++++++ .../gcp_ce_vm/variable_map_os.tf | 79 ++++ .../gcp_ce_vm/variables.tf | 120 ++++++ .../variables_generic_for_cli.tfvars | 28 ++ .../gcp_ce_vm/versions.tf | 34 ++ .../ibmcloud_vs/main.tf | 346 ++++++++++++++++ .../ibmcloud_vs/outputs.tf | 235 +++++++++++ .../ibmcloud_vs/variable_locals.tf | 28 ++ .../ibmcloud_vs/variable_map_hosts.tf | 184 +++++++++ .../ibmcloud_vs/variable_map_os.tf | 42 ++ .../ibmcloud_vs/variables.tf | 129 ++++++ .../variables_generic_for_cli.tfvars | 29 ++ .../ibmcloud_vs/versions.tf | 32 ++ .../msazure_vm/main.tf | 375 ++++++++++++++++++ .../msazure_vm/outputs.tf | 235 +++++++++++ .../msazure_vm/variable_locals.tf | 21 + .../msazure_vm/variable_map_hosts.tf | 184 +++++++++ .../msazure_vm/variable_map_os.tf | 59 +++ .../msazure_vm/variables.tf | 139 +++++++ .../variables_generic_for_cli.tfvars | 27 ++ .../msazure_vm/versions.tf | 40 ++ .../aws_ec2_instance/main.tf | 308 ++++++++++++++ .../aws_ec2_instance/outputs.tf | 211 ++++++++++ .../aws_ec2_instance/outputs_debug.tf | 4 + .../aws_ec2_instance/variable_locals.tf | 19 + .../aws_ec2_instance/variable_map_hosts.tf | 57 +++ .../aws_ec2_instance/variable_map_os.tf | 48 +++ .../aws_ec2_instance/variables.tf | 136 +++++++ .../variables_generic_for_cli.tfvars | 33 ++ .../aws_ec2_instance/versions.tf | 29 ++ .../gcp_ce_vm/main.tf | 293 ++++++++++++++ .../gcp_ce_vm/outputs.tf | 211 ++++++++++ .../gcp_ce_vm/variable_locals.tf | 19 + .../gcp_ce_vm/variable_map_hosts.tf | 64 +++ .../gcp_ce_vm/variable_map_os.tf | 79 ++++ .../gcp_ce_vm/variables.tf | 127 ++++++ .../variables_generic_for_cli.tfvars | 30 ++ .../gcp_ce_vm/versions.tf | 34 ++ .../ibmcloud_vs/main.tf | 331 ++++++++++++++++ .../ibmcloud_vs/outputs.tf | 211 ++++++++++ .../ibmcloud_vs/outputs_debug.tf | 92 +++++ .../ibmcloud_vs/variable_locals.tf | 28 ++ .../ibmcloud_vs/variable_map_hosts.tf | 61 +++ .../ibmcloud_vs/variable_map_os.tf | 42 ++ .../ibmcloud_vs/variables.tf | 136 +++++++ .../variables_generic_for_cli.tfvars | 31 ++ .../ibmcloud_vs/versions.tf | 32 ++ .../msazure_vm/main.tf | 343 ++++++++++++++++ .../msazure_vm/outputs.tf | 211 ++++++++++ .../msazure_vm/variable_locals.tf | 21 + .../msazure_vm/variable_map_hosts.tf | 57 +++ .../msazure_vm/variable_map_os.tf | 59 +++ .../msazure_vm/variables.tf | 152 +++++++ .../variables_generic_for_cli.tfvars | 31 ++ .../msazure_vm/versions.tf | 28 ++ .../aws_ec2_instance/main.tf | 304 ++++++++++++++ .../aws_ec2_instance/outputs.tf | 234 +++++++++++ .../aws_ec2_instance/outputs_debug.tf | 4 + .../aws_ec2_instance/variable_locals.tf | 19 + .../aws_ec2_instance/variable_map_hosts.tf | 75 ++++ .../aws_ec2_instance/variable_map_os.tf | 48 +++ .../aws_ec2_instance/variables.tf | 131 ++++++ .../variables_generic_for_cli.tfvars | 31 ++ .../aws_ec2_instance/versions.tf | 29 ++ .../gcp_ce_vm/main.tf | 288 ++++++++++++++ .../gcp_ce_vm/outputs.tf | 235 +++++++++++ .../gcp_ce_vm/variable_locals.tf | 19 + .../gcp_ce_vm/variable_map_hosts.tf | 81 ++++ .../gcp_ce_vm/variable_map_os.tf | 79 ++++ .../gcp_ce_vm/variables.tf | 122 ++++++ .../variables_generic_for_cli.tfvars | 28 ++ .../gcp_ce_vm/versions.tf | 34 ++ .../ibmcloud_vs/main.tf | 326 +++++++++++++++ .../ibmcloud_vs/outputs.tf | 211 ++++++++++ .../ibmcloud_vs/outputs_debug.tf | 92 +++++ .../ibmcloud_vs/variable_locals.tf | 28 ++ .../ibmcloud_vs/variable_map_hosts.tf | 78 ++++ .../ibmcloud_vs/variable_map_os.tf | 42 ++ .../ibmcloud_vs/variables.tf | 146 +++++++ .../variables_generic_for_cli.tfvars | 36 ++ .../ibmcloud_vs/versions.tf | 32 ++ .../msazure_vm/main.tf | 339 ++++++++++++++++ .../msazure_vm/outputs.tf | 235 +++++++++++ .../msazure_vm/variable_locals.tf | 21 + .../msazure_vm/variable_map_hosts.tf | 76 ++++ .../msazure_vm/variable_map_os.tf | 59 +++ .../msazure_vm/variables.tf | 146 +++++++ .../variables_generic_for_cli.tfvars | 29 ++ .../msazure_vm/versions.tf | 28 ++ 101 files changed, 11383 insertions(+) create mode 100644 sap_s4hana_distributed_install/aws_ec2_instance/main.tf create mode 100644 sap_s4hana_distributed_install/aws_ec2_instance/outputs.tf create mode 100644 sap_s4hana_distributed_install/aws_ec2_instance/outputs_debug.tf create mode 100644 sap_s4hana_distributed_install/aws_ec2_instance/variable_locals.tf create mode 100644 sap_s4hana_distributed_install/aws_ec2_instance/variable_map_hosts.tf create mode 100644 sap_s4hana_distributed_install/aws_ec2_instance/variable_map_os.tf create mode 100644 sap_s4hana_distributed_install/aws_ec2_instance/variables.tf create mode 100644 sap_s4hana_distributed_install/aws_ec2_instance/variables_generic_for_cli.tfvars create mode 100644 sap_s4hana_distributed_install/aws_ec2_instance/versions.tf create mode 100644 sap_s4hana_distributed_install/gcp_ce_vm/main.tf create mode 100644 sap_s4hana_distributed_install/gcp_ce_vm/outputs.tf create mode 100644 sap_s4hana_distributed_install/gcp_ce_vm/variable_locals.tf create mode 100644 sap_s4hana_distributed_install/gcp_ce_vm/variable_map_hosts.tf create mode 100644 sap_s4hana_distributed_install/gcp_ce_vm/variable_map_os.tf create mode 100644 sap_s4hana_distributed_install/gcp_ce_vm/variables.tf create mode 100644 sap_s4hana_distributed_install/gcp_ce_vm/variables_generic_for_cli.tfvars create mode 100644 sap_s4hana_distributed_install/gcp_ce_vm/versions.tf create mode 100644 sap_s4hana_distributed_install/ibmcloud_vs/main.tf create mode 100644 sap_s4hana_distributed_install/ibmcloud_vs/outputs.tf create mode 100644 sap_s4hana_distributed_install/ibmcloud_vs/variable_locals.tf create mode 100644 sap_s4hana_distributed_install/ibmcloud_vs/variable_map_hosts.tf create mode 100644 sap_s4hana_distributed_install/ibmcloud_vs/variable_map_os.tf create mode 100644 sap_s4hana_distributed_install/ibmcloud_vs/variables.tf create mode 100644 sap_s4hana_distributed_install/ibmcloud_vs/variables_generic_for_cli.tfvars create mode 100644 sap_s4hana_distributed_install/ibmcloud_vs/versions.tf create mode 100644 sap_s4hana_distributed_install/msazure_vm/main.tf create mode 100644 sap_s4hana_distributed_install/msazure_vm/outputs.tf create mode 100644 sap_s4hana_distributed_install/msazure_vm/variable_locals.tf create mode 100644 sap_s4hana_distributed_install/msazure_vm/variable_map_hosts.tf create mode 100644 sap_s4hana_distributed_install/msazure_vm/variable_map_os.tf create mode 100644 sap_s4hana_distributed_install/msazure_vm/variables.tf create mode 100644 sap_s4hana_distributed_install/msazure_vm/variables_generic_for_cli.tfvars create mode 100644 sap_s4hana_distributed_install/msazure_vm/versions.tf create mode 100644 sap_solman_sapase_single_node_install/aws_ec2_instance/main.tf create mode 100644 sap_solman_sapase_single_node_install/aws_ec2_instance/outputs.tf create mode 100644 sap_solman_sapase_single_node_install/aws_ec2_instance/outputs_debug.tf create mode 100644 sap_solman_sapase_single_node_install/aws_ec2_instance/variable_locals.tf create mode 100644 sap_solman_sapase_single_node_install/aws_ec2_instance/variable_map_hosts.tf create mode 100644 sap_solman_sapase_single_node_install/aws_ec2_instance/variable_map_os.tf create mode 100644 sap_solman_sapase_single_node_install/aws_ec2_instance/variables.tf create mode 100644 sap_solman_sapase_single_node_install/aws_ec2_instance/variables_generic_for_cli.tfvars create mode 100644 sap_solman_sapase_single_node_install/aws_ec2_instance/versions.tf create mode 100644 sap_solman_sapase_single_node_install/gcp_ce_vm/main.tf create mode 100644 sap_solman_sapase_single_node_install/gcp_ce_vm/outputs.tf create mode 100644 sap_solman_sapase_single_node_install/gcp_ce_vm/variable_locals.tf create mode 100644 sap_solman_sapase_single_node_install/gcp_ce_vm/variable_map_hosts.tf create mode 100644 sap_solman_sapase_single_node_install/gcp_ce_vm/variable_map_os.tf create mode 100644 sap_solman_sapase_single_node_install/gcp_ce_vm/variables.tf create mode 100644 sap_solman_sapase_single_node_install/gcp_ce_vm/variables_generic_for_cli.tfvars create mode 100644 sap_solman_sapase_single_node_install/gcp_ce_vm/versions.tf create mode 100644 sap_solman_sapase_single_node_install/ibmcloud_vs/main.tf create mode 100644 sap_solman_sapase_single_node_install/ibmcloud_vs/outputs.tf create mode 100644 sap_solman_sapase_single_node_install/ibmcloud_vs/outputs_debug.tf create mode 100644 sap_solman_sapase_single_node_install/ibmcloud_vs/variable_locals.tf create mode 100644 sap_solman_sapase_single_node_install/ibmcloud_vs/variable_map_hosts.tf create mode 100644 sap_solman_sapase_single_node_install/ibmcloud_vs/variable_map_os.tf create mode 100644 sap_solman_sapase_single_node_install/ibmcloud_vs/variables.tf create mode 100644 sap_solman_sapase_single_node_install/ibmcloud_vs/variables_generic_for_cli.tfvars create mode 100644 sap_solman_sapase_single_node_install/ibmcloud_vs/versions.tf create mode 100644 sap_solman_sapase_single_node_install/msazure_vm/main.tf create mode 100644 sap_solman_sapase_single_node_install/msazure_vm/outputs.tf create mode 100644 sap_solman_sapase_single_node_install/msazure_vm/variable_locals.tf create mode 100644 sap_solman_sapase_single_node_install/msazure_vm/variable_map_hosts.tf create mode 100644 sap_solman_sapase_single_node_install/msazure_vm/variable_map_os.tf create mode 100644 sap_solman_sapase_single_node_install/msazure_vm/variables.tf create mode 100644 sap_solman_sapase_single_node_install/msazure_vm/variables_generic_for_cli.tfvars create mode 100644 sap_solman_sapase_single_node_install/msazure_vm/versions.tf create mode 100644 sap_solman_saphana_single_node_install/aws_ec2_instance/main.tf create mode 100644 sap_solman_saphana_single_node_install/aws_ec2_instance/outputs.tf create mode 100644 sap_solman_saphana_single_node_install/aws_ec2_instance/outputs_debug.tf create mode 100644 sap_solman_saphana_single_node_install/aws_ec2_instance/variable_locals.tf create mode 100644 sap_solman_saphana_single_node_install/aws_ec2_instance/variable_map_hosts.tf create mode 100644 sap_solman_saphana_single_node_install/aws_ec2_instance/variable_map_os.tf create mode 100644 sap_solman_saphana_single_node_install/aws_ec2_instance/variables.tf create mode 100644 sap_solman_saphana_single_node_install/aws_ec2_instance/variables_generic_for_cli.tfvars create mode 100644 sap_solman_saphana_single_node_install/aws_ec2_instance/versions.tf create mode 100644 sap_solman_saphana_single_node_install/gcp_ce_vm/main.tf create mode 100644 sap_solman_saphana_single_node_install/gcp_ce_vm/outputs.tf create mode 100644 sap_solman_saphana_single_node_install/gcp_ce_vm/variable_locals.tf create mode 100644 sap_solman_saphana_single_node_install/gcp_ce_vm/variable_map_hosts.tf create mode 100644 sap_solman_saphana_single_node_install/gcp_ce_vm/variable_map_os.tf create mode 100644 sap_solman_saphana_single_node_install/gcp_ce_vm/variables.tf create mode 100644 sap_solman_saphana_single_node_install/gcp_ce_vm/variables_generic_for_cli.tfvars create mode 100644 sap_solman_saphana_single_node_install/gcp_ce_vm/versions.tf create mode 100644 sap_solman_saphana_single_node_install/ibmcloud_vs/main.tf create mode 100644 sap_solman_saphana_single_node_install/ibmcloud_vs/outputs.tf create mode 100644 sap_solman_saphana_single_node_install/ibmcloud_vs/outputs_debug.tf create mode 100644 sap_solman_saphana_single_node_install/ibmcloud_vs/variable_locals.tf create mode 100644 sap_solman_saphana_single_node_install/ibmcloud_vs/variable_map_hosts.tf create mode 100644 sap_solman_saphana_single_node_install/ibmcloud_vs/variable_map_os.tf create mode 100644 sap_solman_saphana_single_node_install/ibmcloud_vs/variables.tf create mode 100644 sap_solman_saphana_single_node_install/ibmcloud_vs/variables_generic_for_cli.tfvars create mode 100644 sap_solman_saphana_single_node_install/ibmcloud_vs/versions.tf create mode 100644 sap_solman_saphana_single_node_install/msazure_vm/main.tf create mode 100644 sap_solman_saphana_single_node_install/msazure_vm/outputs.tf create mode 100644 sap_solman_saphana_single_node_install/msazure_vm/variable_locals.tf create mode 100644 sap_solman_saphana_single_node_install/msazure_vm/variable_map_hosts.tf create mode 100644 sap_solman_saphana_single_node_install/msazure_vm/variable_map_os.tf create mode 100644 sap_solman_saphana_single_node_install/msazure_vm/variables.tf create mode 100644 sap_solman_saphana_single_node_install/msazure_vm/variables_generic_for_cli.tfvars create mode 100644 sap_solman_saphana_single_node_install/msazure_vm/versions.tf diff --git a/sap_s4hana_distributed_install/aws_ec2_instance/main.tf b/sap_s4hana_distributed_install/aws_ec2_instance/main.tf new file mode 100644 index 0000000..f5b06ec --- /dev/null +++ b/sap_s4hana_distributed_install/aws_ec2_instance/main.tf @@ -0,0 +1,333 @@ + +module "run_ansible_dry_run" { + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_s4hana_distributed_install_maintplan?ref=main" + + module_var_dry_run_test = "x86_64" // x86_64 or ppc64le + + # Terraform Module Variables which are mandatory, all with an empty string + module_var_bastion_boolean = false + module_var_bastion_user = "" + module_var_bastion_ssh_port = 0 + module_var_bastion_private_ssh_key = "" + module_var_bastion_floating_ip = "" + module_var_host_private_ssh_key = "" + module_var_host_private_ip = "" + module_var_hostname = "software_media_dry_run" + module_var_dns_root_domain_name = "" + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + module_var_sap_swpm_sid = "" + module_var_sap_swpm_db_schema_abap = "" + module_var_sap_swpm_db_schema_abap_password = "" + module_var_sap_swpm_ddic_000_password = "" + module_var_sap_swpm_template_selected = var.sap_swpm_template_selected + module_var_sap_maintenance_planner_transaction_name = var.sap_maintenance_planner_transaction_name + +} + + +module "run_account_init_module" { + + depends_on = [ + module.run_ansible_dry_run + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/account_init?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_aws_vpc_subnet_id = var.aws_vpc_subnet_id + + module_var_aws_vpc_subnet_create_boolean = local.aws_vpc_subnet_create_boolean + + module_var_aws_vpc_availability_zone = var.aws_vpc_availability_zone + +} + + +module "run_account_bootstrap_module" { + + depends_on = [ + module.run_account_init_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/account_bootstrap?ref=dev" + + module_var_resource_prefix = var.resource_prefix + + module_var_aws_vpc_subnet_id = local.aws_vpc_subnet_create_boolean ? module.run_account_init_module.output_aws_vpc_subnet_id : var.aws_vpc_subnet_id + + module_var_dns_root_domain_name = var.dns_root_domain + +} + + +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] + + +module "run_bastion_inject_module" { + + depends_on = [ + module.run_account_bootstrap_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/bastion_inject?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_aws_vpc_subnet_id = local.aws_vpc_subnet_create_boolean ? module.run_account_init_module.output_aws_vpc_subnet_id : var.aws_vpc_subnet_id + module_var_aws_vpc_igw_id = module.run_account_init_module.output_aws_vpc_igw_id + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_os_image = var.map_os_image_regex[var.bastion_os_image] + module_var_bastion_ssh_key_name = module.run_account_bootstrap_module.output_bastion_ssh_key_name + module_var_bastion_public_ssh_key = module.run_account_bootstrap_module.output_bastion_public_ssh_key + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_aws_vpc_availability_zone = var.aws_vpc_availability_zone + +} + + +module "run_host_network_access_sap_module" { + + depends_on = [ + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/host_network_access_sap?ref=dev" + + module_var_resource_prefix = var.resource_prefix + + module_var_aws_vpc_subnet_id = local.aws_vpc_subnet_create_boolean ? module.run_account_init_module.output_aws_vpc_subnet_id : var.aws_vpc_subnet_id + module_var_host_security_group_id = module.run_account_bootstrap_module.output_host_security_group_id + + module_var_sap_nwas_abap_ascs_instance_no = var.sap_nwas_abap_ascs_instance_no + module_var_sap_nwas_abap_pas_instance_no = var.sap_nwas_abap_pas_instance_no + module_var_sap_hana_instance_no = var.sap_hana_install_instance_number + +} + + +module "run_host_network_access_sap_public_via_proxy_module" { + + depends_on = [ + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/host_network_access_sap_public_via_proxy?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_aws_vpc_subnet_id = local.aws_vpc_subnet_create_boolean ? module.run_account_init_module.output_aws_vpc_subnet_id : var.aws_vpc_subnet_id + + module_var_bastion_sg_id = module.run_bastion_inject_module.output_bastion_security_group_id + module_var_bastion_connection_sg_id = module.run_bastion_inject_module.output_bastion_connection_security_group_id + + module_var_sap_nwas_abap_pas_instance_no = var.sap_nwas_abap_pas_instance_no + module_var_sap_hana_instance_no = var.sap_hana_install_instance_number + +} + + +module "run_host_nfs_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/host_nfs?ref=main" + + module_var_resource_prefix = var.resource_prefix + module_var_aws_vpc_subnet_id = local.aws_vpc_subnet_create_boolean ? module.run_account_init_module.output_aws_vpc_subnet_id : var.aws_vpc_subnet_id + module_var_host_sg_id = module.run_account_bootstrap_module.output_host_security_group_id + + module_var_nfs_boolean_sapmnt = contains([for host in var.map_host_specifications[var.host_specification_plan] : host.nfs_boolean_sapmnt],true) + +} + + +module "run_host_provision_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module, + module.run_host_nfs_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/host_provision?ref=main" +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/host_provision_nfs?ref=main" + + # Set Terraform Module Variables using Terraform Variables at runtime + + module_var_aws_vpc_subnet_id = local.aws_vpc_subnet_create_boolean ? module.run_account_init_module.output_aws_vpc_subnet_id : var.aws_vpc_subnet_id + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + module_var_bastion_ip = module.run_bastion_inject_module.output_bastion_ip + module_var_bastion_connection_sg_id = module.run_bastion_inject_module.output_bastion_connection_security_group_id + + module_var_host_ssh_key_name = module.run_account_bootstrap_module.output_host_ssh_key_name + module_var_host_ssh_public_key = module.run_account_bootstrap_module.output_host_public_ssh_key + module_var_host_ssh_private_key = module.run_account_bootstrap_module.output_host_private_ssh_key + module_var_host_sg_id = module.run_account_bootstrap_module.output_host_security_group_id + + module_var_host_os_image = var.map_os_image_regex[var.host_os_image] + + module_var_dns_zone_id = module.run_account_bootstrap_module.output_dns_zone_id + module_var_dns_root_domain_name = module.run_account_bootstrap_module.output_dns_domain_name + module_var_dns_nameserver_list = module.run_account_bootstrap_module.output_dns_nameserver_list + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable with nested objects + + for_each = toset([ + for key, value in var.map_host_specifications[var.host_specification_plan] : key + ]) + + module_var_host_name = each.key + + module_var_aws_ec2_instance_type = var.map_host_specifications[var.host_specification_plan][each.key].ec2_instance_type + + module_var_disk_volume_count_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data + module_var_disk_volume_type_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data + module_var_disk_volume_capacity_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_data + module_var_disk_volume_iops_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_data : null + module_var_lvm_enable_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data + module_var_lvm_pv_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_data : 0 + module_var_lvm_vg_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_data : 0 + module_var_lvm_vg_physical_extent_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_data : 0 + module_var_lvm_lv_stripe_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_data : 0 + module_var_filesystem_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_data + module_var_physical_partition_filesystem_block_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_data + + module_var_disk_volume_count_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log + module_var_disk_volume_type_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log + module_var_disk_volume_capacity_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_log + module_var_disk_volume_iops_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_log : null + module_var_lvm_enable_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log + module_var_lvm_pv_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_log : 0 + module_var_lvm_vg_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_log : 0 + module_var_lvm_vg_physical_extent_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_log : 0 + module_var_lvm_lv_stripe_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_log : 0 + module_var_filesystem_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_log + module_var_physical_partition_filesystem_block_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_log + + module_var_disk_volume_count_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared + module_var_disk_volume_type_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared + module_var_disk_volume_capacity_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_shared + module_var_disk_volume_iops_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_shared : null + module_var_lvm_enable_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared + module_var_lvm_pv_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_shared : 0 + module_var_lvm_vg_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_shared : 0 + module_var_lvm_vg_physical_extent_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_shared : 0 + module_var_lvm_lv_stripe_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_shared : 0 + module_var_filesystem_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_shared + module_var_physical_partition_filesystem_block_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_shared + + module_var_disk_volume_count_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb + module_var_disk_volume_type_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb + module_var_disk_volume_capacity_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_anydb + module_var_disk_volume_iops_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_anydb : null + module_var_lvm_enable_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb + module_var_lvm_pv_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_anydb : 0 + module_var_lvm_vg_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_anydb : 0 + module_var_lvm_vg_physical_extent_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_anydb : 0 + module_var_lvm_lv_stripe_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_anydb : 0 + module_var_filesystem_mount_path_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_mount_path_anydb + module_var_filesystem_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_anydb + module_var_physical_partition_filesystem_block_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_anydb + + module_var_disk_volume_count_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_usr_sap + module_var_disk_volume_type_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_usr_sap + module_var_disk_volume_capacity_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_usr_sap + module_var_filesystem_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_usr_sap + + module_var_disk_volume_count_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_sapmnt + module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt + module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt + module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].nfs_boolean_sapmnt + module_var_nfs_fqdn_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].nfs_boolean_sapmnt ? module.run_host_nfs_module.output_nfs_fqdn : "" + + module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb + module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap + module_var_disk_volume_type_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_swap : 0 + module_var_disk_volume_capacity_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_swap : 0 + module_var_filesystem_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].filesystem_swap : 0 + + module_var_disk_volume_type_software = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_software + module_var_disk_volume_capacity_software = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_software + module_var_sap_software_download_directory = var.sap_software_download_directory + + module_var_disable_ip_anti_spoofing = false + +} + + + +module "run_ansible_sap_s4hana_distributed_install_maintplan" { + + depends_on = [module.run_host_provision_module] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_s4hana_distributed_install_maintplan?ref=main" + + # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) + module_var_bastion_boolean = true // required as true boolean for any Cloud Service Provider (CSP) + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_floating_ip = module.run_bastion_inject_module.output_bastion_ip + + module_var_host_private_ssh_key = module.run_account_bootstrap_module.output_host_private_ssh_key + + + module_var_dns_root_domain_name = var.dns_root_domain + +# module_var_inventory_hana_primary = module.run_host_provision_module["hana-p"].output_host_private_ip +# module_var_inventory_nwas_ascs = module.run_host_provision_module["nw-ascs"].output_host_private_ip +# module_var_inventory_nwas_pas = module.run_host_provision_module["nw-pas"].output_host_private_ip +# module_var_inventory_nwas_aas = join("\n", flatten([module.run_host_provision_module["nw-aas"].output_host_private_ip])) + + module_var_inventory_hana_primary = "${module.run_host_provision_module["hana-p"].output_host_name} ansible_host=${module.run_host_provision_module["hana-p"].output_host_private_ip}" + module_var_inventory_nwas_ascs = "${module.run_host_provision_module["nw-ascs"].output_host_name} ansible_host=${module.run_host_provision_module["nw-ascs"].output_host_private_ip}" + module_var_inventory_nwas_pas = "${module.run_host_provision_module["nw-pas"].output_host_name} ansible_host=${module.run_host_provision_module["nw-pas"].output_host_private_ip}" + module_var_inventory_nwas_aas = "${module.run_host_provision_module["nw-aas"].output_host_name} ansible_host=${module.run_host_provision_module["nw-aas"].output_host_private_ip}" + + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + + module_var_sap_hana_install_master_password = var.sap_hana_install_master_password + module_var_sap_hana_install_sid = var.sap_hana_install_sid + module_var_sap_hana_install_instance_number = var.sap_hana_install_instance_number + + module_var_sap_swpm_sid = var.sap_s4hana_install_sid + + module_var_sap_swpm_db_schema_abap = "SAPHANADB" + module_var_sap_swpm_db_schema_abap_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_system_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_systemdb_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_sidadm_password = var.sap_hana_install_master_password + module_var_sap_swpm_ddic_000_password = var.sap_hana_install_master_password + module_var_sap_swpm_pas_instance_nr = var.sap_nwas_abap_pas_instance_no + module_var_sap_swpm_ascs_instance_nr = var.sap_nwas_abap_ascs_instance_no + + module_var_sap_swpm_master_password = var.sap_hana_install_master_password + + module_var_sap_maintenance_planner_transaction_name = var.sap_maintenance_planner_transaction_name + + module_var_sap_swpm_template_selected = var.sap_swpm_template_selected + + module_var_sap_software_download_directory = var.sap_software_download_directory + +} diff --git a/sap_s4hana_distributed_install/aws_ec2_instance/outputs.tf b/sap_s4hana_distributed_install/aws_ec2_instance/outputs.tf new file mode 100644 index 0000000..2a16c91 --- /dev/null +++ b/sap_s4hana_distributed_install/aws_ec2_instance/outputs.tf @@ -0,0 +1,234 @@ + +############################################################## +# Export SSH key to file on local +############################################################## + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "bastion_rsa" { + content = module.run_account_bootstrap_module.output_bastion_private_ssh_key + filename = "${path.root}/ssh/bastion_rsa" + file_permission = "0400" +} + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "hosts_rsa" { + content = module.run_account_bootstrap_module.output_host_private_ssh_key + filename = "${path.root}/ssh/hosts_rsa" + file_permission = "0400" +} + + +output "ssh_sap_connection_details" { + value = local.is_wsl ? "IGNORE" : <>> Chosen option $REPLY: $opt" + select opt_ip in "$${target_host_array[@]}"; do + if [ $opt_ip = "Quit" ]; then break 2; fi + target_ip=$opt_ip + echo "---- Selected option $REPLY, tunneling into $target_ip ----" + break + done + echo "" + echo "#### For SAP HANA Studio, use Add System with host name as localhost; do not add port numbers." + echo "#### If selecting 'Connect using SSL' on Connection Properties, then on Additional Properties (final) screen deselect 'Validate the SSL certificate'" + echo "" + echo "#### For SAPGUI, use expert mode SAP Logon String as: ####" + echo "conn=/H/localhost/S/32$sap_nwas_abap_pas_instance_no&expert=true" + echo "" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N \ + $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file \ + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -L localhost:32$sap_nwas_abap_pas_instance_no:$target_ip:32$sap_nwas_abap_pas_instance_no \ + -L localhost:33$sap_nwas_abap_pas_instance_no:$target_ip:33$sap_nwas_abap_pas_instance_no \ + -L localhost:3$${sap_hana_instance_no}13:$target_ip:3$${sap_hana_instance_no}13 \ + -L localhost:3$${sap_hana_instance_no}15:$target_ip:3$${sap_hana_instance_no}15 \ + -L localhost:3$${sap_hana_instance_no}41:$target_ip:3$${sap_hana_instance_no}41 \ + -L localhost:443$sap_hana_instance_no:$target_ip:443$sap_hana_instance_no \ + -L localhost:443$sap_nwas_abap_pas_instance_no:$target_ip:443$sap_nwas_abap_pas_instance_no \ + -L localhost:5$${sap_hana_instance_no}13:$target_ip:5$${sap_hana_instance_no}13 \ + -L localhost:5$${sap_hana_instance_no}14:$target_ip:5$${sap_hana_instance_no}14 + break + ;; + "OS root access, via SSH stdin/stdout forwarding proxy") + echo ">>> Chosen option $REPLY: $opt" + select opt_ssh in "$${target_host_array[@]}"; do + if [ $opt_ssh = "Quit" ]; then break 2; fi + target_ip=$opt_ssh + echo "---- Selected option $REPLY, logging into $target_ip ----" + break + done + + if [ -n "$target_ip" ]; then + ssh -i $target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + fi + break + ;; + "Quit") + break + ;; + *) echo "Invalid option $REPLY" ;; + esac + done +} + +# Then call shell function and select which target +sshjump + +EOF +} + +# If detected Windows WSL2, then find the installed name using external resource to return a JSON string +data "external" "wsl_distro_name" { + count = local.is_wsl ? 1 : 0 + program = ["bash", "-c", "echo \"{\\\"stdout\\\":\\\"$(echo $WSL_DISTRO_NAME)\\\"}\""] +} + +output "ssh_sap_connection_details_windows" { + value = local.not_wsl ? "IGNORE" : <>> Chosen option $(PSItem)" + echo "" + echo "#### For SAP HANA Studio, use Add System with host name as localhost; do not add port numbers." + echo "#### If selecting 'Connect using SSL' on Connection Properties, then on Additional Properties (final) screen deselect 'Validate the SSL certificate'" + echo "" + echo "#### For SAPGUI, use expert mode SAP Logon String as: ####" + echo "conn=/H/localhost/S/32$sap_nwas_abap_pas_instance_no&expert=true" + echo "" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N ` + $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -L localhost:32$${sap_nwas_abap_pas_instance_no}:$${target_ip}:32$${sap_nwas_abap_pas_instance_no} ` + -L localhost:33$${sap_nwas_abap_pas_instance_no}:$${target_ip}:33$${sap_nwas_abap_pas_instance_no} ` + -L localhost:3$${sap_hana_instance_no}13:$${target_ip}:3$${sap_hana_instance_no}13 ` + -L localhost:3$${sap_hana_instance_no}15:$${target_ip}:3$${sap_hana_instance_no}15 ` + -L localhost:3$${sap_hana_instance_no}41:$${target_ip}:3$${sap_hana_instance_no}41 ` + -L localhost:443$${sap_hana_instance_no}:$${target_ip}:443$${sap_hana_instance_no} ` + -L localhost:443$${sap_nwas_abap_pas_instance_no}:$${target_ip}:443$${sap_nwas_abap_pas_instance_no} ` + -L localhost:5$${sap_hana_instance_no}13:$${target_ip}:5$${sap_hana_instance_no}13 ` + -L localhost:5$${sap_hana_instance_no}14:$${target_ip}:5$${sap_hana_instance_no}14 + } + } + 2 { + foreach ($target_host in $target_host_array) { + $i=$target_host_array.IndexOf($target_host) + echo "$i) $target_host" + } + $target_host_selection = Read-Host "Please make a selection" + if ($target_host_array[$target_host_selection] -eq "Quit" ){ + break + }else { + $target_ip = $target_host_array[$target_host_selection] + #echo ">>> Chosen option $(PSItem)" + ssh -i $temp_target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + } + } + 3 { + break + } + } +} + +EOF + +} diff --git a/sap_s4hana_distributed_install/aws_ec2_instance/outputs_debug.tf b/sap_s4hana_distributed_install/aws_ec2_instance/outputs_debug.tf new file mode 100644 index 0000000..ff3141d --- /dev/null +++ b/sap_s4hana_distributed_install/aws_ec2_instance/outputs_debug.tf @@ -0,0 +1,4 @@ + +############################################################## +# DEBUG variable map +############################################################## diff --git a/sap_s4hana_distributed_install/aws_ec2_instance/variable_locals.tf b/sap_s4hana_distributed_install/aws_ec2_instance/variable_locals.tf new file mode 100644 index 0000000..8c2f87c --- /dev/null +++ b/sap_s4hana_distributed_install/aws_ec2_instance/variable_locals.tf @@ -0,0 +1,19 @@ +locals { + + aws_vpc_subnet_create_boolean = var.aws_vpc_subnet_id == "new" ? true : false + + # Directories start with "C:..." on Windows; All other OSs use "/" for root. + detect_windows = substr(pathexpand("~"), 0, 1) == "/" ? false : true + detect_shell = substr(pathexpand("~"), 0, 1) == "/" ? true : false + + # Used for displaying Shell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + not_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? false : true : true + + # Used for displaying Windows PowerShell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + is_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? true : false : false + + aws_region = replace(var.aws_vpc_availability_zone,"/[a-c]$/","") + +} diff --git a/sap_s4hana_distributed_install/aws_ec2_instance/variable_map_hosts.tf b/sap_s4hana_distributed_install/aws_ec2_instance/variable_map_hosts.tf new file mode 100644 index 0000000..4943e3f --- /dev/null +++ b/sap_s4hana_distributed_install/aws_ec2_instance/variable_map_hosts.tf @@ -0,0 +1,184 @@ + +variable "map_host_specifications" { + + description = "Map of host specficiations for SAP S/4HANA distributed install" + + type = map(any) + + default = { + + small_256gb = { + + hana-p = { // Hostname + ec2_instance_type = "r5.8xlarge" + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 1 + disk_volume_type_hana_data = "gp3" + disk_volume_capacity_hana_data = 384 + #disk_volume_iops_hana_data = + lvm_enable_hana_data = false // if false, then disk volume count should be 1 + #lvm_pv_data_alignment_hana_data = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + #lvm_vg_data_alignment_hana_data = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + #lvm_vg_physical_extent_size_hana_data = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + #lvm_lv_stripe_size_hana_data = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_data = "xfs" + physical_partition_filesystem_block_size_hana_data = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_hana_log = 1 + disk_volume_type_hana_log = "gp3" + disk_volume_capacity_hana_log = 128 + #disk_volume_iops_hana_log = + lvm_enable_hana_log = false // if false, then disk volume count should be 1 + #lvm_pv_data_alignment_hana_log = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + #lvm_vg_data_alignment_hana_log = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + #lvm_vg_physical_extent_size_hana_log = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + #lvm_lv_stripe_size_hana_log = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_log = "xfs" + physical_partition_filesystem_block_size_hana_log = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_hana_shared = 1 + disk_volume_type_hana_shared = "gp3" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_hana_shared = 320 + #disk_volume_iops_hana_shared = + lvm_enable_hana_shared = false // if false, then disk volume count should be 1 + #lvm_pv_data_alignment_hana_shared = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + #lvm_vg_data_alignment_hana_shared = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + #lvm_vg_physical_extent_size_hana_shared = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + #lvm_lv_stripe_size_hana_shared = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_shared = "xfs" + physical_partition_filesystem_block_size_hana_shared = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 0 // max of 1 + disk_volume_type_usr_sap = "gp3" + disk_volume_capacity_usr_sap = 64 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_type_sapmnt = "gp3" + disk_volume_capacity_sapmnt = 50 + filesystem_sapmnt = "xfs" + nfs_boolean_sapmnt = false + + disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 0 // max of 1 + #disk_volume_type_swap = "gp3" + #disk_volume_capacity_swap = 10 + #filesystem_swap = "xfs" + + disk_volume_type_software = "gp3" + disk_volume_capacity_software = 304 + }, + + + nw-ascs = { // Hostname + ec2_instance_type = "m5.8xlarge" + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 0 + + disk_volume_count_hana_log = 0 + + disk_volume_count_hana_shared = 0 + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 1 // max of 1 + disk_volume_type_usr_sap = "gp3" + disk_volume_capacity_usr_sap = 64 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 1 // max of 1 + disk_volume_type_sapmnt = "gp3" + disk_volume_capacity_sapmnt = 56 + filesystem_sapmnt = "xfs" + nfs_boolean_sapmnt = true + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "gp3" + disk_volume_capacity_swap = 96 + filesystem_swap = "xfs" + + disk_volume_type_software = "gp3" + disk_volume_capacity_software = 100 + } + + + nw-pas = { // Hostname + ec2_instance_type = "m5.8xlarge" + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 0 + + disk_volume_count_hana_log = 0 + + disk_volume_count_hana_shared = 0 + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 1 // max of 1 + disk_volume_type_usr_sap = "gp3" + disk_volume_capacity_usr_sap = 64 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 1 // max of 1 + disk_volume_type_sapmnt = "gp3" + disk_volume_capacity_sapmnt = 56 + filesystem_sapmnt = "xfs" + nfs_boolean_sapmnt = true + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "gp3" + disk_volume_capacity_swap = 96 + filesystem_swap = "xfs" + + disk_volume_type_software = "gp3" + disk_volume_capacity_software = 304 + } + + + nw-aas = { // Hostname + ec2_instance_type = "m5.8xlarge" + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 0 + + disk_volume_count_hana_log = 0 + + disk_volume_count_hana_shared = 0 + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 1 // max of 1 + disk_volume_type_usr_sap = "gp3" + disk_volume_capacity_usr_sap = 64 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 1 // max of 1 + disk_volume_type_sapmnt = "gp3" + disk_volume_capacity_sapmnt = 56 + filesystem_sapmnt = "xfs" + nfs_boolean_sapmnt = true + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "gp3" + disk_volume_capacity_swap = 96 + filesystem_swap = "xfs" + + disk_volume_type_software = "gp3" + disk_volume_capacity_software = 100 + } + + } + + } +} diff --git a/sap_s4hana_distributed_install/aws_ec2_instance/variable_map_os.tf b/sap_s4hana_distributed_install/aws_ec2_instance/variable_map_os.tf new file mode 100644 index 0000000..6e9483c --- /dev/null +++ b/sap_s4hana_distributed_install/aws_ec2_instance/variable_map_os.tf @@ -0,0 +1,48 @@ + +variable "map_os_image_regex" { + + description = "Map of operating systems OS Image regex, to identify latest OS Image for the OS major.minor version" + + type = map(any) + + default = { + + rhel-8-1 = "*RHEL-8.1*_HVM*x86_64*" + + rhel-8-2 = "*RHEL-8.2*_HVM*x86_64*" + + rhel-8-4 = "*RHEL-8.4*_HVM*x86_64*" + + rhel-8-6 = "*RHEL-8.6*_HVM*x86_64*" + + rhel-7-7-sap-ha = "*RHEL-SAP-7.7*" + + rhel-7-9-sap-ha = "*RHEL-SAP-7.9*" + + rhel-8-1-sap-ha = "*RHEL-SAP-8.1.0*" + + rhel-8-2-sap-ha = "*RHEL-SAP-8.2.0*" + + rhel-8-4-sap-ha = "*RHEL-SAP-8.4.0*" + + rhel-8-6-sap-ha = "*RHEL-SAP-8.6.0*" + + sles-15-2 = "*suse-sles-15-sp2-v202*-hvm-ssd-x86_64*" + + sles-15-3 = "*suse-sles-15-sp3-v202*-hvm-ssd-x86_64*" + + sles-15-4 = "*suse-sles-15-sp4-v202*-hvm-ssd-x86_64*" + + sles-12-5-sap-ha = "*suse-sles-sap-12-sp5-v202*-hvm-ssd-x86_64*" + + sles-15-1-sap-ha = "*suse-sles-sap-15-sp1-v202*-hvm-ssd-x86_64*" + + sles-15-2-sap-ha = "*suse-sles-sap-15-sp2-v202*-hvm-ssd-x86_64*" + + sles-15-3-sap-ha = "*suse-sles-sap-15-sp3-v202*-hvm-ssd-x86_64*" + + sles-15-4-sap-ha = "*suse-sles-sap-15-sp4-v202*-hvm-ssd-x86_64*" + + } + +} diff --git a/sap_s4hana_distributed_install/aws_ec2_instance/variables.tf b/sap_s4hana_distributed_install/aws_ec2_instance/variables.tf new file mode 100644 index 0000000..85dfbe6 --- /dev/null +++ b/sap_s4hana_distributed_install/aws_ec2_instance/variables.tf @@ -0,0 +1,120 @@ + +variable "aws_access_key" { + description = "AWS Access Key" +} + +variable "aws_secret_key" { + description = "AWS Secret Key" +} + +variable "resource_prefix" { + description = "Prefix to resource names" +} + +variable "aws_vpc_availability_zone" { + description = "Target AWS VPC Availability Zone (the AWS Region will be calculated from this value)" +} + +variable "aws_vpc_subnet_id" { + description = "Enter existing/target VPC Subnet ID, or enter 'new' to create a VPC with a default VPC prefix range" +} + +variable "dns_root_domain" { + description = "Root Domain for Private DNS used with the Virtual Server" +} + +variable "bastion_os_image" { + description = "Bastion OS Image. This variable uses the locals mapping with regex of OS Images, and will alter bastion provisioning." +} + +variable "bastion_user" { + description = "OS User to create on Bastion host to avoid pass-through root user (e.g. bastionuser)" +} + +variable "bastion_ssh_port" { + type = number + description = "Bastion host SSH Port from IANA Dynamic Ports range (49152 to 65535)" + + #validation { + # condition = var.bastion_ssh_port > 49152 && var.bastion_ssh_port < 65535 + # error_message = "Bastion host SSH Port must fall within IANA Dynamic Ports range (49152 to 65535)." + #} +} + +variable "host_specification_plan" { + description = "Host specification plans are small_256gb. This variable uses the locals mapping with a nested list of host specifications, and will alter host provisioning." +} + +variable "host_os_image" { + description = "Host OS Image. This variable uses the locals mapping with regex of OS Images, and will alter host provisioning." +} + +variable "sap_software_download_directory" { + description = "Mount point for downloads of SAP Software" + + validation { + error_message = "Directory must start with forward slash." + condition = can(regex("^/", var.sap_software_download_directory)) + } + +} + + + +variable "sap_id_user" { + description = "Ansible - Please enter your SAP ID user (e.g. S-User)" +} + +variable "sap_id_user_password" { + description = "Ansible - Please enter your SAP ID password" +} + +variable "sap_hana_install_master_password" { + description = "Ansible - SAP HANA install: set common initial password (e.g. NewPass$321)" +} + +variable "sap_hana_install_sid" { + description = "Ansible - SAP HANA install: System ID (e.g. H01)" +} + +variable "sap_hana_install_instance_number" { + description = "Ansible - SAP HANA install: Instance Number (e.g. 90)" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_hana_install_instance_number)) + } + +} + +variable "sap_s4hana_install_sid" { + description = "Ansible - SAP S/4HANA install: System ID (e.g. S01)" +} + +variable "sap_maintenance_planner_transaction_name" { + description = "Ansible - SAP Maintenance Planner Transaction name for SAP S/4HANA, required to perform download of this stack" +} + +variable "sap_swpm_template_selected" { + description = "Ansible - Select template to use: sap_s4hana_2021_distributed, sap_s4hana_2022_distributed" +} + +variable "sap_nwas_abap_ascs_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - ABAP Central Services (ASCS) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_ascs_instance_no)) + } + +} + +variable "sap_nwas_abap_pas_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - Primary Application Server instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_pas_instance_no)) + } + +} diff --git a/sap_s4hana_distributed_install/aws_ec2_instance/variables_generic_for_cli.tfvars b/sap_s4hana_distributed_install/aws_ec2_instance/variables_generic_for_cli.tfvars new file mode 100644 index 0000000..0b34756 --- /dev/null +++ b/sap_s4hana_distributed_install/aws_ec2_instance/variables_generic_for_cli.tfvars @@ -0,0 +1,27 @@ +resource_prefix = "sap" + +dns_root_domain = "sap.cloud" + +bastion_os_image = "rhel-8-2-sap-ha" + +bastion_user = "bastionuser" + +bastion_ssh_port = 50222 + +host_specification_plan = "small_256gb" + +host_os_image = "rhel-8-2-sap-ha" + +sap_hana_install_master_password = "NewPass$321" + +sap_hana_install_sid = "H01" + +sap_hana_install_instance_number = "90" + +sap_nwas_abap_ascs_instance_no = "01" + +sap_nwas_abap_pas_instance_no = "00" + +sap_s4hana_install_sid = "S01" + +sap_software_download_directory = "/software" diff --git a/sap_s4hana_distributed_install/aws_ec2_instance/versions.tf b/sap_s4hana_distributed_install/aws_ec2_instance/versions.tf new file mode 100644 index 0000000..f3d8ef7 --- /dev/null +++ b/sap_s4hana_distributed_install/aws_ec2_instance/versions.tf @@ -0,0 +1,29 @@ +# Terraform declaration + +terraform { + required_version = ">= 1.0" + required_providers { + aws = { + #source = "localdomain/provider/aws" // Local, on macOS path to place files would be $HOME/.terraform.d/plugins/localdomain/provider/aws/1.xx.xx/darwin_amd6 + source = "hashicorp/aws" // Terraform Registry + version = ">=3.73.0" + } + } +} + + +# Terraform Provider declaration + +provider "aws" { + + # Define Provider inputs manually + # access_key = "xxxxxxx" + # secret_key = "xxxxxxx" + # region = "xxxxxxx" + + # Define Provider inputs from given Terraform Variables + access_key = var.aws_access_key + secret_key = var.aws_secret_key + region = local.aws_region + +} diff --git a/sap_s4hana_distributed_install/gcp_ce_vm/main.tf b/sap_s4hana_distributed_install/gcp_ce_vm/main.tf new file mode 100644 index 0000000..8faaa17 --- /dev/null +++ b/sap_s4hana_distributed_install/gcp_ce_vm/main.tf @@ -0,0 +1,317 @@ + +module "run_ansible_dry_run" { + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_s4hana_distributed_install_maintplan?ref=main" + + module_var_dry_run_test = "x86_64" // x86_64 or ppc64le + + # Terraform Module Variables which are mandatory, all with an empty string + module_var_bastion_boolean = false + module_var_bastion_user = "" + module_var_bastion_ssh_port = 0 + module_var_bastion_private_ssh_key = "" + module_var_bastion_floating_ip = "" + module_var_host_private_ssh_key = "" + module_var_host_private_ip = "" + module_var_hostname = "software_media_dry_run" + module_var_dns_root_domain_name = "" + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + module_var_sap_swpm_sid = "" + module_var_sap_swpm_db_schema_abap = "" + module_var_sap_swpm_db_schema_abap_password = "" + module_var_sap_swpm_ddic_000_password = "" + module_var_sap_swpm_template_selected = var.sap_swpm_template_selected + module_var_sap_maintenance_planner_transaction_name = var.sap_maintenance_planner_transaction_name + +} + + +module "run_account_init_module" { + + depends_on = [ + module.run_ansible_dry_run + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/account_init?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_region = local.google_cloud_region + module_var_gcp_vpc_subnet_create_boolean = local.google_cloud_vpc_subnet_create_boolean + module_var_gcp_vpc_subnet_name = local.google_cloud_vpc_subnet_create_boolean ? 0 : var.google_cloud_vpc_subnet_name + +} + + +module "run_account_bootstrap_module" { + + depends_on = [ + module.run_account_init_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/account_bootstrap?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_vpc_subnet_name = module.run_account_init_module.output_vpc_subnet_name + + module_var_dns_root_domain_name = var.dns_root_domain + +} + + +module "run_bastion_inject_module" { + + depends_on = [ + module.run_account_bootstrap_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/bastion_inject?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_region = local.google_cloud_region + module_var_gcp_region_zone = var.google_cloud_region_zone + module_var_gcp_vpc_subnet_name = module.run_account_init_module.output_vpc_subnet_name + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_os_image = var.map_os_image_regex[var.bastion_os_image] + + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + module_var_bastion_public_ssh_key = module.run_account_bootstrap_module.output_bastion_public_ssh_key + +} + + +module "run_host_network_access_sap_module" { + + depends_on = [ + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/host_network_access_sap?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_vpc_subnet_name = module.run_account_init_module.output_vpc_subnet_name + + module_var_sap_nwas_abap_ascs_instance_no = var.sap_nwas_abap_ascs_instance_no + module_var_sap_nwas_abap_pas_instance_no = var.sap_nwas_abap_pas_instance_no + module_var_sap_hana_instance_no = var.sap_hana_install_instance_number + +} + + +module "run_host_network_access_sap_public_via_proxy_module" { + + depends_on = [ + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/host_network_access_sap_public_via_proxy?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_vpc_subnet_name = module.run_account_init_module.output_vpc_subnet_name + + module_var_sap_hana_instance_no = var.sap_hana_install_instance_number + module_var_sap_nwas_abap_pas_instance_no = var.sap_nwas_abap_pas_instance_no + + module_var_bastion_subnet_name = module.run_bastion_inject_module.output_bastion_subnet_name + +} + + +module "run_host_nfs_module" { + + depends_on = [ + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/host_nfs?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_region_zone = var.google_cloud_region_zone + module_var_gcp_vpc_subnet_name = module.run_account_init_module.output_vpc_subnet_name + + module_var_nfs_boolean_sapmnt = contains([for host in var.map_host_specifications[var.host_specification_plan] : host.nfs_boolean_sapmnt],true) + +} + + +module "run_host_provision_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module, + module.run_host_nfs_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/host_provision?ref=main" + + # Set Terraform Module Variables using Terraform Variables at runtime + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_region_zone = var.google_cloud_region_zone + module_var_gcp_vpc_subnet_name = module.run_account_init_module.output_vpc_subnet_name + + module_var_dns_root_domain_name = var.dns_root_domain + module_var_dns_zone_name = module.run_account_bootstrap_module.output_dns_zone_name + + module_var_host_os_image = var.map_os_image_regex[var.host_os_image] + + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_user = var.bastion_user + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + module_var_bastion_ip = module.run_bastion_inject_module.output_bastion_ip + + module_var_host_ssh_public_key = module.run_account_bootstrap_module.output_host_public_ssh_key + module_var_host_ssh_private_key = module.run_account_bootstrap_module.output_host_private_ssh_key + + + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable with nested objects + + for_each = toset([ + for key, value in var.map_host_specifications[var.host_specification_plan] : key + ]) + + module_var_virtual_machine_hostname = each.key + + module_var_virtual_machine_profile = var.map_host_specifications[var.host_specification_plan][each.key].virtual_machine_profile + + module_var_disk_volume_count_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data + module_var_disk_volume_type_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data + module_var_disk_volume_capacity_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_data + module_var_disk_volume_iops_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_data : null + module_var_lvm_enable_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data + module_var_lvm_pv_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_data : 0 + module_var_lvm_vg_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_data : 0 + module_var_lvm_vg_physical_extent_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_data : 0 + module_var_lvm_lv_stripe_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_data : 0 + module_var_filesystem_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_data + module_var_physical_partition_filesystem_block_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_data + + module_var_disk_volume_count_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log + module_var_disk_volume_type_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log + module_var_disk_volume_capacity_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_log + module_var_disk_volume_iops_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_log : null + module_var_lvm_enable_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log + module_var_lvm_pv_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_log : 0 + module_var_lvm_vg_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_log : 0 + module_var_lvm_vg_physical_extent_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_log : 0 + module_var_lvm_lv_stripe_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_log : 0 + module_var_filesystem_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_log + module_var_physical_partition_filesystem_block_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_log + + module_var_disk_volume_count_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared + module_var_disk_volume_type_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared + module_var_disk_volume_capacity_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_shared + module_var_disk_volume_iops_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_shared : null + module_var_lvm_enable_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared + module_var_lvm_pv_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_shared : 0 + module_var_lvm_vg_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_shared : 0 + module_var_lvm_vg_physical_extent_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_shared : 0 + module_var_lvm_lv_stripe_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_shared : 0 + module_var_filesystem_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_shared + module_var_physical_partition_filesystem_block_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_shared + + module_var_disk_volume_count_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb + module_var_disk_volume_type_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb + module_var_disk_volume_capacity_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_anydb + module_var_disk_volume_iops_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_anydb : null + module_var_lvm_enable_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb + module_var_lvm_pv_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_anydb : 0 + module_var_lvm_vg_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_anydb : 0 + module_var_lvm_vg_physical_extent_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_anydb : 0 + module_var_lvm_lv_stripe_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_anydb : 0 + module_var_filesystem_mount_path_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_mount_path_anydb + module_var_filesystem_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_anydb + module_var_physical_partition_filesystem_block_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_anydb + + module_var_disk_volume_count_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_usr_sap + module_var_disk_volume_type_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_usr_sap + module_var_disk_volume_capacity_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_usr_sap + module_var_filesystem_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_usr_sap + + module_var_disk_volume_count_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_sapmnt + module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt + module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt + module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].nfs_boolean_sapmnt + module_var_nfs_fqdn_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].nfs_boolean_sapmnt ? module.run_host_nfs_module.output_nfs_fqdn : "" + + module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb + module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap + module_var_disk_volume_type_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_swap : 0 + module_var_disk_volume_capacity_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_swap : 0 + module_var_filesystem_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].filesystem_swap : 0 + + module_var_disk_volume_type_software = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_software + module_var_disk_volume_capacity_software = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_software + module_var_sap_software_download_directory = var.sap_software_download_directory + +} + + + +module "run_ansible_sap_s4hana_distributed_install_maintplan" { + + depends_on = [module.run_host_provision_module] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_s4hana_distributed_install_maintplan?ref=main" + + # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) + module_var_bastion_boolean = true // required as true boolean for any Cloud Service Provider (CSP) + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + module_var_bastion_floating_ip = module.run_bastion_inject_module.output_bastion_ip + + module_var_host_private_ssh_key = module.run_account_bootstrap_module.output_host_private_ssh_key + + + module_var_dns_root_domain_name = var.dns_root_domain + +# module_var_inventory_hana_primary = module.run_host_provision_module["hana-p"].output_host_private_ip +# module_var_inventory_nwas_ascs = module.run_host_provision_module["nw-ascs"].output_host_private_ip +# module_var_inventory_nwas_pas = module.run_host_provision_module["nw-pas"].output_host_private_ip +# module_var_inventory_nwas_aas = join("\n", flatten([module.run_host_provision_module["nw-aas"].output_host_private_ip])) + + module_var_inventory_hana_primary = "${module.run_host_provision_module["hana-p"].output_host_name} ansible_host=${module.run_host_provision_module["hana-p"].output_host_private_ip}" + module_var_inventory_nwas_ascs = "${module.run_host_provision_module["nw-ascs"].output_host_name} ansible_host=${module.run_host_provision_module["nw-ascs"].output_host_private_ip}" + module_var_inventory_nwas_pas = "${module.run_host_provision_module["nw-pas"].output_host_name} ansible_host=${module.run_host_provision_module["nw-pas"].output_host_private_ip}" + module_var_inventory_nwas_aas = "${module.run_host_provision_module["nw-aas"].output_host_name} ansible_host=${module.run_host_provision_module["nw-aas"].output_host_private_ip}" + + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + + module_var_sap_hana_install_master_password = var.sap_hana_install_master_password + module_var_sap_hana_install_sid = var.sap_hana_install_sid + module_var_sap_hana_install_instance_number = var.sap_hana_install_instance_number + + module_var_sap_swpm_sid = var.sap_s4hana_install_sid + + module_var_sap_swpm_db_schema_abap = "SAPHANADB" + module_var_sap_swpm_db_schema_abap_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_system_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_systemdb_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_sidadm_password = var.sap_hana_install_master_password + module_var_sap_swpm_ddic_000_password = var.sap_hana_install_master_password + module_var_sap_swpm_pas_instance_nr = var.sap_nwas_abap_pas_instance_no + module_var_sap_swpm_ascs_instance_nr = var.sap_nwas_abap_ascs_instance_no + + module_var_sap_swpm_master_password = var.sap_hana_install_master_password + + module_var_sap_maintenance_planner_transaction_name = var.sap_maintenance_planner_transaction_name + + module_var_sap_swpm_template_selected = var.sap_swpm_template_selected + + module_var_sap_software_download_directory = var.sap_software_download_directory + +} diff --git a/sap_s4hana_distributed_install/gcp_ce_vm/outputs.tf b/sap_s4hana_distributed_install/gcp_ce_vm/outputs.tf new file mode 100644 index 0000000..f047a9b --- /dev/null +++ b/sap_s4hana_distributed_install/gcp_ce_vm/outputs.tf @@ -0,0 +1,235 @@ + +############################################################## +# Export SSH key to file on local +############################################################## + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "bastion_rsa" { + content = module.run_account_bootstrap_module.output_bastion_private_ssh_key + filename = "${path.root}/ssh/bastion_rsa" + file_permission = "0400" +} + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "hosts_rsa" { + content = module.run_account_bootstrap_module.output_host_private_ssh_key + filename = "${path.root}/ssh/hosts_rsa" + file_permission = "0400" +} + + +output "ssh_sap_connection_details" { + value = local.is_wsl ? "IGNORE" : <>> Chosen option $REPLY: $opt" + select opt_ip in "$${target_host_array[@]}"; do + if [ $opt_ip = "Quit" ]; then break 2; fi + target_ip=$opt_ip + echo "---- Selected option $REPLY, tunneling into $target_ip ----" + break + done + echo "" + echo "#### For SAP HANA Studio, use Add System with host name as localhost; do not add port numbers." + echo "#### If selecting 'Connect using SSL' on Connection Properties, then on Additional Properties (final) screen deselect 'Validate the SSL certificate'" + echo "" + echo "#### For SAPGUI, use expert mode SAP Logon String as: ####" + echo "conn=/H/localhost/S/32$sap_nwas_abap_pas_instance_no&expert=true" + echo "" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N \ + $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file \ + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -L localhost:32$sap_nwas_abap_pas_instance_no:$target_ip:32$sap_nwas_abap_pas_instance_no \ + -L localhost:33$sap_nwas_abap_pas_instance_no:$target_ip:33$sap_nwas_abap_pas_instance_no \ + -L localhost:3$${sap_hana_instance_no}13:$target_ip:3$${sap_hana_instance_no}13 \ + -L localhost:3$${sap_hana_instance_no}15:$target_ip:3$${sap_hana_instance_no}15 \ + -L localhost:3$${sap_hana_instance_no}41:$target_ip:3$${sap_hana_instance_no}41 \ + -L localhost:443$sap_hana_instance_no:$target_ip:443$sap_hana_instance_no \ + -L localhost:443$sap_nwas_abap_pas_instance_no:$target_ip:443$sap_nwas_abap_pas_instance_no \ + -L localhost:5$${sap_hana_instance_no}13:$target_ip:5$${sap_hana_instance_no}13 \ + -L localhost:5$${sap_hana_instance_no}14:$target_ip:5$${sap_hana_instance_no}14 + break + ;; + "OS root access, via SSH stdin/stdout forwarding proxy") + echo ">>> Chosen option $REPLY: $opt" + select opt_ssh in "$${target_host_array[@]}"; do + if [ $opt_ssh = "Quit" ]; then break 2; fi + target_ip=$opt_ssh + echo "---- Selected option $REPLY, logging into $target_ip ----" + break + done + + if [ -n "$target_ip" ]; then + ssh -i $target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + fi + break + ;; + "Quit") + break + ;; + *) echo "Invalid option $REPLY" ;; + esac + done +} + +# Then call shell function and select which target +sshjump + +EOF +} + + +# If detected Windows WSL2, then find the installed name using external resource to return a JSON string +data "external" "wsl_distro_name" { + count = local.is_wsl ? 1 : 0 + program = ["bash", "-c", "echo \"{\\\"stdout\\\":\\\"$(echo $WSL_DISTRO_NAME)\\\"}\""] +} + +output "ssh_sap_connection_details_windows" { + value = local.not_wsl ? "IGNORE" : <>> Chosen option $(PSItem)" + echo "" + echo "#### For SAP HANA Studio, use Add System with host name as localhost; do not add port numbers." + echo "#### If selecting 'Connect using SSL' on Connection Properties, then on Additional Properties (final) screen deselect 'Validate the SSL certificate'" + echo "" + echo "#### For SAPGUI, use expert mode SAP Logon String as: ####" + echo "conn=/H/localhost/S/32$sap_nwas_abap_pas_instance_no&expert=true" + echo "" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N ` + $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -L localhost:32$${sap_nwas_abap_pas_instance_no}:$${target_ip}:32$${sap_nwas_abap_pas_instance_no} ` + -L localhost:33$${sap_nwas_abap_pas_instance_no}:$${target_ip}:33$${sap_nwas_abap_pas_instance_no} ` + -L localhost:3$${sap_hana_instance_no}13:$${target_ip}:3$${sap_hana_instance_no}13 ` + -L localhost:3$${sap_hana_instance_no}15:$${target_ip}:3$${sap_hana_instance_no}15 ` + -L localhost:3$${sap_hana_instance_no}41:$${target_ip}:3$${sap_hana_instance_no}41 ` + -L localhost:443$${sap_hana_instance_no}:$${target_ip}:443$${sap_hana_instance_no} ` + -L localhost:443$${sap_nwas_abap_pas_instance_no}:$${target_ip}:443$${sap_nwas_abap_pas_instance_no} ` + -L localhost:5$${sap_hana_instance_no}13:$${target_ip}:5$${sap_hana_instance_no}13 ` + -L localhost:5$${sap_hana_instance_no}14:$${target_ip}:5$${sap_hana_instance_no}14 + } + } + 2 { + foreach ($target_host in $target_host_array) { + $i=$target_host_array.IndexOf($target_host) + echo "$i) $target_host" + } + $target_host_selection = Read-Host "Please make a selection" + if ($target_host_array[$target_host_selection] -eq "Quit" ){ + break + }else { + $target_ip = $target_host_array[$target_host_selection] + #echo ">>> Chosen option $(PSItem)" + ssh -i $temp_target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + } + } + 3 { + break + } + } +} + +EOF + +} diff --git a/sap_s4hana_distributed_install/gcp_ce_vm/variable_locals.tf b/sap_s4hana_distributed_install/gcp_ce_vm/variable_locals.tf new file mode 100644 index 0000000..8f30669 --- /dev/null +++ b/sap_s4hana_distributed_install/gcp_ce_vm/variable_locals.tf @@ -0,0 +1,19 @@ +locals { + + google_cloud_vpc_subnet_create_boolean = var.google_cloud_vpc_subnet_name == "new" ? true : false + + google_cloud_region = replace(var.google_cloud_region_zone, "/-[^-]*$/", "") + + # Directories start with "C:..." on Windows; All other OSs use "/" for root. + detect_windows = substr(pathexpand("~"), 0, 1) == "/" ? false : true + detect_shell = substr(pathexpand("~"), 0, 1) == "/" ? true : false + + # Used for displaying Shell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + not_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? false : true : true + + # Used for displaying Windows PowerShell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + is_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? true : false : false + +} diff --git a/sap_s4hana_distributed_install/gcp_ce_vm/variable_map_hosts.tf b/sap_s4hana_distributed_install/gcp_ce_vm/variable_map_hosts.tf new file mode 100644 index 0000000..0d186d1 --- /dev/null +++ b/sap_s4hana_distributed_install/gcp_ce_vm/variable_map_hosts.tf @@ -0,0 +1,195 @@ + +variable "map_host_specifications" { + + description = "Map of host specficiations for SAP S/4HANA distributed install" + + type = map(any) + + default = { + + small_256gb = { + + hana-p = { // Hostname + virtual_machine_profile = "n2-highmem-32" // 32 vCPU, 256GB Memory + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 1 + disk_volume_type_hana_data = "pd-ssd" + disk_volume_capacity_hana_data = 384 + #disk_volume_iops_hana_data = + lvm_enable_hana_data = false // if false, then disk volume count should be 1 + #lvm_pv_data_alignment_hana_data = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + #lvm_vg_data_alignment_hana_data = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + #lvm_vg_physical_extent_size_hana_data = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + #lvm_lv_stripe_size_hana_data = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_data = "xfs" + physical_partition_filesystem_block_size_hana_data = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_hana_log = 1 + disk_volume_type_hana_log = "pd-ssd" + disk_volume_capacity_hana_log = 128 + #disk_volume_iops_hana_log = + lvm_enable_hana_log = false // if false, then disk volume count should be 1 + #lvm_pv_data_alignment_hana_log = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + #lvm_vg_data_alignment_hana_log = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + #lvm_vg_physical_extent_size_hana_log = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + #lvm_lv_stripe_size_hana_log = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_log = "xfs" + physical_partition_filesystem_block_size_hana_log = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_hana_shared = 1 + disk_volume_type_hana_shared = "pd-balanced" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_hana_shared = 320 + #disk_volume_iops_hana_shared = + lvm_enable_hana_shared = false // if false, then disk volume count should be 1 + #lvm_pv_data_alignment_hana_shared = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + #lvm_vg_data_alignment_hana_shared = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + #lvm_vg_physical_extent_size_hana_shared = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + #lvm_lv_stripe_size_hana_shared = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_shared = "xfs" + physical_partition_filesystem_block_size_hana_shared = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 0 // max of 1 + disk_volume_type_usr_sap = "pd-standard" + disk_volume_capacity_usr_sap = 64 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_type_sapmnt = "pd-standard" + disk_volume_capacity_sapmnt = 50 + filesystem_sapmnt = "xfs" + nfs_boolean_sapmnt = false + + disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 0 // max of 1 + #disk_volume_type_swap = "pd-standard" + #disk_volume_capacity_swap = 10 + #filesystem_swap = "xfs" + + disk_volume_type_software = "pd-standard" + disk_volume_capacity_software = 100 + }, + + + + nw-ascs = { // Hostname + virtual_machine_profile = "n2-standard-32" // 32 vCPU, 128GB Memory + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 0 + + disk_volume_count_hana_log = 0 + + disk_volume_count_hana_shared = 0 + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 1 // max of 1 + disk_volume_type_usr_sap = "pd-standard" + disk_volume_capacity_usr_sap = 64 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_type_sapmnt = "pd-standard" + disk_volume_capacity_sapmnt = 56 + filesystem_sapmnt = "xfs" + nfs_boolean_sapmnt = true + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "pd-standard" + disk_volume_capacity_swap = 96 + filesystem_swap = "xfs" + + disk_volume_type_software = "pd-standard" + disk_volume_capacity_software = 100 + }, + + + + nw-pas = { // Hostname + virtual_machine_profile = "n2-standard-32" // 32 vCPU, 128GB Memory + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 0 + + disk_volume_count_hana_log = 0 + + disk_volume_count_hana_shared = 0 + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 1 // max of 1 + disk_volume_type_usr_sap = "pd-standard" + disk_volume_capacity_usr_sap = 64 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_type_sapmnt = "pd-standard" + disk_volume_capacity_sapmnt = 56 + filesystem_sapmnt = "xfs" + nfs_boolean_sapmnt = true + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "pd-standard" + disk_volume_capacity_swap = 96 + filesystem_swap = "xfs" + + disk_volume_type_software = "pd-standard" + disk_volume_capacity_software = 300 + }, + + + + nw-aas = { // Hostname + virtual_machine_profile = "n2-standard-32" // 32 vCPU, 128GB Memory + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 0 + + disk_volume_count_hana_log = 0 + + disk_volume_count_hana_shared = 0 + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 1 // max of 1 + disk_volume_type_usr_sap = "pd-standard" + disk_volume_capacity_usr_sap = 64 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_type_sapmnt = "pd-standard" + disk_volume_capacity_sapmnt = 56 + filesystem_sapmnt = "xfs" + nfs_boolean_sapmnt = true + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "pd-standard" + disk_volume_capacity_swap = 96 + filesystem_swap = "xfs" + + disk_volume_type_software = "pd-standard" + disk_volume_capacity_software = 100 + } + + } + + } + +} + + + + + + + diff --git a/sap_s4hana_distributed_install/gcp_ce_vm/variable_map_os.tf b/sap_s4hana_distributed_install/gcp_ce_vm/variable_map_os.tf new file mode 100644 index 0000000..954ecd3 --- /dev/null +++ b/sap_s4hana_distributed_install/gcp_ce_vm/variable_map_os.tf @@ -0,0 +1,79 @@ + +# There is no Terraform Resource for data lookup of all GCP OS Images, therefore the input does not use wildcard + +variable "map_os_image_regex" { + + description = "Map of operating systems OS Image, static OS Image names, to identify latest OS Image for the OS major.minor version" + + type = map(any) + + default = { + + rhel-8-latest = { + project = "rhel-cloud" + family = "rhel-8" + }, + + rhel-7-7-sap-ha = { + project = "rhel-sap-cloud" + family = "rhel-7-7-sap-ha" + }, + + rhel-7-9-sap-ha = { + project = "rhel-sap-cloud" + family = "rhel-7-9-sap-ha" + }, + + rhel-8-1-sap-ha = { + project = "rhel-sap-cloud" + family = "rhel-8-1-sap-ha" + }, + + rhel-8-2-sap-ha = { + project = "rhel-sap-cloud" + family = "rhel-8-2-sap-ha" + }, + + rhel-8-4-sap-ha = { + project = "rhel-sap-cloud" + family = "rhel-8-4-sap-ha" + }, + + rhel-8-6-sap-ha = { + project = "rhel-sap-cloud" + family = "rhel-8-6-sap-ha" + }, + + sles-15-latest = { + project = "suse-cloud" + family = "sles-15" + }, + + sles-12-sp5-sap = { + project = "suse-sap-cloud" + family = "sles-12-sp5-sap" + }, + + sles-15-sp1-sap = { + project = "suse-sap-cloud" + family = "sles-15-sp1-sap" + }, + + sles-15-sp2-sap = { + project = "suse-sap-cloud" + family = "sles-15-sp2-sap" + }, + + sles-15-sp3-sap = { + project = "suse-sap-cloud" + family = "sles-15-sp3-sap" + }, + + sles-15-sp4-sap = { + project = "suse-sap-cloud" + family = "sles-15-sp4-sap" + }, + + } + +} diff --git a/sap_s4hana_distributed_install/gcp_ce_vm/variables.tf b/sap_s4hana_distributed_install/gcp_ce_vm/variables.tf new file mode 100644 index 0000000..90a0d57 --- /dev/null +++ b/sap_s4hana_distributed_install/gcp_ce_vm/variables.tf @@ -0,0 +1,120 @@ + +variable "google_cloud_project" { + description = "Target GCP Project ID" +} + +variable "google_cloud_region_zone" { + description = "Target GCP Zone, the GCP Region will be calculated from this value (e.g. europe-west9-a)" +} + +variable "google_cloud_credentials_json" { + description = "Enter path to GCP Key File for Service Account (or Google Application Default Credentials JSON file for GCloud CLI)" +} + +variable "google_cloud_vpc_subnet_name" { + description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC" +} + +variable "resource_prefix" { + description = "Prefix to resource names" +} + +variable "dns_root_domain" { + description = "Root Domain for Private DNS used with the Virtual Machine" +} + +variable "bastion_os_image" { + description = "Bastion OS Image. This variable uses the locals mapping with regex of OS Images, and will alter bastion provisioning." +} + +variable "bastion_user" { + description = "OS User to create on Bastion host to avoid pass-through root user (e.g. bastionuser)" +} + +variable "bastion_ssh_port" { + type = number + description = "Bastion host SSH Port from IANA Dynamic Ports range (49152 to 65535)" + + validation { + condition = var.bastion_ssh_port > 49152 && var.bastion_ssh_port < 65535 + error_message = "Bastion host SSH Port must fall within IANA Dynamic Ports range (49152 to 65535)." + } +} + +variable "host_specification_plan" { + description = "Host specification plans are small_256gb. This variable uses the locals mapping with a nested list of host specifications, and will alter host provisioning." +} + +variable "host_os_image" { + description = "Host OS Image. This variable uses the locals mapping with regex of OS Images, and will alter host provisioning." +} + +variable "sap_software_download_directory" { + description = "Mount point for downloads of SAP Software" + + validation { + error_message = "Directory must start with forward slash." + condition = can(regex("^/", var.sap_software_download_directory)) + } + +} + + + +variable "sap_id_user" { + description = "Ansible - Please enter your SAP ID user (e.g. S-User)" +} + +variable "sap_id_user_password" { + description = "Ansible - Please enter your SAP ID password" +} + +variable "sap_hana_install_master_password" { + description = "Ansible - SAP HANA install: set common initial password (e.g. NewPass$321)" +} + +variable "sap_hana_install_sid" { + description = "Ansible - SAP HANA install: System ID (e.g. H01)" +} + +variable "sap_hana_install_instance_number" { + description = "Ansible - SAP HANA install: Instance Number (e.g. 90)" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_hana_install_instance_number)) + } + +} + +variable "sap_s4hana_install_sid" { + description = "Ansible - SAP S/4HANA install: System ID (e.g. S01)" +} + +variable "sap_maintenance_planner_transaction_name" { + description = "Ansible - SAP Maintenance Planner Transaction name for SAP S/4HANA, required to perform download of this stack" +} + +variable "sap_swpm_template_selected" { + description = "Ansible - Select template to use: sap_s4hana_2021_distributed, sap_s4hana_2022_distributed" +} + +variable "sap_nwas_abap_ascs_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - ABAP Central Services (ASCS) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_ascs_instance_no)) + } + +} + +variable "sap_nwas_abap_pas_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - Primary Application Server instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_pas_instance_no)) + } + +} diff --git a/sap_s4hana_distributed_install/gcp_ce_vm/variables_generic_for_cli.tfvars b/sap_s4hana_distributed_install/gcp_ce_vm/variables_generic_for_cli.tfvars new file mode 100644 index 0000000..80544ca --- /dev/null +++ b/sap_s4hana_distributed_install/gcp_ce_vm/variables_generic_for_cli.tfvars @@ -0,0 +1,28 @@ + +resource_prefix = "sap" + +dns_root_domain = "poc.cloud" + +bastion_os_image = "rhel-8-latest" + +bastion_user = "bastionuser" + +bastion_ssh_port = 50222 + +host_specification_plan = "small_256gb" + +host_os_image = "rhel-8-4-sap-ha" + +sap_hana_install_master_password = "NewPass$321" + +sap_hana_install_sid = "H01" + +sap_hana_install_instance_number = "90" + +sap_nwas_abap_ascs_instance_no = "01" + +sap_nwas_abap_pas_instance_no = "00" + +sap_s4hana_install_sid = "S01" + +sap_software_download_directory = "/software" diff --git a/sap_s4hana_distributed_install/gcp_ce_vm/versions.tf b/sap_s4hana_distributed_install/gcp_ce_vm/versions.tf new file mode 100644 index 0000000..346ab78 --- /dev/null +++ b/sap_s4hana_distributed_install/gcp_ce_vm/versions.tf @@ -0,0 +1,34 @@ +# Terraform declaration + +terraform { + required_version = ">= 1.0" + required_providers { + google = { + #source = "localdomain/provider/google" // Local, on macOS path to place files would be $HOME/.terraform.d/plugins/localdomain/provider/google/1.xx.xx/darwin_amd6 + source = "hashicorp/google" // Terraform Registry + version = ">=4.50.0" + } + } +} + +# Terraform Provider declaration +# +# Nested provider configurations cannot be used with depends_on meta-argument between modules +# +# The calling module block can use either: +# - "providers" argument in the module block +# - none, inherit default (un-aliased) provider configuration +# +# Therefore the below is blank and is only for reference if this module needs to be executed manually + + +# Terraform Provider declaration + +provider "google" { + project = var.google_cloud_project + region = local.google_cloud_region + zone = var.google_cloud_region_zone + + credentials = var.google_cloud_credentials_json + +} diff --git a/sap_s4hana_distributed_install/ibmcloud_vs/main.tf b/sap_s4hana_distributed_install/ibmcloud_vs/main.tf new file mode 100644 index 0000000..c9c19df --- /dev/null +++ b/sap_s4hana_distributed_install/ibmcloud_vs/main.tf @@ -0,0 +1,346 @@ + +module "run_ansible_dry_run" { + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_s4hana_distributed_install_maintplan?ref=main" + + module_var_dry_run_test = "x86_64" // x86_64 or ppc64le + + # Terraform Module Variables which are mandatory, all with an empty string + module_var_bastion_boolean = false + module_var_bastion_user = "" + module_var_bastion_ssh_port = 0 + module_var_bastion_private_ssh_key = "" + module_var_bastion_floating_ip = "" + module_var_host_private_ssh_key = "" + module_var_host_private_ip = "" + module_var_hostname = "software_media_dry_run" + module_var_dns_root_domain_name = "" + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + module_var_sap_swpm_sid = "" + module_var_sap_swpm_db_schema_abap = "" + module_var_sap_swpm_db_schema_abap_password = "" + module_var_sap_swpm_ddic_000_password = "" + module_var_sap_swpm_template_selected = var.sap_swpm_template_selected + module_var_sap_maintenance_planner_transaction_name = var.sap_maintenance_planner_transaction_name + +} + + +module "run_account_init_module" { + + depends_on = [ + module.run_ansible_dry_run + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_init?ref=dev" + + module_var_resource_group_name = local.resource_group_create_boolean ? 0 : var.ibmcloud_resource_group + module_var_resource_group_create_boolean = local.resource_group_create_boolean + + module_var_resource_prefix = var.resource_prefix + + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? 0 : var.ibmcloud_vpc_subnet_name + module_var_ibmcloud_vpc_subnet_create_boolean = local.ibmcloud_vpc_subnet_create_boolean + module_var_ibmcloud_vpc_availability_zone = var.ibmcloud_vpc_availability_zone + +} + + +module "run_account_bootstrap_module" { + + depends_on = [ + module.run_account_init_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_bootstrap?ref=dev" + + module_var_resource_group_id = module.run_account_init_module.output_resource_group_id + module_var_resource_prefix = var.resource_prefix + + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name + module_var_ibmcloud_vpc_availability_zone = var.ibmcloud_vpc_availability_zone + + module_var_dns_root_domain_name = var.dns_root_domain + +} + + +module "run_account_iam_module" { + + depends_on = [ + module.run_account_bootstrap_module + ] + + count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=dev" + + module_var_resource_group_id = module.run_account_init_module.output_resource_group_id + module_var_resource_prefix = var.resource_prefix + +} + + +module "run_bastion_inject_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/bastion_inject?ref=dev" + + module_var_resource_group_id = module.run_account_init_module.output_resource_group_id + module_var_resource_prefix = var.resource_prefix + module_var_resource_tags = var.resource_tags + + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_ssh_key_id = module.run_account_bootstrap_module.output_bastion_ssh_key_id + module_var_bastion_public_ssh_key = module.run_account_bootstrap_module.output_bastion_public_ssh_key + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_os_image = var.map_os_image_regex[var.bastion_os_image] + +} + + +module "run_host_network_access_sap_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_network_access_sap?ref=dev" + + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name + module_var_host_security_group_id = module.run_account_bootstrap_module.output_host_security_group_id + + module_var_sap_nwas_abap_pas_instance_no = var.sap_nwas_abap_pas_instance_no + module_var_sap_hana_instance_no = var.sap_hana_install_instance_number + +} + + +module "run_host_network_access_sap_public_via_proxy_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_network_access_sap_public_via_proxy?ref=dev" + + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name + + module_var_bastion_security_group_id = module.run_bastion_inject_module.output_bastion_security_group_id + module_var_bastion_connection_security_group_id = module.run_bastion_inject_module.output_bastion_connection_security_group_id + module_var_host_security_group_id = module.run_account_bootstrap_module.output_host_security_group_id + + module_var_sap_nwas_abap_pas_instance_no = var.sap_nwas_abap_pas_instance_no + module_var_sap_hana_instance_no = var.sap_hana_install_instance_number + +} + + +module "run_host_nfs_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_nfs?ref=main" + + module_var_resource_prefix = var.resource_prefix + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name + module_var_host_security_group_id = module.run_account_bootstrap_module.output_host_security_group_id + module_var_nfs_boolean_sapmnt = contains([for host in var.map_host_specifications[var.host_specification_plan] : host.nfs_boolean_sapmnt],true) + +} + + +module "run_host_provision_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_provision?ref=main" + + # Set Terraform Module Variables using Terraform Variables at runtime + + module_var_resource_group_id = module.run_account_init_module.output_resource_group_id + module_var_resource_prefix = var.resource_prefix + module_var_resource_tags = var.resource_tags + + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_floating_ip = module.run_bastion_inject_module.output_bastion_ip + module_var_bastion_connection_security_group_id = module.run_bastion_inject_module.output_bastion_connection_security_group_id + + module_var_host_ssh_key_id = module.run_account_bootstrap_module.output_host_ssh_key_id + module_var_host_private_ssh_key = module.run_account_bootstrap_module.output_host_private_ssh_key + module_var_host_security_group_id = module.run_account_bootstrap_module.output_host_security_group_id + + module_var_host_os_image = var.map_os_image_regex[var.host_os_image] + + module_var_dns_root_domain_name = var.dns_root_domain + module_var_dns_services_instance = module.run_account_bootstrap_module.output_host_dns_services_instance + + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable with nested objects + + for_each = toset([ + for key, value in var.map_host_specifications[var.host_specification_plan] : key + ]) + + module_var_virtual_server_hostname = each.key + + module_var_virtual_server_profile = var.map_host_specifications[var.host_specification_plan][each.key].virtual_server_profile + + module_var_disk_volume_count_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data + module_var_disk_volume_type_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data + module_var_disk_volume_capacity_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_data + module_var_disk_volume_iops_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_data : null + module_var_lvm_enable_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data + module_var_lvm_pv_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_data : 0 + module_var_lvm_vg_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_data : 0 + module_var_lvm_vg_physical_extent_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_data : 0 + module_var_lvm_lv_stripe_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_data : 0 + module_var_filesystem_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_data + module_var_physical_partition_filesystem_block_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_data + + module_var_disk_volume_count_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log + module_var_disk_volume_type_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log + module_var_disk_volume_capacity_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_log + module_var_disk_volume_iops_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_log : null + module_var_lvm_enable_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log + module_var_lvm_pv_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_log : 0 + module_var_lvm_vg_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_log : 0 + module_var_lvm_vg_physical_extent_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_log : 0 + module_var_lvm_lv_stripe_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_log : 0 + module_var_filesystem_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_log + module_var_physical_partition_filesystem_block_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_log + + module_var_disk_volume_count_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared + module_var_disk_volume_type_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared + module_var_disk_volume_capacity_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_shared + module_var_disk_volume_iops_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_shared : null + module_var_lvm_enable_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared + module_var_lvm_pv_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_shared : 0 + module_var_lvm_vg_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_shared : 0 + module_var_lvm_vg_physical_extent_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_shared : 0 + module_var_lvm_lv_stripe_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_shared : 0 + module_var_filesystem_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_shared + module_var_physical_partition_filesystem_block_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_shared + + module_var_disk_volume_count_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb + module_var_disk_volume_type_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb + module_var_disk_volume_capacity_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_anydb + module_var_disk_volume_iops_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_anydb : null + module_var_lvm_enable_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb + module_var_lvm_pv_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_anydb : 0 + module_var_lvm_vg_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_anydb : 0 + module_var_lvm_vg_physical_extent_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_anydb : 0 + module_var_lvm_lv_stripe_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_anydb : 0 + module_var_filesystem_mount_path_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_mount_path_anydb + module_var_filesystem_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_anydb + module_var_physical_partition_filesystem_block_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_anydb + + module_var_disk_volume_count_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_usr_sap + module_var_disk_volume_type_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_usr_sap + module_var_disk_volume_capacity_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_usr_sap + module_var_filesystem_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_usr_sap + + module_var_disk_volume_count_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_sapmnt + module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt + module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt + module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].nfs_boolean_sapmnt + module_var_nfs_fqdn_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].nfs_boolean_sapmnt ? module.run_host_nfs_module.output_nfs_fqdn : "" + + module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb + module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap + module_var_disk_volume_type_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_swap : 0 + module_var_disk_volume_capacity_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_swap : 0 + module_var_filesystem_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].filesystem_swap : 0 + + module_var_disk_volume_type_software = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_software + module_var_disk_volume_capacity_software = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_software + module_var_sap_software_download_directory = var.sap_software_download_directory + + module_var_disable_ip_anti_spoofing = true + +} + + +module "run_ansible_sap_s4hana_distributed_install_maintplan" { + + depends_on = [module.run_host_provision_module] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_s4hana_distributed_install_maintplan?ref=main" + + # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) + module_var_bastion_boolean = true // required as true boolean for any Cloud Service Provider (CSP) + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_floating_ip = module.run_bastion_inject_module.output_bastion_ip + + module_var_host_private_ssh_key = module.run_account_bootstrap_module.output_host_private_ssh_key + + + module_var_dns_root_domain_name = var.dns_root_domain + +# module_var_inventory_hana_primary = module.run_host_provision_module["hana-p"].output_host_private_ip +# module_var_inventory_nwas_ascs = module.run_host_provision_module["nw-ascs"].output_host_private_ip +# module_var_inventory_nwas_pas = module.run_host_provision_module["nw-pas"].output_host_private_ip +# module_var_inventory_nwas_aas = join("\n", flatten([module.run_host_provision_module["nw-aas"].output_host_private_ip])) + + module_var_inventory_hana_primary = "${module.run_host_provision_module["hana-p"].output_host_name} ansible_host=${module.run_host_provision_module["hana-p"].output_host_private_ip}" + module_var_inventory_nwas_ascs = "${module.run_host_provision_module["nw-ascs"].output_host_name} ansible_host=${module.run_host_provision_module["nw-ascs"].output_host_private_ip}" + module_var_inventory_nwas_pas = "${module.run_host_provision_module["nw-pas"].output_host_name} ansible_host=${module.run_host_provision_module["nw-pas"].output_host_private_ip}" + module_var_inventory_nwas_aas = "${module.run_host_provision_module["nw-aas"].output_host_name} ansible_host=${module.run_host_provision_module["nw-aas"].output_host_private_ip}" + + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + + module_var_sap_hana_install_master_password = var.sap_hana_install_master_password + module_var_sap_hana_install_sid = var.sap_hana_install_sid + module_var_sap_hana_install_instance_number = var.sap_hana_install_instance_number + + module_var_sap_swpm_sid = var.sap_s4hana_install_sid + + module_var_sap_swpm_db_schema_abap = "SAPHANADB" + module_var_sap_swpm_db_schema_abap_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_system_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_systemdb_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_sidadm_password = var.sap_hana_install_master_password + module_var_sap_swpm_ddic_000_password = var.sap_hana_install_master_password + module_var_sap_swpm_pas_instance_nr = var.sap_nwas_abap_pas_instance_no + module_var_sap_swpm_ascs_instance_nr = var.sap_nwas_abap_ascs_instance_no + + module_var_sap_swpm_master_password = var.sap_hana_install_master_password + + module_var_sap_maintenance_planner_transaction_name = var.sap_maintenance_planner_transaction_name + + module_var_sap_swpm_template_selected = var.sap_swpm_template_selected + + module_var_sap_software_download_directory = var.sap_software_download_directory + +} diff --git a/sap_s4hana_distributed_install/ibmcloud_vs/outputs.tf b/sap_s4hana_distributed_install/ibmcloud_vs/outputs.tf new file mode 100644 index 0000000..f4f4d5f --- /dev/null +++ b/sap_s4hana_distributed_install/ibmcloud_vs/outputs.tf @@ -0,0 +1,235 @@ + +############################################################## +# Export SSH key to file on local +############################################################## + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "bastion_rsa" { + content = module.run_account_bootstrap_module.output_bastion_private_ssh_key + filename = "${path.root}/ssh/bastion_rsa" + file_permission = "0400" +} + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "hosts_rsa" { + content = module.run_account_bootstrap_module.output_host_private_ssh_key + filename = "${path.root}/ssh/hosts_rsa" + file_permission = "0400" +} + + +output "ssh_sap_connection_details" { + value = local.is_wsl ? "IGNORE" : <>> Chosen option $REPLY: $opt" + select opt_ip in "$${target_host_array[@]}"; do + if [ $opt_ip = "Quit" ]; then break 2; fi + target_ip=$opt_ip + echo "---- Selected option $REPLY, tunneling into $target_ip ----" + break + done + echo "" + echo "#### For SAP HANA Studio, use Add System with host name as localhost; do not add port numbers." + echo "#### If selecting 'Connect using SSL' on Connection Properties, then on Additional Properties (final) screen deselect 'Validate the SSL certificate'" + echo "" + echo "#### For SAPGUI, use expert mode SAP Logon String as: ####" + echo "conn=/H/localhost/S/32$sap_nwas_abap_pas_instance_no&expert=true" + echo "" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N \ + $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file \ + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -L localhost:32$sap_nwas_abap_pas_instance_no:$target_ip:32$sap_nwas_abap_pas_instance_no \ + -L localhost:33$sap_nwas_abap_pas_instance_no:$target_ip:33$sap_nwas_abap_pas_instance_no \ + -L localhost:3$${sap_hana_instance_no}13:$target_ip:3$${sap_hana_instance_no}13 \ + -L localhost:3$${sap_hana_instance_no}15:$target_ip:3$${sap_hana_instance_no}15 \ + -L localhost:3$${sap_hana_instance_no}41:$target_ip:3$${sap_hana_instance_no}41 \ + -L localhost:443$sap_hana_instance_no:$target_ip:443$sap_hana_instance_no \ + -L localhost:443$sap_nwas_abap_pas_instance_no:$target_ip:443$sap_nwas_abap_pas_instance_no \ + -L localhost:5$${sap_hana_instance_no}13:$target_ip:5$${sap_hana_instance_no}13 \ + -L localhost:5$${sap_hana_instance_no}14:$target_ip:5$${sap_hana_instance_no}14 + break + ;; + "OS root access, via SSH stdin/stdout forwarding proxy") + echo ">>> Chosen option $REPLY: $opt" + select opt_ssh in "$${target_host_array[@]}"; do + if [ $opt_ssh = "Quit" ]; then break 2; fi + target_ip=$opt_ssh + echo "---- Selected option $REPLY, logging into $target_ip ----" + break + done + + if [ -n "$target_ip" ]; then + ssh -i $target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + fi + break + ;; + "Quit") + break + ;; + *) echo "Invalid option $REPLY" ;; + esac + done +} + +# Then call shell function and select which target +sshjump + +EOF +} + + +# If detected Windows WSL2, then find the installed name using external resource to return a JSON string +data "external" "wsl_distro_name" { + count = local.is_wsl ? 1 : 0 + program = ["bash", "-c", "echo \"{\\\"stdout\\\":\\\"$(echo $WSL_DISTRO_NAME)\\\"}\""] +} + +output "ssh_sap_connection_details_windows" { + value = local.not_wsl ? "IGNORE" : <>> Chosen option $(PSItem)" + echo "" + echo "#### For SAP HANA Studio, use Add System with host name as localhost; do not add port numbers." + echo "#### If selecting 'Connect using SSL' on Connection Properties, then on Additional Properties (final) screen deselect 'Validate the SSL certificate'" + echo "" + echo "#### For SAPGUI, use expert mode SAP Logon String as: ####" + echo "conn=/H/localhost/S/32$sap_nwas_abap_pas_instance_no&expert=true" + echo "" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N ` + $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -L localhost:32$${sap_nwas_abap_pas_instance_no}:$${target_ip}:32$${sap_nwas_abap_pas_instance_no} ` + -L localhost:33$${sap_nwas_abap_pas_instance_no}:$${target_ip}:33$${sap_nwas_abap_pas_instance_no} ` + -L localhost:3$${sap_hana_instance_no}13:$${target_ip}:3$${sap_hana_instance_no}13 ` + -L localhost:3$${sap_hana_instance_no}15:$${target_ip}:3$${sap_hana_instance_no}15 ` + -L localhost:3$${sap_hana_instance_no}41:$${target_ip}:3$${sap_hana_instance_no}41 ` + -L localhost:443$${sap_hana_instance_no}:$${target_ip}:443$${sap_hana_instance_no} ` + -L localhost:443$${sap_nwas_abap_pas_instance_no}:$${target_ip}:443$${sap_nwas_abap_pas_instance_no} ` + -L localhost:5$${sap_hana_instance_no}13:$${target_ip}:5$${sap_hana_instance_no}13 ` + -L localhost:5$${sap_hana_instance_no}14:$${target_ip}:5$${sap_hana_instance_no}14 + } + } + 2 { + foreach ($target_host in $target_host_array) { + $i=$target_host_array.IndexOf($target_host) + echo "$i) $target_host" + } + $target_host_selection = Read-Host "Please make a selection" + if ($target_host_array[$target_host_selection] -eq "Quit" ){ + break + }else { + $target_ip = $target_host_array[$target_host_selection] + #echo ">>> Chosen option $(PSItem)" + ssh -i $temp_target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + } + } + 3 { + break + } + } +} + +EOF + +} diff --git a/sap_s4hana_distributed_install/ibmcloud_vs/variable_locals.tf b/sap_s4hana_distributed_install/ibmcloud_vs/variable_locals.tf new file mode 100644 index 0000000..7c05148 --- /dev/null +++ b/sap_s4hana_distributed_install/ibmcloud_vs/variable_locals.tf @@ -0,0 +1,28 @@ +locals { + + resource_group_create_boolean = var.ibmcloud_resource_group == "new" ? true : false + + ibmcloud_vpc_subnet_create_boolean = var.ibmcloud_vpc_subnet_name == "new" ? true : false + + ibmcloud_vpc_subnet_name_entry_is_ip = ( + can( + regex("^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)([/][0-3][0-2]?|[/][1-2][0-9]|[/][0-9])$", + var.ibmcloud_vpc_subnet_name + ) + ) ? true : false) + + ibmcloud_region = replace(var.ibmcloud_vpc_availability_zone, "/-[^-]*$/", "") + + # Directories start with "C:..." on Windows; All other OSs use "/" for root. + detect_windows = substr(pathexpand("~"), 0, 1) == "/" ? false : true + detect_shell = substr(pathexpand("~"), 0, 1) == "/" ? true : false + + # Used for displaying Shell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + not_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? false : true : true + + # Used for displaying Windows PowerShell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + is_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? true : false : false + +} diff --git a/sap_s4hana_distributed_install/ibmcloud_vs/variable_map_hosts.tf b/sap_s4hana_distributed_install/ibmcloud_vs/variable_map_hosts.tf new file mode 100644 index 0000000..487f09b --- /dev/null +++ b/sap_s4hana_distributed_install/ibmcloud_vs/variable_map_hosts.tf @@ -0,0 +1,184 @@ + +variable "map_host_specifications" { + + description = "Map of host specficiations for SAP S/4HANA distributed install" + + type = map(any) + + default = { + + small_256gb = { + + hana-p = { + virtual_server_profile = "mx2-32x256" + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 3 + disk_volume_type_hana_data = "10iops-tier" + disk_volume_capacity_hana_data = 128 + #disk_volume_iops_hana_data = + lvm_enable_hana_data = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_hana_data = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_hana_data = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_hana_data = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_hana_data = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_data = "xfs" + #physical_partition_filesystem_block_size_hana_data = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_hana_log = 3 + disk_volume_type_hana_log = "10iops-tier" + disk_volume_capacity_hana_log = 48 + #disk_volume_iops_hana_log = + lvm_enable_hana_log = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_hana_log = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_hana_log = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_hana_log = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_hana_log = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_log = "xfs" + #physical_partition_filesystem_block_size_hana_log = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_hana_shared = 1 + disk_volume_type_hana_shared = "10iops-tier" // Does NOT use Burst IOPS storage. Approx same cost as 1TB at lower IOPS Tiers, use lower capacity and increase to 10IOPS/GB to ensure quicker DB Backup Restore from /hana/shared//HDB/backup/data/DB_ + disk_volume_capacity_hana_shared = 320 + #disk_volume_iops_hana_shared = + lvm_enable_hana_shared = false // if false, then disk volume count should be 1 + #lvm_pv_data_alignment_hana_shared = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + #lvm_vg_data_alignment_hana_shared = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + #lvm_vg_physical_extent_size_hana_shared = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + #lvm_lv_stripe_size_hana_shared = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_shared = "xfs" + physical_partition_filesystem_block_size_hana_shared = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 0 // max of 1 + disk_volume_type_usr_sap = "general-purpose" + disk_volume_capacity_usr_sap = 64 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_type_sapmnt = "general-purpose" + disk_volume_capacity_sapmnt = 50 + filesystem_sapmnt = "xfs" + nfs_boolean_sapmnt = false + + disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 0 // max of 1 + #disk_volume_type_swap = "5iops-tier" + #disk_volume_capacity_swap = 10 + #filesystem_swap = "xfs" + + disk_volume_type_software = "5iops-tier" + disk_volume_capacity_software = 100 + } + + + nw-ascs = { + virtual_server_profile = "bx2-16x64" + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 0 + + disk_volume_count_hana_log = 0 + + disk_volume_count_hana_shared = 0 + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 1 // max of 1 + disk_volume_type_usr_sap = "general-purpose" + disk_volume_capacity_usr_sap = 64 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 1 // max of 1 + disk_volume_type_sapmnt = "general-purpose" + disk_volume_capacity_sapmnt = 56 + filesystem_sapmnt = "xfs" + nfs_boolean_sapmnt = true + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "general-purpose" + disk_volume_capacity_swap = 96 + filesystem_swap = "xfs" + + disk_volume_type_software = "5iops-tier" + disk_volume_capacity_software = 100 + }, + + + nw-pas = { + virtual_server_profile = "bx2-16x64" + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 0 + + disk_volume_count_hana_log = 0 + + disk_volume_count_hana_shared = 0 + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 1 // max of 1 + disk_volume_type_usr_sap = "general-purpose" + disk_volume_capacity_usr_sap = 64 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 1 // max of 1 + disk_volume_type_sapmnt = "general-purpose" + disk_volume_capacity_sapmnt = 56 + filesystem_sapmnt = "xfs" + nfs_boolean_sapmnt = true + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "general-purpose" + disk_volume_capacity_swap = 96 + filesystem_swap = "xfs" + + disk_volume_type_software = "5iops-tier" + disk_volume_capacity_software = 304 + }, + + + nw-aas = { + virtual_server_profile = "bx2-16x64" + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 0 + + disk_volume_count_hana_log = 0 + + disk_volume_count_hana_shared = 0 + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 1 // max of 1 + disk_volume_type_usr_sap = "general-purpose" + disk_volume_capacity_usr_sap = 64 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 1 // max of 1 + disk_volume_type_sapmnt = "general-purpose" + disk_volume_capacity_sapmnt = 56 + filesystem_sapmnt = "xfs" + nfs_boolean_sapmnt = true + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "general-purpose" + disk_volume_capacity_swap = 96 + filesystem_swap = "xfs" + + disk_volume_type_software = "5iops-tier" + disk_volume_capacity_software = 100 + } + + } + + } +} diff --git a/sap_s4hana_distributed_install/ibmcloud_vs/variable_map_os.tf b/sap_s4hana_distributed_install/ibmcloud_vs/variable_map_os.tf new file mode 100644 index 0000000..16cfc85 --- /dev/null +++ b/sap_s4hana_distributed_install/ibmcloud_vs/variable_map_os.tf @@ -0,0 +1,42 @@ + +variable "map_os_image_regex" { + + description = "Map of operating systems OS Image regex, to identify latest OS Image for the OS major.minor version" + + type = map(any) + + default = { + + rhel-7-6-sap-ha = ".*redhat.*7-6.*amd64.*hana.*" + + rhel-8-1-sap-ha = ".*redhat.*8-1.*amd64.*hana.*" + + rhel-8-2-sap-ha = ".*redhat.*8-2.*amd64.*hana.*" + + rhel-8-4-sap-ha = ".*redhat.*8-4.*amd64.*hana.*" + + rhel-7-6-sap-applications = ".*redhat.*7-6.*amd64.*applications.*" + + rhel-8-1-sap-applications = ".*redhat.*8-1.*amd64.*applications.*" + + rhel-8-2-sap-applications = ".*redhat.*8-2.*amd64.*applications.*" + + rhel-8-4-sap-applications = ".*redhat.*8-4.*amd64.*applications.*" + + rhel-8-4 = ".*redhat.*8-4.*minimal.*amd64.*" + + sles-12-4-sap-ha = ".*sles.*12-4.*amd64.*hana.*" + + sles-15-1-sap-ha = ".*sles.*15-1.*amd64.*hana.*" + + sles-15-2-sap-ha = ".*sles.*15-2.*amd64.*hana.*" + + sles-12-4-sap-applications = ".*sles.*12-4.*amd64.*applications.*" + + sles-15-1-sap-applications = ".*sles.*15-1.*amd64.*applications.*" + + sles-15-2-sap-applications = ".*sles.*15-2.*amd64.*applications.*" + + } + +} diff --git a/sap_s4hana_distributed_install/ibmcloud_vs/variables.tf b/sap_s4hana_distributed_install/ibmcloud_vs/variables.tf new file mode 100644 index 0000000..13c66de --- /dev/null +++ b/sap_s4hana_distributed_install/ibmcloud_vs/variables.tf @@ -0,0 +1,129 @@ + +variable "ibmcloud_api_key" { + description = "Enter your IBM Cloud API Key" +} + +variable "resource_tags" { + type = list(string) + description = "Tags applied to each resource created" +} + +variable "resource_prefix" { + description = "Prefix to resource names" +} + +variable "ibmcloud_resource_group" { + description = "Enter existing/target Resource Group name, or enter 'new' to create a Resource Group using the defined prefix for all resources" +} + +variable "ibmcloud_vpc_availability_zone" { + description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" +} + +variable "ibmcloud_iam_yesno" { + description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +} + +variable "ibmcloud_vpc_subnet_name" { + description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range" +} + +variable "dns_root_domain" { + description = "Root Domain for Private DNS used with the Virtual Server" +} + +variable "bastion_os_image" { + description = "Bastion OS Image. This variable uses the locals mapping with regex of OS Images, and will alter bastion provisioning." +} + +variable "bastion_user" { + description = "OS User to create on Bastion host to avoid pass-through root user (e.g. bastionuser)" +} + +variable "bastion_ssh_port" { + type = number + description = "Bastion host SSH Port from IANA Dynamic Ports range (49152 to 65535)" + + #validation { + # condition = var.bastion_ssh_port > 49152 && var.bastion_ssh_port < 65535 + # error_message = "Bastion host SSH Port must fall within IANA Dynamic Ports range (49152 to 65535)." + #} +} + +variable "host_specification_plan" { + description = "Host specification plans are small_256gb. This variable uses the locals mapping with a nested list of host specifications, and will alter host provisioning." +} + +variable "host_os_image" { + description = "Host OS Image. This variable uses the locals mapping with regex of OS Images, and will alter host provisioning." +} + +variable "sap_software_download_directory" { + description = "Mount point for downloads of SAP Software" + + validation { + error_message = "Directory must start with forward slash." + condition = can(regex("^/", var.sap_software_download_directory)) + } + +} + + + +variable "sap_id_user" { + description = "Ansible - Please enter your SAP ID user (e.g. S-User)" +} + +variable "sap_id_user_password" { + description = "Ansible - Please enter your SAP ID password" +} + +variable "sap_hana_install_master_password" { + description = "Ansible - SAP HANA install: set common initial password (e.g. NewPass$321)" +} + +variable "sap_hana_install_sid" { + description = "Ansible - SAP HANA install: System ID (e.g. H01)" +} + +variable "sap_hana_install_instance_number" { + description = "Ansible - SAP HANA install: Instance Number (e.g. 90)" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_hana_install_instance_number)) + } + +} + +variable "sap_s4hana_install_sid" { + description = "Ansible - SAP S/4HANA install: System ID (e.g. S01)" +} + +variable "sap_maintenance_planner_transaction_name" { + description = "Ansible - SAP Maintenance Planner Transaction name for SAP S/4HANA, required to perform download of this stack" +} + +variable "sap_swpm_template_selected" { + description = "Ansible - Select template to use: sap_s4hana_2021_distributed, sap_s4hana_2022_distributed" +} + +variable "sap_nwas_abap_ascs_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - ABAP Central Services (ASCS) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_ascs_instance_no)) + } + +} + +variable "sap_nwas_abap_pas_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - Primary Application Server instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_pas_instance_no)) + } + +} diff --git a/sap_s4hana_distributed_install/ibmcloud_vs/variables_generic_for_cli.tfvars b/sap_s4hana_distributed_install/ibmcloud_vs/variables_generic_for_cli.tfvars new file mode 100644 index 0000000..14d95cc --- /dev/null +++ b/sap_s4hana_distributed_install/ibmcloud_vs/variables_generic_for_cli.tfvars @@ -0,0 +1,29 @@ +resource_tags = ["sap", "saps4hana"] + +resource_prefix = "sap" + +dns_root_domain = "poc.cloud" + +bastion_os_image = "rhel-8-4" + +bastion_user = "bastionuser" + +bastion_ssh_port = 50222 + +host_specification_plan = "small_256gb" + +host_os_image = "rhel-8-4-sap-ha" + +sap_hana_install_master_password = "NewPass$321" + +sap_hana_install_sid = "H01" + +sap_hana_install_instance_number = "90" + +sap_nwas_abap_ascs_instance_no = "01" + +sap_nwas_abap_pas_instance_no = "00" + +sap_s4hana_install_sid = "S01" + +sap_software_download_directory = "/software" diff --git a/sap_s4hana_distributed_install/ibmcloud_vs/versions.tf b/sap_s4hana_distributed_install/ibmcloud_vs/versions.tf new file mode 100644 index 0000000..5c37836 --- /dev/null +++ b/sap_s4hana_distributed_install/ibmcloud_vs/versions.tf @@ -0,0 +1,32 @@ +# Terraform declaration + +terraform { + required_version = ">= 1.0" + required_providers { + ibm = { + #source = "localdomain/provider/ibm" // Local, on macOS path to place files would be $HOME/.terraform.d/plugins/localdomain/provider/ibm/1.xx.xx/darwin_amd6 + source = "IBM-Cloud/ibm" // Terraform Registry + version = ">=1.35.0" + } + } +} + + +# Terraform Provider declaration + +provider "ibm" { + + # Define Provider inputs manually + # ibmcloud_api_key = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + + # Define Provider inputs from given Terraform Variables + ibmcloud_api_key = var.ibmcloud_api_key + + # If using IBM Cloud Automation Manager, the Provider declaration values are populated automatically + # from the Cloud Connection credentials (by using Environment Variables) + + # If using IBM Cloud Schematics, the Provider declaration values are populated automatically + + region = local.ibmcloud_region + +} diff --git a/sap_s4hana_distributed_install/msazure_vm/main.tf b/sap_s4hana_distributed_install/msazure_vm/main.tf new file mode 100644 index 0000000..37abff8 --- /dev/null +++ b/sap_s4hana_distributed_install/msazure_vm/main.tf @@ -0,0 +1,375 @@ + +module "run_ansible_dry_run" { + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_s4hana_distributed_install_maintplan?ref=main" + + module_var_dry_run_test = "x86_64" // x86_64 or ppc64le + + # Terraform Module Variables which are mandatory, all with an empty string + module_var_bastion_boolean = false + module_var_bastion_user = "" + module_var_bastion_ssh_port = 0 + module_var_bastion_private_ssh_key = "" + module_var_bastion_floating_ip = "" + module_var_host_private_ssh_key = "" + module_var_host_private_ip = "" + module_var_hostname = "software_media_dry_run" + module_var_dns_root_domain_name = "" + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + module_var_sap_swpm_sid = "" + module_var_sap_swpm_db_schema_abap = "" + module_var_sap_swpm_db_schema_abap_password = "" + module_var_sap_swpm_ddic_000_password = "" + module_var_sap_swpm_template_selected = var.sap_swpm_template_selected + module_var_sap_maintenance_planner_transaction_name = var.sap_maintenance_planner_transaction_name + +} + + +module "run_account_init_module" { + + depends_on = [ + module.run_ansible_dry_run + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/account_init?ref=main" + + module_var_az_resource_group_name = local.resource_group_create_boolean ? 0 : var.az_resource_group_name + module_var_az_resource_group_create_boolean = local.resource_group_create_boolean + + module_var_resource_prefix = var.resource_prefix + + module_var_az_location_region = var.az_location_region + module_var_az_location_availability_zone_no = var.az_location_availability_zone_no + + module_var_az_vnet_name = local.az_vnet_name_create_boolean ? 0 : var.az_vnet_name + module_var_az_vnet_name_create_boolean = local.az_vnet_name_create_boolean + + module_var_az_vnet_subnet_name = local.az_vnet_subnet_name_create_boolean ? 0 : var.az_vnet_subnet_name + module_var_az_vnet_subnet_name_create_boolean = local.az_vnet_subnet_name_create_boolean + +} + + +module "run_account_bootstrap_module" { + + depends_on = [ + module.run_account_init_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/account_bootstrap?ref=dev" + + module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name + module_var_resource_prefix = var.resource_prefix + + module_var_az_location_region = var.az_location_region + module_var_az_location_availability_zone_no = var.az_location_availability_zone_no + + module_var_az_vnet_name = module.run_account_init_module.output_vnet_name + module_var_az_vnet_subnet_name = module.run_account_init_module.output_vnet_subnet_name + + module_var_dns_root_domain_name = var.dns_root_domain +} + + +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.az_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/account_iam?ref=main" +# +# module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name +# module_var_resource_prefix = var.resource_prefix +# +#} + + +module "run_bastion_inject_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/bastion_inject?ref=main" + + module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name + module_var_resource_prefix = var.resource_prefix + + module_var_az_location_region = var.az_location_region + module_var_az_location_availability_zone_no = var.az_location_availability_zone_no + + module_var_az_vnet_name = module.run_account_init_module.output_vnet_name + module_var_az_vnet_subnet_name = module.run_account_init_module.output_vnet_subnet_name + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_ssh_key_id = module.run_account_bootstrap_module.output_bastion_ssh_key_id + module_var_bastion_public_ssh_key = module.run_account_bootstrap_module.output_bastion_public_ssh_key + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_os_image = var.map_os_image_regex[var.bastion_os_image] + +} + + +module "run_host_network_access_sap_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/host_network_access_sap?ref=dev" + + module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name + + module_var_az_vnet_name = module.run_account_init_module.output_vnet_name + module_var_az_vnet_subnet_name = module.run_account_init_module.output_vnet_subnet_name + + module_var_host_security_group_name = module.run_account_bootstrap_module.output_host_security_group_name + + module_var_sap_nwas_abap_ascs_instance_no = var.sap_nwas_abap_ascs_instance_no + module_var_sap_nwas_abap_pas_instance_no = var.sap_nwas_abap_pas_instance_no + module_var_sap_hana_instance_no = var.sap_hana_install_instance_number + +} + + +module "run_host_network_access_sap_public_via_proxy_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/host_network_access_sap_public_via_proxy?ref=main" + + module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name + + module_var_az_vnet_name = module.run_account_init_module.output_vnet_name + module_var_az_vnet_subnet_name = module.run_account_init_module.output_vnet_subnet_name + module_var_az_vnet_bastion_subnet_name = module.run_bastion_inject_module.output_vnet_bastion_subnet_name + + module_var_host_security_group_name = module.run_account_bootstrap_module.output_host_security_group_name + module_var_bastion_security_group_name = module.run_bastion_inject_module.output_bastion_security_group_name + module_var_bastion_connection_security_group_name = module.run_bastion_inject_module.output_bastion_connection_security_group_name + + module_var_sap_nwas_abap_pas_instance_no = var.sap_nwas_abap_pas_instance_no + module_var_sap_hana_instance_no = var.sap_hana_install_instance_number + +} + + +module "run_host_nfs_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/host_provision?ref=main" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/host_nfs?ref=main" + + module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name + module_var_resource_prefix = var.resource_prefix + + module_var_az_location_region = var.az_location_region + module_var_az_location_availability_zone_no = var.az_location_availability_zone_no + + module_var_az_vnet_name = module.run_account_init_module.output_vnet_name + module_var_az_vnet_subnet_name = module.run_account_init_module.output_vnet_subnet_name + + module_var_host_security_group_name = module.run_account_bootstrap_module.output_host_security_group_name + + module_var_nfs_boolean_sapmnt = contains([for host in var.map_host_specifications[var.host_specification_plan] : host.nfs_boolean_sapmnt],true) + + module_var_dns_zone_name = module.run_account_bootstrap_module.output_dns_zone_name +} + + +module "run_host_provision_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/host_provision?ref=main" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/host_provision?ref=main" + + + module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name + module_var_resource_prefix = var.resource_prefix + + module_var_az_location_region = var.az_location_region + module_var_az_location_availability_zone_no = var.az_location_availability_zone_no + + module_var_az_vnet_name = module.run_account_init_module.output_vnet_name + module_var_az_vnet_subnet_name = module.run_account_init_module.output_vnet_subnet_name + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + module_var_bastion_ip = module.run_bastion_inject_module.output_bastion_ip + module_var_bastion_connection_sg_id = module.run_bastion_inject_module.output_bastion_connection_security_group_id + + module_var_host_ssh_key_id = module.run_account_bootstrap_module.output_host_ssh_key_id + module_var_host_ssh_public_key = module.run_account_bootstrap_module.output_host_public_ssh_key + module_var_host_ssh_private_key = module.run_account_bootstrap_module.output_host_private_ssh_key + module_var_host_sg_id = module.run_account_bootstrap_module.output_host_security_group_id + + module_var_host_os_image = var.map_os_image_regex[var.host_os_image] + + module_var_dns_zone_name = module.run_account_bootstrap_module.output_dns_zone_name + module_var_dns_root_domain_name = var.dns_root_domain + + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable with nested objects + + for_each = toset([ + for key, value in var.map_host_specifications[var.host_specification_plan] : key + ]) + + module_var_host_name = each.key + + module_var_az_vm_instance = var.map_host_specifications[var.host_specification_plan][each.key].vm_instance + + module_var_disk_volume_count_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data + module_var_disk_volume_type_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data + module_var_disk_volume_capacity_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_data + module_var_disk_volume_iops_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_data : null + module_var_lvm_enable_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data + module_var_lvm_pv_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_data : 0 + module_var_lvm_vg_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_data : 0 + module_var_lvm_vg_physical_extent_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_data : 0 + module_var_lvm_lv_stripe_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_data : 0 + module_var_filesystem_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_data + module_var_physical_partition_filesystem_block_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_data + + module_var_disk_volume_count_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log + module_var_disk_volume_type_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log + module_var_disk_volume_capacity_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_log + module_var_disk_volume_iops_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_log : null + module_var_lvm_enable_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log + module_var_lvm_pv_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_log : 0 + module_var_lvm_vg_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_log : 0 + module_var_lvm_vg_physical_extent_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_log : 0 + module_var_lvm_lv_stripe_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_log : 0 + module_var_filesystem_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_log + module_var_physical_partition_filesystem_block_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_log + + module_var_disk_volume_count_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared + module_var_disk_volume_type_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared + module_var_disk_volume_capacity_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_shared + module_var_disk_volume_iops_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_shared : null + module_var_lvm_enable_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared + module_var_lvm_pv_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_shared : 0 + module_var_lvm_vg_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_shared : 0 + module_var_lvm_vg_physical_extent_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_shared : 0 + module_var_lvm_lv_stripe_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_shared : 0 + module_var_filesystem_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_shared + module_var_physical_partition_filesystem_block_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_shared + + module_var_disk_volume_count_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb + module_var_disk_volume_type_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb + module_var_disk_volume_capacity_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_anydb + module_var_disk_volume_iops_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_anydb : null + module_var_lvm_enable_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb + module_var_lvm_pv_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_anydb : 0 + module_var_lvm_vg_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_anydb : 0 + module_var_lvm_vg_physical_extent_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_anydb : 0 + module_var_lvm_lv_stripe_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_anydb : 0 + module_var_filesystem_mount_path_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_mount_path_anydb + module_var_filesystem_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_anydb + module_var_physical_partition_filesystem_block_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_anydb + + module_var_disk_volume_count_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_usr_sap + module_var_disk_volume_type_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_usr_sap + module_var_disk_volume_capacity_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_usr_sap + module_var_filesystem_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_usr_sap + + module_var_disk_volume_count_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_sapmnt + module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt + module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt + module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].nfs_boolean_sapmnt + module_var_nfs_fqdn_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].nfs_boolean_sapmnt ? module.run_host_nfs_module.output_nfs_fqdn : "" + + module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb + module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap + module_var_disk_volume_type_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_swap : 0 + module_var_disk_volume_capacity_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_swap : 0 + module_var_filesystem_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].filesystem_swap : 0 + + module_var_disk_volume_capacity_software = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_software + module_var_sap_software_download_directory = var.sap_software_download_directory + +} + + + +module "run_ansible_sap_s4hana_distributed_install_maintplan" { + + depends_on = [module.run_host_provision_module] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_s4hana_distributed_install_maintplan?ref=main" + + # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) + module_var_bastion_boolean = true // required as true boolean for any Cloud Service Provider (CSP) + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_floating_ip = module.run_bastion_inject_module.output_bastion_ip + + module_var_host_private_ssh_key = module.run_account_bootstrap_module.output_host_private_ssh_key + + module_var_dns_root_domain_name = var.dns_root_domain + +# module_var_inventory_hana_primary = module.run_host_provision_module["hana-p"].output_host_private_ip +# module_var_inventory_nwas_ascs = module.run_host_provision_module["nw-ascs"].output_host_private_ip +# module_var_inventory_nwas_pas = module.run_host_provision_module["nw-pas"].output_host_private_ip +# module_var_inventory_nwas_aas = join("\n", flatten([module.run_host_provision_module["nw-aas"].output_host_private_ip])) + + module_var_inventory_hana_primary = "${module.run_host_provision_module["hana-p"].output_host_name} ansible_host=${module.run_host_provision_module["hana-p"].output_host_private_ip}" + module_var_inventory_nwas_ascs = "${module.run_host_provision_module["nw-ascs"].output_host_name} ansible_host=${module.run_host_provision_module["nw-ascs"].output_host_private_ip}" + module_var_inventory_nwas_pas = "${module.run_host_provision_module["nw-pas"].output_host_name} ansible_host=${module.run_host_provision_module["nw-pas"].output_host_private_ip}" + module_var_inventory_nwas_aas = "${module.run_host_provision_module["nw-aas"].output_host_name} ansible_host=${module.run_host_provision_module["nw-aas"].output_host_private_ip}" + + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + + module_var_sap_hana_install_master_password = var.sap_hana_install_master_password + module_var_sap_hana_install_sid = var.sap_hana_install_sid + module_var_sap_hana_install_instance_number = var.sap_hana_install_instance_number + + module_var_sap_swpm_sid = var.sap_s4hana_install_sid + + module_var_sap_swpm_db_schema_abap = "SAPHANADB" + module_var_sap_swpm_db_schema_abap_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_system_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_systemdb_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_sidadm_password = var.sap_hana_install_master_password + module_var_sap_swpm_ddic_000_password = var.sap_hana_install_master_password + module_var_sap_swpm_pas_instance_nr = var.sap_nwas_abap_pas_instance_no + module_var_sap_swpm_ascs_instance_nr = var.sap_nwas_abap_ascs_instance_no + + module_var_sap_swpm_master_password = var.sap_hana_install_master_password + + module_var_sap_maintenance_planner_transaction_name = var.sap_maintenance_planner_transaction_name + + module_var_sap_swpm_template_selected = var.sap_swpm_template_selected + + module_var_sap_software_download_directory = var.sap_software_download_directory + +} diff --git a/sap_s4hana_distributed_install/msazure_vm/outputs.tf b/sap_s4hana_distributed_install/msazure_vm/outputs.tf new file mode 100644 index 0000000..f4f4d5f --- /dev/null +++ b/sap_s4hana_distributed_install/msazure_vm/outputs.tf @@ -0,0 +1,235 @@ + +############################################################## +# Export SSH key to file on local +############################################################## + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "bastion_rsa" { + content = module.run_account_bootstrap_module.output_bastion_private_ssh_key + filename = "${path.root}/ssh/bastion_rsa" + file_permission = "0400" +} + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "hosts_rsa" { + content = module.run_account_bootstrap_module.output_host_private_ssh_key + filename = "${path.root}/ssh/hosts_rsa" + file_permission = "0400" +} + + +output "ssh_sap_connection_details" { + value = local.is_wsl ? "IGNORE" : <>> Chosen option $REPLY: $opt" + select opt_ip in "$${target_host_array[@]}"; do + if [ $opt_ip = "Quit" ]; then break 2; fi + target_ip=$opt_ip + echo "---- Selected option $REPLY, tunneling into $target_ip ----" + break + done + echo "" + echo "#### For SAP HANA Studio, use Add System with host name as localhost; do not add port numbers." + echo "#### If selecting 'Connect using SSL' on Connection Properties, then on Additional Properties (final) screen deselect 'Validate the SSL certificate'" + echo "" + echo "#### For SAPGUI, use expert mode SAP Logon String as: ####" + echo "conn=/H/localhost/S/32$sap_nwas_abap_pas_instance_no&expert=true" + echo "" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N \ + $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file \ + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -L localhost:32$sap_nwas_abap_pas_instance_no:$target_ip:32$sap_nwas_abap_pas_instance_no \ + -L localhost:33$sap_nwas_abap_pas_instance_no:$target_ip:33$sap_nwas_abap_pas_instance_no \ + -L localhost:3$${sap_hana_instance_no}13:$target_ip:3$${sap_hana_instance_no}13 \ + -L localhost:3$${sap_hana_instance_no}15:$target_ip:3$${sap_hana_instance_no}15 \ + -L localhost:3$${sap_hana_instance_no}41:$target_ip:3$${sap_hana_instance_no}41 \ + -L localhost:443$sap_hana_instance_no:$target_ip:443$sap_hana_instance_no \ + -L localhost:443$sap_nwas_abap_pas_instance_no:$target_ip:443$sap_nwas_abap_pas_instance_no \ + -L localhost:5$${sap_hana_instance_no}13:$target_ip:5$${sap_hana_instance_no}13 \ + -L localhost:5$${sap_hana_instance_no}14:$target_ip:5$${sap_hana_instance_no}14 + break + ;; + "OS root access, via SSH stdin/stdout forwarding proxy") + echo ">>> Chosen option $REPLY: $opt" + select opt_ssh in "$${target_host_array[@]}"; do + if [ $opt_ssh = "Quit" ]; then break 2; fi + target_ip=$opt_ssh + echo "---- Selected option $REPLY, logging into $target_ip ----" + break + done + + if [ -n "$target_ip" ]; then + ssh -i $target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + fi + break + ;; + "Quit") + break + ;; + *) echo "Invalid option $REPLY" ;; + esac + done +} + +# Then call shell function and select which target +sshjump + +EOF +} + + +# If detected Windows WSL2, then find the installed name using external resource to return a JSON string +data "external" "wsl_distro_name" { + count = local.is_wsl ? 1 : 0 + program = ["bash", "-c", "echo \"{\\\"stdout\\\":\\\"$(echo $WSL_DISTRO_NAME)\\\"}\""] +} + +output "ssh_sap_connection_details_windows" { + value = local.not_wsl ? "IGNORE" : <>> Chosen option $(PSItem)" + echo "" + echo "#### For SAP HANA Studio, use Add System with host name as localhost; do not add port numbers." + echo "#### If selecting 'Connect using SSL' on Connection Properties, then on Additional Properties (final) screen deselect 'Validate the SSL certificate'" + echo "" + echo "#### For SAPGUI, use expert mode SAP Logon String as: ####" + echo "conn=/H/localhost/S/32$sap_nwas_abap_pas_instance_no&expert=true" + echo "" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N ` + $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -L localhost:32$${sap_nwas_abap_pas_instance_no}:$${target_ip}:32$${sap_nwas_abap_pas_instance_no} ` + -L localhost:33$${sap_nwas_abap_pas_instance_no}:$${target_ip}:33$${sap_nwas_abap_pas_instance_no} ` + -L localhost:3$${sap_hana_instance_no}13:$${target_ip}:3$${sap_hana_instance_no}13 ` + -L localhost:3$${sap_hana_instance_no}15:$${target_ip}:3$${sap_hana_instance_no}15 ` + -L localhost:3$${sap_hana_instance_no}41:$${target_ip}:3$${sap_hana_instance_no}41 ` + -L localhost:443$${sap_hana_instance_no}:$${target_ip}:443$${sap_hana_instance_no} ` + -L localhost:443$${sap_nwas_abap_pas_instance_no}:$${target_ip}:443$${sap_nwas_abap_pas_instance_no} ` + -L localhost:5$${sap_hana_instance_no}13:$${target_ip}:5$${sap_hana_instance_no}13 ` + -L localhost:5$${sap_hana_instance_no}14:$${target_ip}:5$${sap_hana_instance_no}14 + } + } + 2 { + foreach ($target_host in $target_host_array) { + $i=$target_host_array.IndexOf($target_host) + echo "$i) $target_host" + } + $target_host_selection = Read-Host "Please make a selection" + if ($target_host_array[$target_host_selection] -eq "Quit" ){ + break + }else { + $target_ip = $target_host_array[$target_host_selection] + #echo ">>> Chosen option $(PSItem)" + ssh -i $temp_target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + } + } + 3 { + break + } + } +} + +EOF + +} diff --git a/sap_s4hana_distributed_install/msazure_vm/variable_locals.tf b/sap_s4hana_distributed_install/msazure_vm/variable_locals.tf new file mode 100644 index 0000000..ff321be --- /dev/null +++ b/sap_s4hana_distributed_install/msazure_vm/variable_locals.tf @@ -0,0 +1,21 @@ +locals { + + resource_group_create_boolean = var.az_resource_group_name == "new" ? true : false + + az_vnet_name_create_boolean = var.az_vnet_name == "new" ? true : false + + az_vnet_subnet_name_create_boolean = var.az_vnet_subnet_name == "new" ? true : false + + # Directories start with "C:..." on Windows; All other OSs use "/" for root. + detect_windows = substr(pathexpand("~"), 0, 1) == "/" ? false : true + detect_shell = substr(pathexpand("~"), 0, 1) == "/" ? true : false + + # Used for displaying Shell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + not_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? false : true : true + + # Used for displaying Windows PowerShell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + is_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? true : false : false + +} diff --git a/sap_s4hana_distributed_install/msazure_vm/variable_map_hosts.tf b/sap_s4hana_distributed_install/msazure_vm/variable_map_hosts.tf new file mode 100644 index 0000000..eb63997 --- /dev/null +++ b/sap_s4hana_distributed_install/msazure_vm/variable_map_hosts.tf @@ -0,0 +1,184 @@ + +variable "map_host_specifications" { + + description = "Map of host specficiations for SAP S/4HANA distributed install" + + type = map(any) + + default = { + + small_256gb = { + + hana-p = { // Hostname + vm_instance = "Standard_M32ls" + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 4 + disk_volume_type_hana_data = "P6" + disk_volume_capacity_hana_data = 64 + #disk_volume_iops_hana_data = + lvm_enable_hana_data = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_hana_data = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_hana_data = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_hana_data = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_hana_data = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_data = "xfs" + #physical_partition_filesystem_block_size_hana_data = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_hana_log = 3 + disk_volume_type_hana_log = "P10" + disk_volume_capacity_hana_log = 128 + #disk_volume_iops_hana_log = + lvm_enable_hana_log = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_hana_log = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_hana_log = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_hana_log = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_hana_log = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_log = "xfs" + #physical_partition_filesystem_block_size_hana_log = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_hana_shared = 1 + disk_volume_type_hana_shared = "P15" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_hana_shared = 256 + #disk_volume_iops_hana_shared = + lvm_enable_hana_shared = false // if false, then disk volume count should be 1 + #lvm_pv_data_alignment_hana_shared = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + #lvm_vg_data_alignment_hana_shared = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + #lvm_vg_physical_extent_size_hana_shared = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + #lvm_lv_stripe_size_hana_shared = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_shared = "xfs" + physical_partition_filesystem_block_size_hana_shared = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 0 // max of 1 + disk_volume_type_usr_sap = "E20" + disk_volume_capacity_usr_sap = 512 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_type_sapmnt = "E4" + disk_volume_capacity_sapmnt = 32 // bad sizing, but use this so each drive size is unique + filesystem_sapmnt = "xfs" + nfs_boolean_sapmnt = false + + disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 0 // max of 1 + #disk_volume_type_swap = "E3" + #disk_volume_capacity_swap = 16 // bad sizing, but use this so each drive size is unique + #filesystem_swap = "xfs" + + disk_volume_capacity_software = 304 + }, + + + + nw-ascs = { // Hostname + vm_instance = "Standard_D32s_v5" + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 0 + + disk_volume_count_hana_log = 0 + + disk_volume_count_hana_shared = 0 + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 1 // max of 1 + disk_volume_type_usr_sap = "E15" + disk_volume_capacity_usr_sap = 256 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 1 // max of 1 + disk_volume_type_sapmnt = "E6" + disk_volume_capacity_sapmnt = 64 // bad sizing, but use this so each drive size is unique + filesystem_sapmnt = "xfs" + nfs_boolean_sapmnt = true + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "E10" + disk_volume_capacity_swap = 128 + filesystem_swap = "xfs" + + disk_volume_capacity_software = 100 + }, + + + + nw-pas = { // Hostname + vm_instance = "Standard_D32s_v5" + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 0 + + disk_volume_count_hana_log = 0 + + disk_volume_count_hana_shared = 0 + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 1 // max of 1 + disk_volume_type_usr_sap = "E15" + disk_volume_capacity_usr_sap = 256 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 1 // max of 1 + disk_volume_type_sapmnt = "E6" + disk_volume_capacity_sapmnt = 64 // bad sizing, but use this so each drive size is unique + filesystem_sapmnt = "xfs" + nfs_boolean_sapmnt = true + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "E10" + disk_volume_capacity_swap = 128 + filesystem_swap = "xfs" + + disk_volume_capacity_software = 100 + }, + + + + nw-aas = { // Hostname + vm_instance = "Standard_D32s_v5" + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 0 + + disk_volume_count_hana_log = 0 + + disk_volume_count_hana_shared = 0 + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 1 // max of 1 + disk_volume_type_usr_sap = "E15" + disk_volume_capacity_usr_sap = 256 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 1 // max of 1 + disk_volume_type_sapmnt = "E6" + disk_volume_capacity_sapmnt = 64 // bad sizing, but use this so each drive size is unique + filesystem_sapmnt = "xfs" + nfs_boolean_sapmnt = true + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "E10" + disk_volume_capacity_swap = 128 + filesystem_swap = "xfs" + + disk_volume_capacity_software = 100 + } + + } + + } + +} diff --git a/sap_s4hana_distributed_install/msazure_vm/variable_map_os.tf b/sap_s4hana_distributed_install/msazure_vm/variable_map_os.tf new file mode 100644 index 0000000..010c0a6 --- /dev/null +++ b/sap_s4hana_distributed_install/msazure_vm/variable_map_os.tf @@ -0,0 +1,59 @@ + +# Find latest OS Image for RHEL +# az account list-locations | jq .[].displayName +# az vm image list --all --publisher redhat --offer RHEL-SAP-APPS --sku 8 --query "[?starts_with(version,'8.4')]" | jq .[].version --raw-output | sort -r | head -1 +# az vm image list --all --publisher redhat --offer RHEL-SAP-HA --sku 8 --query "[?starts_with(version,'8.4')]" | jq .[].version --raw-output | sort -r | head -1 + +variable "map_os_image_regex" { + + description = "Map of operating systems OS Image regex, to identify latest OS Image for the OS major.minor version" + + type = map(any) + + default = { + + rhel-8-4 = { + publisher = "RedHat" + offer = "RHEL" + sku = "84-gen2" + }, + + rhel-8-1-sap-ha = { + publisher = "RedHat" + offer = "RHEL-SAP-HA" + sku = "81sapha-gen2" + }, + + rhel-8-2-sap-ha = { + publisher = "RedHat" + offer = "RHEL-SAP-HA" + sku = "82sapha-gen2" + }, + + rhel-8-4-sap-ha = { + publisher = "RedHat" + offer = "RHEL-SAP-HA" + sku = "84sapha-gen2" + }, + + rhel-8-1-sap-applications = { + publisher = "RedHat" + offer = "RHEL-SAP-APPS" + sku = "81sapapps-gen2" + }, + + rhel-8-2-sap-applications = { + publisher = "RedHat" + offer = "RHEL-SAP-APPS" + sku = "82sapapps-gen2" + }, + + rhel-8-4-sap-applications = { + publisher = "RedHat" + offer = "RHEL-SAP-APPS" + sku = "84sapapps-gen2" + } + + } + +} diff --git a/sap_s4hana_distributed_install/msazure_vm/variables.tf b/sap_s4hana_distributed_install/msazure_vm/variables.tf new file mode 100644 index 0000000..fdf8465 --- /dev/null +++ b/sap_s4hana_distributed_install/msazure_vm/variables.tf @@ -0,0 +1,139 @@ + +variable "az_tenant_id" { + description = "Azure Tenant ID" +} + +variable "az_subscription_id" { + description = "Azure Subscription ID" +} + +variable "az_app_client_id" { + description = "Azure AD App Client ID" +} + +variable "az_app_client_secret" { + description = "Azure AD App Client Secret" +} + +variable "resource_prefix" { + description = "Enter prefix to resource names" +} + +variable "az_resource_group_name" { + description = "Enter existing/target Azure Resource Group name, or enter 'new' to create a Resource Group using the defined prefix for all resources" +} + +variable "az_location_region" { + description = "Target Azure Region aka. Azure Location Display Name (e.g. 'West Europe')" +} + +variable "az_location_availability_zone_no" { + description = "Target Azure Availability Zone (e.g. 1)" +} + +variable "az_vnet_name" { + description = "Enter existing/target Azure VNet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range (cannot be 'new' if using existing VNet Subnet)" +} + +variable "az_vnet_subnet_name" { + description = "Enter existing/target Azure VNet Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range (if using existing VNet, ensure default subnet range matches to VNet address space and does not conflict with existing Subnet)" +} + +variable "dns_root_domain" { + description = "Root Domain for Private DNS used with the Virtual Machine" +} + +variable "bastion_os_image" { + description = "Bastion OS Image. This variable uses the locals mapping with regex of OS Images, and will alter bastion provisioning." +} + +variable "bastion_user" { + description = "OS User to create on Bastion host to avoid pass-through root user (e.g. bastionuser)" +} + +variable "bastion_ssh_port" { + type = number + description = "Bastion host SSH Port from IANA Dynamic Ports range (49152 to 65535)" + + validation { + condition = var.bastion_ssh_port > 49152 && var.bastion_ssh_port < 65535 + error_message = "Bastion host SSH Port must fall within IANA Dynamic Ports range (49152 to 65535)." + } +} + +variable "host_specification_plan" { + description = "Host specification plans are small_256gb. This variable uses the locals mapping with a nested list of host specifications, and will alter host provisioning." +} + +variable "host_os_image" { + description = "Host OS Image. This variable uses the locals mapping with regex of OS Images, and will alter host provisioning." +} + +variable "sap_software_download_directory" { + description = "Mount point for downloads of SAP Software" + + validation { + error_message = "Directory must start with forward slash." + condition = can(regex("^/", var.sap_software_download_directory)) + } + +} + + +variable "sap_id_user" { + description = "Ansible - Please enter your SAP ID user (e.g. S-User)" +} + +variable "sap_id_user_password" { + description = "Ansible - Please enter your SAP ID password" +} + +variable "sap_hana_install_master_password" { + description = "Ansible - SAP HANA install: set common initial password (e.g. NewPass$321)" +} + +variable "sap_hana_install_sid" { + description = "Ansible - SAP HANA install: System ID (e.g. H01)" +} + +variable "sap_hana_install_instance_number" { + description = "Ansible - SAP HANA install: Instance Number (e.g. 90)" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_hana_install_instance_number)) + } + +} + +variable "sap_s4hana_install_sid" { + description = "Ansible - SAP S/4HANA install: System ID (e.g. S01)" +} + +variable "sap_maintenance_planner_transaction_name" { + description = "Ansible - SAP Maintenance Planner Transaction name for SAP S/4HANA, required to perform download of this stack" +} + +variable "sap_swpm_template_selected" { + description = "Ansible - Select template to use: sap_s4hana_2021_distributed, sap_s4hana_2022_distributed" +} + +variable "sap_nwas_abap_ascs_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - ABAP Central Services (ASCS) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_ascs_instance_no)) + } + +} + +variable "sap_nwas_abap_pas_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - Primary Application Server instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_pas_instance_no)) + } + +} diff --git a/sap_s4hana_distributed_install/msazure_vm/variables_generic_for_cli.tfvars b/sap_s4hana_distributed_install/msazure_vm/variables_generic_for_cli.tfvars new file mode 100644 index 0000000..d83d4c9 --- /dev/null +++ b/sap_s4hana_distributed_install/msazure_vm/variables_generic_for_cli.tfvars @@ -0,0 +1,27 @@ +resource_prefix = "sap" + +dns_root_domain = "poc.cloud" + +bastion_os_image = "rhel-8-4" + +bastion_user = "bastionuser" + +bastion_ssh_port = 50222 + +host_specification_plan = "small_256gb" + +host_os_image = "rhel-8-4-sap-ha" + +sap_hana_install_master_password = "NewPass$321" + +sap_hana_install_sid = "H01" + +sap_hana_install_instance_number = "90" + +sap_nwas_abap_ascs_instance_no = "01" + +sap_nwas_abap_pas_instance_no = "00" + +sap_s4hana_install_sid = "S01" + +sap_software_download_directory = "/software" diff --git a/sap_s4hana_distributed_install/msazure_vm/versions.tf b/sap_s4hana_distributed_install/msazure_vm/versions.tf new file mode 100644 index 0000000..4d9dea3 --- /dev/null +++ b/sap_s4hana_distributed_install/msazure_vm/versions.tf @@ -0,0 +1,40 @@ +# Terraform declaration +terraform { + required_version = ">= 1.0" + required_providers { + azurerm = { + #source = "localdomain/provider/azurerm" // Local, on macOS path to place files would be $HOME/.terraform.d/plugins/localdomain/provider/azurerm/1.xx.xx/darwin_amd6 + source = "hashicorp/azurerm" // Terraform Registry + version = ">=2.90.0" + } + azapi = { + source = "Azure/azapi" + version = ">=1.3.0" + } + } +} + +# Terraform Provider declaration + +provider "azurerm" { + + features {} + + tenant_id = var.az_tenant_id // Azure Tenant ID, linked to the Azure Active Directory instance + subscription_id = var.az_subscription_id // Azure Subscription ID, linked to an Azure Tenant. All resource groups belong to the Azure Subscription. + + client_id = var.az_app_client_id // Azure Client ID, defined in the Azure Active Directory instance; equivalent to Active Directory Application ID. + client_secret = var.az_app_client_secret // Azure Application ID Password, defined in the Azure Active Directory instance + + # Role-based Access Control (RBAC) permissions control the actions for resources within the Azure Subscription. + # The Roles are assigned to a Security Principal - which can be a User, Group, Service Principal or Managed Identity. + +} + +provider "azapi" { + tenant_id = var.az_tenant_id // Azure Tenant ID, linked to the Azure Active Directory instance + subscription_id = var.az_subscription_id // Azure Subscription ID, linked to an Azure Tenant. All resource groups belong to the Azure Subscription. + + client_id = var.az_app_client_id // Azure Client ID, defined in the Azure Active Directory instance; equivalent to Active Directory Application ID. + client_secret = var.az_app_client_secret // Azure Application ID Password, defined in the Azure Active Directory instance +} diff --git a/sap_solman_sapase_single_node_install/aws_ec2_instance/main.tf b/sap_solman_sapase_single_node_install/aws_ec2_instance/main.tf new file mode 100644 index 0000000..a185e6d --- /dev/null +++ b/sap_solman_sapase_single_node_install/aws_ec2_instance/main.tf @@ -0,0 +1,308 @@ + +module "run_ansible_dry_run" { + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=dev" + + module_var_dry_run_test = "x86_64" // x86_64 or ppc64le + + # Terraform Module Variables which are mandatory, all with an empty string + module_var_bastion_boolean = false + module_var_bastion_user = "" + module_var_bastion_ssh_port = 0 + module_var_bastion_private_ssh_key = "" + module_var_bastion_floating_ip = "" + module_var_host_private_ssh_key = "" + module_var_host_private_ip = "" + module_var_hostname = "software_media_dry_run" + module_var_dns_root_domain_name = "" + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + module_var_sap_swpm_sid = "" + module_var_sap_swpm_db_schema_abap = "" + module_var_sap_swpm_db_schema_abap_password = "" + module_var_sap_swpm_ddic_000_password = "" + module_var_sap_swpm_template_selected = "sap_solman_72_sr2_sapase_onehost" +} + + +module "run_account_init_module" { + + depends_on = [ + module.run_ansible_dry_run + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/account_init?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_aws_vpc_subnet_id = var.aws_vpc_subnet_id + + module_var_aws_vpc_subnet_create_boolean = local.aws_vpc_subnet_create_boolean + + module_var_aws_vpc_availability_zone = var.aws_vpc_availability_zone + +} + + +module "run_account_bootstrap_module" { + + depends_on = [ + module.run_account_init_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/account_bootstrap?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_aws_vpc_subnet_id = local.aws_vpc_subnet_create_boolean ? module.run_account_init_module.output_aws_vpc_subnet_id : var.aws_vpc_subnet_id + + module_var_dns_root_domain_name = var.dns_root_domain + +} + + +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] + + +module "run_bastion_inject_module" { + + depends_on = [ + module.run_account_bootstrap_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/bastion_inject?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_aws_vpc_subnet_id = local.aws_vpc_subnet_create_boolean ? module.run_account_init_module.output_aws_vpc_subnet_id : var.aws_vpc_subnet_id + module_var_aws_vpc_igw_id = module.run_account_init_module.output_aws_vpc_igw_id + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_os_image = var.map_os_image_regex[var.bastion_os_image] + module_var_bastion_ssh_key_name = module.run_account_bootstrap_module.output_bastion_ssh_key_name + module_var_bastion_public_ssh_key = module.run_account_bootstrap_module.output_bastion_public_ssh_key + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_aws_vpc_availability_zone = var.aws_vpc_availability_zone + +} + + +module "run_host_network_access_sap_module" { + + depends_on = [ + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/host_network_access_sap?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_aws_vpc_subnet_id = local.aws_vpc_subnet_create_boolean ? module.run_account_init_module.output_aws_vpc_subnet_id : var.aws_vpc_subnet_id + module_var_host_security_group_id = module.run_account_bootstrap_module.output_host_security_group_id + + module_var_sap_nwas_abap_pas_instance_no = "" + module_var_sap_nwas_java_ci_instance_no = var.sap_nwas_java_ci_instance_no + module_var_sap_hana_instance_no = "" + +} + + +module "run_host_network_access_sap_public_via_proxy_module" { + + depends_on = [ + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/host_network_access_sap_public_via_proxy?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_aws_vpc_subnet_id = local.aws_vpc_subnet_create_boolean ? module.run_account_init_module.output_aws_vpc_subnet_id : var.aws_vpc_subnet_id + + module_var_bastion_sg_id = module.run_bastion_inject_module.output_bastion_security_group_id + module_var_bastion_connection_sg_id = module.run_bastion_inject_module.output_bastion_connection_security_group_id + + module_var_sap_nwas_abap_pas_instance_no = "" + module_var_sap_nwas_java_ci_instance_no = var.sap_nwas_java_ci_instance_no + module_var_sap_hana_instance_no = "" + +} + + +module "run_host_provision_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/host_provision?ref=main" + + # Set Terraform Module Variables using Terraform Variables at runtime + + module_var_aws_vpc_subnet_id = local.aws_vpc_subnet_create_boolean ? module.run_account_init_module.output_aws_vpc_subnet_id : var.aws_vpc_subnet_id + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + module_var_bastion_ip = module.run_bastion_inject_module.output_bastion_ip + module_var_bastion_connection_sg_id = module.run_bastion_inject_module.output_bastion_connection_security_group_id + + module_var_host_ssh_key_name = module.run_account_bootstrap_module.output_host_ssh_key_name + module_var_host_ssh_public_key = module.run_account_bootstrap_module.output_host_public_ssh_key + module_var_host_ssh_private_key = module.run_account_bootstrap_module.output_host_private_ssh_key + module_var_host_sg_id = module.run_account_bootstrap_module.output_host_security_group_id + + module_var_host_os_image = var.map_os_image_regex[var.host_os_image] + + module_var_dns_zone_id = module.run_account_bootstrap_module.output_dns_zone_id + module_var_dns_root_domain_name = module.run_account_bootstrap_module.output_dns_domain_name + module_var_dns_nameserver_list = module.run_account_bootstrap_module.output_dns_nameserver_list + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable with nested objects + + for_each = toset([ + for key, value in var.map_host_specifications[var.host_specification_plan] : key + ]) + + module_var_host_name = each.key + + module_var_aws_ec2_instance_type = var.map_host_specifications[var.host_specification_plan][each.key].ec2_instance_type + + module_var_disk_volume_count_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data + module_var_disk_volume_type_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data + module_var_disk_volume_capacity_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_data + module_var_disk_volume_iops_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_data : null + module_var_lvm_enable_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data + module_var_lvm_pv_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_data : 0 + module_var_lvm_vg_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_data : 0 + module_var_lvm_vg_physical_extent_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_data : 0 + module_var_lvm_lv_stripe_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_data : 0 + module_var_filesystem_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_data + module_var_physical_partition_filesystem_block_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_data + + module_var_disk_volume_count_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log + module_var_disk_volume_type_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log + module_var_disk_volume_capacity_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_log + module_var_disk_volume_iops_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_log : null + module_var_lvm_enable_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log + module_var_lvm_pv_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_log : 0 + module_var_lvm_vg_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_log : 0 + module_var_lvm_vg_physical_extent_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_log : 0 + module_var_lvm_lv_stripe_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_log : 0 + module_var_filesystem_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_log + module_var_physical_partition_filesystem_block_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_log + + module_var_disk_volume_count_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared + module_var_disk_volume_type_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared + module_var_disk_volume_capacity_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_shared + module_var_disk_volume_iops_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_shared : null + module_var_lvm_enable_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared + module_var_lvm_pv_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_shared : 0 + module_var_lvm_vg_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_shared : 0 + module_var_lvm_vg_physical_extent_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_shared : 0 + module_var_lvm_lv_stripe_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_shared : 0 + module_var_filesystem_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_shared + module_var_physical_partition_filesystem_block_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_shared + + module_var_disk_volume_count_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb + module_var_disk_volume_type_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb + module_var_disk_volume_capacity_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_anydb + module_var_disk_volume_iops_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_anydb : null + module_var_lvm_enable_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb + module_var_lvm_pv_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_anydb : 0 + module_var_lvm_vg_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_anydb : 0 + module_var_lvm_vg_physical_extent_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_anydb : 0 + module_var_lvm_lv_stripe_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_anydb : 0 + module_var_filesystem_mount_path_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_mount_path_anydb + module_var_filesystem_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_anydb + module_var_physical_partition_filesystem_block_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_anydb + + module_var_disk_volume_count_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_usr_sap + module_var_disk_volume_type_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_usr_sap + module_var_disk_volume_capacity_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_usr_sap + module_var_filesystem_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_usr_sap + + module_var_disk_volume_count_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_sapmnt + module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt + module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt + module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation + + module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb + module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap + module_var_disk_volume_type_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_swap : 0 + module_var_disk_volume_capacity_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_swap : 0 + module_var_filesystem_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].filesystem_swap : 0 + + module_var_disk_volume_type_software = var.disk_volume_type_software + module_var_disk_volume_capacity_software = var.disk_volume_capacity_software + module_var_sap_software_download_directory = var.sap_software_download_directory + + module_var_disable_ip_anti_spoofing = false + +} + + +module "run_ansible_sap_solman_java_sapase_install" { + + depends_on = [module.run_host_provision_module] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=dev" + + + # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) + module_var_bastion_boolean = true // required as true boolean for any Cloud Service Provider (CSP) + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_floating_ip = module.run_bastion_inject_module.output_bastion_ip + + module_var_host_private_ssh_key = module.run_account_bootstrap_module.output_host_private_ssh_key + + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable at runtime + + for_each = module.run_host_provision_module + module_var_host_private_ip = join(", ", each.value.*.output_host_private_ip) + module_var_hostname = join(", ", each.value.*.output_host_name) + module_var_dns_root_domain_name = var.dns_root_domain + + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + + module_var_sap_anydb_install_sid = var.sap_anydb_install_sid + module_var_sap_anydb_install_instance_number = var.sap_anydb_install_instance_number + + module_var_sap_swpm_sid = var.sap_nwas_install_sid + + module_var_sap_swpm_db_schema_abap = "SAPJAVA1" + module_var_sap_swpm_db_schema_abap_password = var.sap_anydb_install_master_password + module_var_sap_swpm_db_system_password = var.sap_anydb_install_master_password + module_var_sap_swpm_db_systemdb_password = var.sap_anydb_install_master_password + module_var_sap_swpm_db_sidadm_password = var.sap_anydb_install_master_password + module_var_sap_swpm_ddic_000_password = var.sap_anydb_install_master_password + + module_var_sap_swpm_ascs_instance_nr = var.sap_nwas_abap_ascs_instance_no + module_var_sap_swpm_pas_instance_nr = var.sap_nwas_abap_pas_instance_no + + module_var_sap_swpm_nwas_java_instance_nr = var.sap_nwas_java_ci_instance_no + + module_var_sap_swpm_master_password = var.sap_anydb_install_master_password + + module_var_sap_swpm_template_selected = "sap_solman_72_sr2_sapase_onehost" + + module_var_filesystem_mount_path_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_mount_path_anydb + + module_var_sap_software_download_directory = var.sap_software_download_directory + +} diff --git a/sap_solman_sapase_single_node_install/aws_ec2_instance/outputs.tf b/sap_solman_sapase_single_node_install/aws_ec2_instance/outputs.tf new file mode 100644 index 0000000..0759d42 --- /dev/null +++ b/sap_solman_sapase_single_node_install/aws_ec2_instance/outputs.tf @@ -0,0 +1,211 @@ + +############################################################## +# Export SSH key to file on local +############################################################## + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "bastion_rsa" { + content = module.run_account_bootstrap_module.output_bastion_private_ssh_key + filename = "${path.root}/ssh/bastion_rsa" + file_permission = "0400" +} + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "hosts_rsa" { + content = module.run_account_bootstrap_module.output_host_private_ssh_key + filename = "${path.root}/ssh/hosts_rsa" + file_permission = "0400" +} + + +output "ssh_sap_connection_details" { + value = local.is_wsl ? "IGNORE" : <>> Chosen option $REPLY: $opt" + select opt_ip in "$${target_host_array[@]}"; do + if [ $opt_ip = "Quit" ]; then break 2; fi + target_ip=$opt_ip + echo "---- Selected option $REPLY, tunneling into $target_ip ----" + break + done + echo "" + echo "#### HTTP/S JAVA endpoints: ####" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N \ + $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file \ + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -L localhost:5$${sap_nwas_java_ci_instance_no}00:$target_ip:5$${sap_nwas_java_ci_instance_no}01 \ + -L localhost:5$${sap_nwas_java_ci_instance_no}20:$target_ip:5$${sap_nwas_java_ci_instance_no}20 \ + -L localhost:5$${sap_nwas_java_ci_instance_no}13:$target_ip:5$${sap_nwas_java_ci_instance_no}14 + break + ;; + "OS root access, via SSH stdin/stdout forwarding proxy") + echo ">>> Chosen option $REPLY: $opt" + select opt_ssh in "$${target_host_array[@]}"; do + if [ $opt_ssh = "Quit" ]; then break 2; fi + target_ip=$opt_ssh + echo "---- Selected option $REPLY, logging into $target_ip ----" + break + done + + if [ -n "$target_ip" ]; then + ssh -i $target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + fi + break + ;; + "Quit") + break + ;; + *) echo "Invalid option $REPLY" ;; + esac + done +} + +# Then call shell function and select which target +sshjump + +EOF +} + + +# If detected Windows WSL2, then find the installed name using external resource to return a JSON string +data "external" "wsl_distro_name" { + count = local.is_wsl ? 1 : 0 + program = ["bash", "-c", "echo \"{\\\"stdout\\\":\\\"$(echo $WSL_DISTRO_NAME)\\\"}\""] +} + +output "ssh_sap_connection_details_windows" { + value = local.not_wsl ? "IGNORE" : <>> Chosen option $(PSItem)" + echo "" + echo "#### HTTP/S JAVA endpoints: ####" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N ` + $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -L localhost:5$${sap_nwas_java_ci_instance_no}00:$${target_ip}:5$${sap_nwas_java_ci_instance_no}01 ` + -L localhost:5$${sap_nwas_java_ci_instance_no}20:$${target_ip}:5$${sap_nwas_java_ci_instance_no}20 ` + -L localhost:5$${sap_nwas_java_ci_instance_no}13:$${target_ip}:5$${sap_nwas_java_ci_instance_no}14 + } + } + 2 { + foreach ($target_host in $target_host_array) { + $i=$target_host_array.IndexOf($target_host) + echo "$i) $target_host" + } + $target_host_selection = Read-Host "Please make a selection" + if ($target_host_array[$target_host_selection] -eq "Quit" ){ + break + }else { + $target_ip = $target_host_array[$target_host_selection] + #echo ">>> Chosen option $(PSItem)" + ssh -i $temp_target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + } + } + 3 { + break + } + } +} + +EOF + +} diff --git a/sap_solman_sapase_single_node_install/aws_ec2_instance/outputs_debug.tf b/sap_solman_sapase_single_node_install/aws_ec2_instance/outputs_debug.tf new file mode 100644 index 0000000..ff3141d --- /dev/null +++ b/sap_solman_sapase_single_node_install/aws_ec2_instance/outputs_debug.tf @@ -0,0 +1,4 @@ + +############################################################## +# DEBUG variable map +############################################################## diff --git a/sap_solman_sapase_single_node_install/aws_ec2_instance/variable_locals.tf b/sap_solman_sapase_single_node_install/aws_ec2_instance/variable_locals.tf new file mode 100644 index 0000000..8c2f87c --- /dev/null +++ b/sap_solman_sapase_single_node_install/aws_ec2_instance/variable_locals.tf @@ -0,0 +1,19 @@ +locals { + + aws_vpc_subnet_create_boolean = var.aws_vpc_subnet_id == "new" ? true : false + + # Directories start with "C:..." on Windows; All other OSs use "/" for root. + detect_windows = substr(pathexpand("~"), 0, 1) == "/" ? false : true + detect_shell = substr(pathexpand("~"), 0, 1) == "/" ? true : false + + # Used for displaying Shell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + not_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? false : true : true + + # Used for displaying Windows PowerShell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + is_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? true : false : false + + aws_region = replace(var.aws_vpc_availability_zone,"/[a-c]$/","") + +} diff --git a/sap_solman_sapase_single_node_install/aws_ec2_instance/variable_map_hosts.tf b/sap_solman_sapase_single_node_install/aws_ec2_instance/variable_map_hosts.tf new file mode 100644 index 0000000..cebb2a9 --- /dev/null +++ b/sap_solman_sapase_single_node_install/aws_ec2_instance/variable_map_hosts.tf @@ -0,0 +1,57 @@ + +variable "map_host_specifications" { + + description = "Map of host specficiations for SAP NetWeaver AS (JAVA) with SAP ASE single node install" + + type = map(any) + + default = { + + small_32vcpu = { + + nw01 = { // Hostname + ec2_instance_type = "m5.8xlarge" + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 0 + + disk_volume_count_hana_log = 0 + + disk_volume_count_hana_shared = 0 + + disk_volume_count_anydb = 2 + disk_volume_type_anydb = "gp3" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_anydb = 320 + #disk_volume_iops_anydb = + lvm_enable_anydb = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_anydb = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_anydb = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_mount_path_anydb = "/sybase" + filesystem_anydb = "xfs" + physical_partition_filesystem_block_size_anydb = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_usr_sap = 1 // max of 1 + disk_volume_type_usr_sap = "gp3" + disk_volume_capacity_usr_sap = 256 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 1 // max of 1 + disk_volume_type_sapmnt = "gp3" + disk_volume_capacity_sapmnt = 56 + filesystem_sapmnt = "xfs" + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "gp3" + disk_volume_capacity_swap = 64 + filesystem_swap = "xfs" + + } + + } + + } +} diff --git a/sap_solman_sapase_single_node_install/aws_ec2_instance/variable_map_os.tf b/sap_solman_sapase_single_node_install/aws_ec2_instance/variable_map_os.tf new file mode 100644 index 0000000..6e9483c --- /dev/null +++ b/sap_solman_sapase_single_node_install/aws_ec2_instance/variable_map_os.tf @@ -0,0 +1,48 @@ + +variable "map_os_image_regex" { + + description = "Map of operating systems OS Image regex, to identify latest OS Image for the OS major.minor version" + + type = map(any) + + default = { + + rhel-8-1 = "*RHEL-8.1*_HVM*x86_64*" + + rhel-8-2 = "*RHEL-8.2*_HVM*x86_64*" + + rhel-8-4 = "*RHEL-8.4*_HVM*x86_64*" + + rhel-8-6 = "*RHEL-8.6*_HVM*x86_64*" + + rhel-7-7-sap-ha = "*RHEL-SAP-7.7*" + + rhel-7-9-sap-ha = "*RHEL-SAP-7.9*" + + rhel-8-1-sap-ha = "*RHEL-SAP-8.1.0*" + + rhel-8-2-sap-ha = "*RHEL-SAP-8.2.0*" + + rhel-8-4-sap-ha = "*RHEL-SAP-8.4.0*" + + rhel-8-6-sap-ha = "*RHEL-SAP-8.6.0*" + + sles-15-2 = "*suse-sles-15-sp2-v202*-hvm-ssd-x86_64*" + + sles-15-3 = "*suse-sles-15-sp3-v202*-hvm-ssd-x86_64*" + + sles-15-4 = "*suse-sles-15-sp4-v202*-hvm-ssd-x86_64*" + + sles-12-5-sap-ha = "*suse-sles-sap-12-sp5-v202*-hvm-ssd-x86_64*" + + sles-15-1-sap-ha = "*suse-sles-sap-15-sp1-v202*-hvm-ssd-x86_64*" + + sles-15-2-sap-ha = "*suse-sles-sap-15-sp2-v202*-hvm-ssd-x86_64*" + + sles-15-3-sap-ha = "*suse-sles-sap-15-sp3-v202*-hvm-ssd-x86_64*" + + sles-15-4-sap-ha = "*suse-sles-sap-15-sp4-v202*-hvm-ssd-x86_64*" + + } + +} diff --git a/sap_solman_sapase_single_node_install/aws_ec2_instance/variables.tf b/sap_solman_sapase_single_node_install/aws_ec2_instance/variables.tf new file mode 100644 index 0000000..858676b --- /dev/null +++ b/sap_solman_sapase_single_node_install/aws_ec2_instance/variables.tf @@ -0,0 +1,136 @@ + +variable "aws_access_key" { + description = "AWS Access Key" +} + +variable "aws_secret_key" { + description = "AWS Secret Key" +} + +variable "resource_prefix" { + description = "Prefix to resource names" +} + +variable "aws_vpc_availability_zone" { + description = "Target AWS VPC Availability Zone (the AWS Region will be calculated from this value)" +} + +variable "aws_vpc_subnet_id" { + description = "Enter existing/target VPC Subnet ID, or enter 'new' to create a VPC with a default VPC prefix range" +} + +variable "dns_root_domain" { + description = "Root Domain for Private DNS used with the Virtual Server" +} + +variable "bastion_os_image" { + description = "Bastion OS Image. This variable uses the locals mapping with regex of OS Images, and will alter bastion provisioning." +} + +variable "bastion_user" { + description = "OS User to create on Bastion host to avoid pass-through root user (e.g. bastionuser)" +} + +variable "bastion_ssh_port" { + type = number + description = "Bastion host SSH Port from IANA Dynamic Ports range (49152 to 65535)" + + validation { + condition = var.bastion_ssh_port > 49152 && var.bastion_ssh_port < 65535 + error_message = "Bastion host SSH Port must fall within IANA Dynamic Ports range (49152 to 65535)." + } +} + +variable "host_specification_plan" { + description = "Host specification plans are small_32vcpu. This variable uses the locals mapping with a nested list of host specifications, and will alter host provisioning." +} + +variable "host_os_image" { + description = "Host OS Image. This variable uses the locals mapping with regex of OS Images, and will alter host provisioning." +} + +variable "disk_volume_capacity_software" { + type = number + description = "Disk volume capacity for downloads of SAP Software" +} + +variable "disk_volume_type_software" { + description = "Disk volume type for downloads of SAP Software" +} + +variable "sap_software_download_directory" { + description = "Mount point for downloads of SAP Software" + + validation { + error_message = "Directory must start with forward slash." + condition = can(regex("^/", var.sap_software_download_directory)) + } + +} + + + +variable "sap_id_user" { + description = "Ansible - Please enter your SAP ID user (e.g. S-User)" +} + +variable "sap_id_user_password" { + description = "Ansible - Please enter your SAP ID password" +} + +variable "sap_anydb_install_master_password" { + description = "Ansible - SAP AnyDB install: set common initial password (e.g. NewPass@321)" +} + +variable "sap_anydb_install_sid" { + description = "Ansible - SAP AnyDB install: System ID (e.g. AS1)" +} + +variable "sap_anydb_install_instance_number" { + description = "Ansible - SAP AnyDB install: Instance Number (e.g. 90)" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_anydb_install_instance_number)) + } + +} + + +#variable "sap_swpm_template_selected" { +# description = "Ansible - Select template to use: sap_solman_72_sr2_sapase_onehost" +#} + +variable "sap_nwas_install_sid" { + description = "Ansible - SAP NetWeaver AS (ABAP) install: System ID (e.g. N01)" +} + +variable "sap_nwas_java_ci_instance_no" { + description = "Ansible - SAP NetWeaver AS (JAVA) - JAVA Central Instance (CI) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_java_ci_instance_no)) + } + +} + +variable "sap_nwas_abap_ascs_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - ABAP Central Services (ASCS) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_ascs_instance_no)) + } + +} + +variable "sap_nwas_abap_pas_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - Primary Application Server instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_pas_instance_no)) + } + +} diff --git a/sap_solman_sapase_single_node_install/aws_ec2_instance/variables_generic_for_cli.tfvars b/sap_solman_sapase_single_node_install/aws_ec2_instance/variables_generic_for_cli.tfvars new file mode 100644 index 0000000..cb3d9a8 --- /dev/null +++ b/sap_solman_sapase_single_node_install/aws_ec2_instance/variables_generic_for_cli.tfvars @@ -0,0 +1,33 @@ +resource_prefix = "sap" + +dns_root_domain = "poc.cloud" + +bastion_os_image = "rhel-8-4-sap-ha" + +bastion_user = "bastionuser" + +bastion_ssh_port = 50222 + +host_specification_plan = "small_32vcpu" + +host_os_image = "rhel-8-4-sap-ha" + +disk_volume_capacity_software = 304 + +disk_volume_type_software = "gp3" + +sap_anydb_install_master_password = "NewPass@321" + +sap_anydb_install_sid = "AS1" + +sap_anydb_install_instance_number = "10" + +sap_nwas_abap_ascs_instance_no = "01" + +sap_nwas_abap_pas_instance_no = "00" + +sap_nwas_install_sid = "N01" + +sap_nwas_java_ci_instance_no = "20" + +sap_software_download_directory = "/software" diff --git a/sap_solman_sapase_single_node_install/aws_ec2_instance/versions.tf b/sap_solman_sapase_single_node_install/aws_ec2_instance/versions.tf new file mode 100644 index 0000000..f3d8ef7 --- /dev/null +++ b/sap_solman_sapase_single_node_install/aws_ec2_instance/versions.tf @@ -0,0 +1,29 @@ +# Terraform declaration + +terraform { + required_version = ">= 1.0" + required_providers { + aws = { + #source = "localdomain/provider/aws" // Local, on macOS path to place files would be $HOME/.terraform.d/plugins/localdomain/provider/aws/1.xx.xx/darwin_amd6 + source = "hashicorp/aws" // Terraform Registry + version = ">=3.73.0" + } + } +} + + +# Terraform Provider declaration + +provider "aws" { + + # Define Provider inputs manually + # access_key = "xxxxxxx" + # secret_key = "xxxxxxx" + # region = "xxxxxxx" + + # Define Provider inputs from given Terraform Variables + access_key = var.aws_access_key + secret_key = var.aws_secret_key + region = local.aws_region + +} diff --git a/sap_solman_sapase_single_node_install/gcp_ce_vm/main.tf b/sap_solman_sapase_single_node_install/gcp_ce_vm/main.tf new file mode 100644 index 0000000..2f4917f --- /dev/null +++ b/sap_solman_sapase_single_node_install/gcp_ce_vm/main.tf @@ -0,0 +1,293 @@ + +module "run_ansible_dry_run" { + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_nwas_java_sapase_install?ref=main" + + module_var_dry_run_test = "x86_64" // x86_64 or ppc64le + + # Terraform Module Variables which are mandatory, all with an empty string + module_var_bastion_boolean = false + module_var_bastion_user = "" + module_var_bastion_ssh_port = 0 + module_var_bastion_private_ssh_key = "" + module_var_bastion_floating_ip = "" + module_var_host_private_ssh_key = "" + module_var_host_private_ip = "" + module_var_hostname = "software_media_dry_run" + module_var_dns_root_domain_name = "" + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + module_var_sap_swpm_sid = "" + module_var_sap_swpm_db_schema_abap = "" + module_var_sap_swpm_db_schema_abap_password = "" + module_var_sap_swpm_ddic_000_password = "" + module_var_sap_swpm_template_selected = "sap_solman_72_sr2_sapase_onehost" + +} + + +module "run_account_init_module" { + + depends_on = [ + module.run_ansible_dry_run + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/account_init?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_region = local.google_cloud_region + module_var_gcp_vpc_subnet_create_boolean = local.google_cloud_vpc_subnet_create_boolean + module_var_gcp_vpc_subnet_name = local.google_cloud_vpc_subnet_create_boolean ? 0 : var.google_cloud_vpc_subnet_name + +} + + +module "run_account_bootstrap_module" { + + depends_on = [ + module.run_account_init_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/account_bootstrap?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_vpc_subnet_name = module.run_account_init_module.output_vpc_subnet_name + + module_var_dns_root_domain_name = var.dns_root_domain + +} + + +module "run_bastion_inject_module" { + + depends_on = [ + module.run_account_bootstrap_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/bastion_inject?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_region = local.google_cloud_region + module_var_gcp_region_zone = var.google_cloud_region_zone + module_var_gcp_vpc_subnet_name = module.run_account_init_module.output_vpc_subnet_name + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_os_image = var.map_os_image_regex[var.bastion_os_image] + + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + module_var_bastion_public_ssh_key = module.run_account_bootstrap_module.output_bastion_public_ssh_key + +} + + +module "run_host_network_access_sap_module" { + + depends_on = [ + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/host_network_access_sap?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_vpc_subnet_name = module.run_account_init_module.output_vpc_subnet_name + + module_var_sap_nwas_abap_pas_instance_no = "" + module_var_sap_nwas_java_ci_instance_no = var.sap_nwas_java_ci_instance_no + module_var_sap_hana_instance_no = "" + +} + + +module "run_host_network_access_sap_public_via_proxy_module" { + + depends_on = [ + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/host_network_access_sap_public_via_proxy?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_vpc_subnet_name = module.run_account_init_module.output_vpc_subnet_name + + module_var_sap_nwas_abap_pas_instance_no = "" + module_var_sap_nwas_java_ci_instance_no = var.sap_nwas_java_ci_instance_no + module_var_sap_hana_instance_no = "" + + module_var_bastion_subnet_name = module.run_bastion_inject_module.output_bastion_subnet_name + +} + + +module "run_host_provision_module" { + + depends_on = [ + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/host_provision?ref=main" + + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_region_zone = var.google_cloud_region_zone + module_var_gcp_vpc_subnet_name = module.run_account_init_module.output_vpc_subnet_name + + module_var_dns_root_domain_name = var.dns_root_domain + module_var_dns_zone_name = module.run_account_bootstrap_module.output_dns_zone_name + + module_var_host_os_image = var.map_os_image_regex[var.host_os_image] + + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_user = var.bastion_user + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + module_var_bastion_ip = module.run_bastion_inject_module.output_bastion_ip + + module_var_host_ssh_public_key = module.run_account_bootstrap_module.output_host_public_ssh_key + module_var_host_ssh_private_key = module.run_account_bootstrap_module.output_host_private_ssh_key + + + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable with nested objects + + for_each = toset([ + for key, value in var.map_host_specifications[var.host_specification_plan] : key + ]) + + module_var_virtual_machine_hostname = each.key + + module_var_virtual_machine_profile = var.map_host_specifications[var.host_specification_plan][each.key].virtual_machine_profile + + module_var_disk_volume_count_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data + module_var_disk_volume_type_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data + module_var_disk_volume_capacity_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_data + module_var_disk_volume_iops_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_data : null + module_var_lvm_enable_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data + module_var_lvm_pv_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_data : 0 + module_var_lvm_vg_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_data : 0 + module_var_lvm_vg_physical_extent_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_data : 0 + module_var_lvm_lv_stripe_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_data : 0 + module_var_filesystem_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_data + module_var_physical_partition_filesystem_block_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_data + + module_var_disk_volume_count_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log + module_var_disk_volume_type_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log + module_var_disk_volume_capacity_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_log + module_var_disk_volume_iops_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_log : null + module_var_lvm_enable_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log + module_var_lvm_pv_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_log : 0 + module_var_lvm_vg_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_log : 0 + module_var_lvm_vg_physical_extent_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_log : 0 + module_var_lvm_lv_stripe_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_log : 0 + module_var_filesystem_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_log + module_var_physical_partition_filesystem_block_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_log + + module_var_disk_volume_count_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared + module_var_disk_volume_type_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared + module_var_disk_volume_capacity_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_shared + module_var_disk_volume_iops_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_shared : null + module_var_lvm_enable_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared + module_var_lvm_pv_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_shared : 0 + module_var_lvm_vg_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_shared : 0 + module_var_lvm_vg_physical_extent_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_shared : 0 + module_var_lvm_lv_stripe_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_shared : 0 + module_var_filesystem_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_shared + module_var_physical_partition_filesystem_block_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_shared + + module_var_disk_volume_count_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb + module_var_disk_volume_type_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb + module_var_disk_volume_capacity_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_anydb + module_var_disk_volume_iops_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_anydb : null + module_var_lvm_enable_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb + module_var_lvm_pv_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_anydb : 0 + module_var_lvm_vg_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_anydb : 0 + module_var_lvm_vg_physical_extent_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_anydb : 0 + module_var_lvm_lv_stripe_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_anydb : 0 + module_var_filesystem_mount_path_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_mount_path_anydb + module_var_filesystem_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_anydb + module_var_physical_partition_filesystem_block_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_anydb + + module_var_disk_volume_count_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_usr_sap + module_var_disk_volume_type_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_usr_sap + module_var_disk_volume_capacity_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_usr_sap + module_var_filesystem_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_usr_sap + + module_var_disk_volume_count_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_sapmnt + module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt + module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt + module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation + + module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb + module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap + module_var_disk_volume_type_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_swap : 0 + module_var_disk_volume_capacity_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_swap : 0 + module_var_filesystem_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].filesystem_swap : 0 + + module_var_disk_volume_type_software = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_software + module_var_disk_volume_capacity_software = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_software + module_var_sap_software_download_directory = var.sap_software_download_directory + +} + + +module "run_ansible_sap_solman_java_sapase_install" { + + depends_on = [module.run_host_provision_module] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=dev" + + + # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) + module_var_bastion_boolean = true // required as true boolean for any Cloud Service Provider (CSP) + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_floating_ip = module.run_bastion_inject_module.output_bastion_ip + + module_var_host_private_ssh_key = module.run_account_bootstrap_module.output_host_private_ssh_key + + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable at runtime + + for_each = module.run_host_provision_module + module_var_host_private_ip = join(", ", each.value.*.output_host_private_ip) + module_var_hostname = join(", ", each.value.*.output_host_name) + module_var_dns_root_domain_name = var.dns_root_domain + + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + + module_var_sap_anydb_install_sid = var.sap_anydb_install_sid + module_var_sap_anydb_install_instance_number = var.sap_anydb_install_instance_number + + module_var_sap_swpm_sid = var.sap_nwas_install_sid + + module_var_sap_swpm_db_schema_abap = "SAPJAVA1" + module_var_sap_swpm_db_schema_abap_password = var.sap_anydb_install_master_password + module_var_sap_swpm_db_system_password = var.sap_anydb_install_master_password + module_var_sap_swpm_db_systemdb_password = var.sap_anydb_install_master_password + module_var_sap_swpm_db_sidadm_password = var.sap_anydb_install_master_password + module_var_sap_swpm_ddic_000_password = var.sap_anydb_install_master_password + + module_var_sap_swpm_ascs_instance_nr = var.sap_nwas_abap_ascs_instance_no + module_var_sap_swpm_pas_instance_nr = var.sap_nwas_abap_pas_instance_no + + module_var_sap_swpm_nwas_java_instance_nr = var.sap_nwas_java_ci_instance_no + + module_var_sap_swpm_master_password = var.sap_anydb_install_master_password + + module_var_sap_swpm_template_selected = "sap_solman_72_sr2_sapase_onehost" + + module_var_filesystem_mount_path_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_mount_path_anydb + + module_var_sap_software_download_directory = var.sap_software_download_directory + +} diff --git a/sap_solman_sapase_single_node_install/gcp_ce_vm/outputs.tf b/sap_solman_sapase_single_node_install/gcp_ce_vm/outputs.tf new file mode 100644 index 0000000..0759d42 --- /dev/null +++ b/sap_solman_sapase_single_node_install/gcp_ce_vm/outputs.tf @@ -0,0 +1,211 @@ + +############################################################## +# Export SSH key to file on local +############################################################## + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "bastion_rsa" { + content = module.run_account_bootstrap_module.output_bastion_private_ssh_key + filename = "${path.root}/ssh/bastion_rsa" + file_permission = "0400" +} + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "hosts_rsa" { + content = module.run_account_bootstrap_module.output_host_private_ssh_key + filename = "${path.root}/ssh/hosts_rsa" + file_permission = "0400" +} + + +output "ssh_sap_connection_details" { + value = local.is_wsl ? "IGNORE" : <>> Chosen option $REPLY: $opt" + select opt_ip in "$${target_host_array[@]}"; do + if [ $opt_ip = "Quit" ]; then break 2; fi + target_ip=$opt_ip + echo "---- Selected option $REPLY, tunneling into $target_ip ----" + break + done + echo "" + echo "#### HTTP/S JAVA endpoints: ####" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N \ + $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file \ + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -L localhost:5$${sap_nwas_java_ci_instance_no}00:$target_ip:5$${sap_nwas_java_ci_instance_no}01 \ + -L localhost:5$${sap_nwas_java_ci_instance_no}20:$target_ip:5$${sap_nwas_java_ci_instance_no}20 \ + -L localhost:5$${sap_nwas_java_ci_instance_no}13:$target_ip:5$${sap_nwas_java_ci_instance_no}14 + break + ;; + "OS root access, via SSH stdin/stdout forwarding proxy") + echo ">>> Chosen option $REPLY: $opt" + select opt_ssh in "$${target_host_array[@]}"; do + if [ $opt_ssh = "Quit" ]; then break 2; fi + target_ip=$opt_ssh + echo "---- Selected option $REPLY, logging into $target_ip ----" + break + done + + if [ -n "$target_ip" ]; then + ssh -i $target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + fi + break + ;; + "Quit") + break + ;; + *) echo "Invalid option $REPLY" ;; + esac + done +} + +# Then call shell function and select which target +sshjump + +EOF +} + + +# If detected Windows WSL2, then find the installed name using external resource to return a JSON string +data "external" "wsl_distro_name" { + count = local.is_wsl ? 1 : 0 + program = ["bash", "-c", "echo \"{\\\"stdout\\\":\\\"$(echo $WSL_DISTRO_NAME)\\\"}\""] +} + +output "ssh_sap_connection_details_windows" { + value = local.not_wsl ? "IGNORE" : <>> Chosen option $(PSItem)" + echo "" + echo "#### HTTP/S JAVA endpoints: ####" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N ` + $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -L localhost:5$${sap_nwas_java_ci_instance_no}00:$${target_ip}:5$${sap_nwas_java_ci_instance_no}01 ` + -L localhost:5$${sap_nwas_java_ci_instance_no}20:$${target_ip}:5$${sap_nwas_java_ci_instance_no}20 ` + -L localhost:5$${sap_nwas_java_ci_instance_no}13:$${target_ip}:5$${sap_nwas_java_ci_instance_no}14 + } + } + 2 { + foreach ($target_host in $target_host_array) { + $i=$target_host_array.IndexOf($target_host) + echo "$i) $target_host" + } + $target_host_selection = Read-Host "Please make a selection" + if ($target_host_array[$target_host_selection] -eq "Quit" ){ + break + }else { + $target_ip = $target_host_array[$target_host_selection] + #echo ">>> Chosen option $(PSItem)" + ssh -i $temp_target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + } + } + 3 { + break + } + } +} + +EOF + +} diff --git a/sap_solman_sapase_single_node_install/gcp_ce_vm/variable_locals.tf b/sap_solman_sapase_single_node_install/gcp_ce_vm/variable_locals.tf new file mode 100644 index 0000000..8f30669 --- /dev/null +++ b/sap_solman_sapase_single_node_install/gcp_ce_vm/variable_locals.tf @@ -0,0 +1,19 @@ +locals { + + google_cloud_vpc_subnet_create_boolean = var.google_cloud_vpc_subnet_name == "new" ? true : false + + google_cloud_region = replace(var.google_cloud_region_zone, "/-[^-]*$/", "") + + # Directories start with "C:..." on Windows; All other OSs use "/" for root. + detect_windows = substr(pathexpand("~"), 0, 1) == "/" ? false : true + detect_shell = substr(pathexpand("~"), 0, 1) == "/" ? true : false + + # Used for displaying Shell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + not_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? false : true : true + + # Used for displaying Windows PowerShell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + is_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? true : false : false + +} diff --git a/sap_solman_sapase_single_node_install/gcp_ce_vm/variable_map_hosts.tf b/sap_solman_sapase_single_node_install/gcp_ce_vm/variable_map_hosts.tf new file mode 100644 index 0000000..092a1b3 --- /dev/null +++ b/sap_solman_sapase_single_node_install/gcp_ce_vm/variable_map_hosts.tf @@ -0,0 +1,64 @@ + +variable "map_host_specifications" { + + description = "Map of host specficiations for SAP NetWeaver AS (JAVA) with SAP ASE single node install" + + type = map(any) + + default = { + + small_32vcpu = { + + nw01 = { // Hostname + virtual_machine_profile = "n2-standard-32" // 32 vCPU, 128GB Memory + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 0 + + disk_volume_count_hana_log = 0 + + disk_volume_count_hana_shared = 0 + + disk_volume_count_anydb = 0 + + disk_volume_count_anydb = 2 + disk_volume_type_anydb = "pd-standard" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_anydb = 320 + #disk_volume_iops_anydb = + lvm_enable_anydb = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_anydb = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_anydb = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_mount_path_anydb = "/sybase" + filesystem_anydb = "xfs" + physical_partition_filesystem_block_size_anydb = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_usr_sap = 1 // max of 1 + disk_volume_type_usr_sap = "pd-standard" + disk_volume_capacity_usr_sap = 256 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 1 // max of 1 + disk_volume_type_sapmnt = "pd-standard" + disk_volume_capacity_sapmnt = 56 + filesystem_sapmnt = "xfs" + nfs_boolean_sapmnt = true + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "pd-standard" + disk_volume_capacity_swap = 64 + filesystem_swap = "xfs" + + disk_volume_type_software = "pd-standard" + disk_volume_capacity_software = 100 + } + + } + + } + +} + diff --git a/sap_solman_sapase_single_node_install/gcp_ce_vm/variable_map_os.tf b/sap_solman_sapase_single_node_install/gcp_ce_vm/variable_map_os.tf new file mode 100644 index 0000000..954ecd3 --- /dev/null +++ b/sap_solman_sapase_single_node_install/gcp_ce_vm/variable_map_os.tf @@ -0,0 +1,79 @@ + +# There is no Terraform Resource for data lookup of all GCP OS Images, therefore the input does not use wildcard + +variable "map_os_image_regex" { + + description = "Map of operating systems OS Image, static OS Image names, to identify latest OS Image for the OS major.minor version" + + type = map(any) + + default = { + + rhel-8-latest = { + project = "rhel-cloud" + family = "rhel-8" + }, + + rhel-7-7-sap-ha = { + project = "rhel-sap-cloud" + family = "rhel-7-7-sap-ha" + }, + + rhel-7-9-sap-ha = { + project = "rhel-sap-cloud" + family = "rhel-7-9-sap-ha" + }, + + rhel-8-1-sap-ha = { + project = "rhel-sap-cloud" + family = "rhel-8-1-sap-ha" + }, + + rhel-8-2-sap-ha = { + project = "rhel-sap-cloud" + family = "rhel-8-2-sap-ha" + }, + + rhel-8-4-sap-ha = { + project = "rhel-sap-cloud" + family = "rhel-8-4-sap-ha" + }, + + rhel-8-6-sap-ha = { + project = "rhel-sap-cloud" + family = "rhel-8-6-sap-ha" + }, + + sles-15-latest = { + project = "suse-cloud" + family = "sles-15" + }, + + sles-12-sp5-sap = { + project = "suse-sap-cloud" + family = "sles-12-sp5-sap" + }, + + sles-15-sp1-sap = { + project = "suse-sap-cloud" + family = "sles-15-sp1-sap" + }, + + sles-15-sp2-sap = { + project = "suse-sap-cloud" + family = "sles-15-sp2-sap" + }, + + sles-15-sp3-sap = { + project = "suse-sap-cloud" + family = "sles-15-sp3-sap" + }, + + sles-15-sp4-sap = { + project = "suse-sap-cloud" + family = "sles-15-sp4-sap" + }, + + } + +} diff --git a/sap_solman_sapase_single_node_install/gcp_ce_vm/variables.tf b/sap_solman_sapase_single_node_install/gcp_ce_vm/variables.tf new file mode 100644 index 0000000..a098de5 --- /dev/null +++ b/sap_solman_sapase_single_node_install/gcp_ce_vm/variables.tf @@ -0,0 +1,127 @@ + +variable "google_cloud_project" { + description = "Target GCP Project ID" +} + +variable "google_cloud_region_zone" { + description = "Target GCP Zone, the GCP Region will be calculated from this value (e.g. europe-west9-a)" +} + +variable "google_cloud_credentials_json" { + description = "Enter path to GCP Key File for Service Account (or Google Application Default Credentials JSON file for GCloud CLI)" +} + +variable "google_cloud_vpc_subnet_name" { + description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC" +} + +variable "resource_prefix" { + description = "Prefix to resource names" +} + +variable "dns_root_domain" { + description = "Root Domain for Private DNS used with the Virtual Machine" +} + +variable "bastion_os_image" { + description = "Bastion OS Image. This variable uses the locals mapping with regex of OS Images, and will alter bastion provisioning." +} + +variable "bastion_user" { + description = "OS User to create on Bastion host to avoid pass-through root user (e.g. bastionuser)" +} + +variable "bastion_ssh_port" { + type = number + description = "Bastion host SSH Port from IANA Dynamic Ports range (49152 to 65535)" + + validation { + condition = var.bastion_ssh_port > 49152 && var.bastion_ssh_port < 65535 + error_message = "Bastion host SSH Port must fall within IANA Dynamic Ports range (49152 to 65535)." + } +} + +variable "host_specification_plan" { + description = "Host specification plans are small_32vcpu. This variable uses the locals mapping with a nested list of host specifications, and will alter host provisioning." +} + +variable "host_os_image" { + description = "Host OS Image. This variable uses the locals mapping with regex of OS Images, and will alter host provisioning." +} + +variable "sap_software_download_directory" { + description = "Mount point for downloads of SAP Software" + + validation { + error_message = "Directory must start with forward slash." + condition = can(regex("^/", var.sap_software_download_directory)) + } + +} + + + +variable "sap_id_user" { + description = "Ansible - Please enter your SAP ID user (e.g. S-User)" +} + +variable "sap_id_user_password" { + description = "Ansible - Please enter your SAP ID password" +} + +variable "sap_anydb_install_master_password" { + description = "Ansible - SAP AnyDB install: set common initial password (e.g. NewPass@321)" +} + +variable "sap_anydb_install_sid" { + description = "Ansible - SAP AnyDB install: System ID (e.g. AS1)" +} + +variable "sap_anydb_install_instance_number" { + description = "Ansible - SAP AnyDB install: Instance Number (e.g. 90)" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_anydb_install_instance_number)) + } + +} + + +#variable "sap_swpm_template_selected" { +# description = "Ansible - Select template to use: sap_solman_72_sr2_sapase_onehost" +#} + +variable "sap_nwas_install_sid" { + description = "Ansible - SAP NetWeaver AS (ABAP) install: System ID (e.g. N01)" +} + +variable "sap_nwas_java_ci_instance_no" { + description = "Ansible - SAP NetWeaver AS (JAVA) - JAVA Central Instance (CI) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_java_ci_instance_no)) + } + +} + +variable "sap_nwas_abap_ascs_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - ABAP Central Services (ASCS) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_ascs_instance_no)) + } + +} + +variable "sap_nwas_abap_pas_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - Primary Application Server instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_pas_instance_no)) + } + +} diff --git a/sap_solman_sapase_single_node_install/gcp_ce_vm/variables_generic_for_cli.tfvars b/sap_solman_sapase_single_node_install/gcp_ce_vm/variables_generic_for_cli.tfvars new file mode 100644 index 0000000..2f75b86 --- /dev/null +++ b/sap_solman_sapase_single_node_install/gcp_ce_vm/variables_generic_for_cli.tfvars @@ -0,0 +1,30 @@ + +resource_prefix = "sap" + +dns_root_domain = "poc.cloud" + +bastion_os_image = "rhel-8-latest" + +bastion_user = "bastionuser" + +bastion_ssh_port = 50222 + +host_specification_plan = "small_32vcpu" + +host_os_image = "rhel-8-4-sap-ha" + +sap_anydb_install_master_password = "NewPass@321" + +sap_anydb_install_sid = "AS1" + +sap_anydb_install_instance_number = "10" + +sap_nwas_abap_ascs_instance_no = "01" + +sap_nwas_abap_pas_instance_no = "00" + +sap_nwas_install_sid = "N01" + +sap_nwas_java_ci_instance_no = "20" + +sap_software_download_directory = "/software" diff --git a/sap_solman_sapase_single_node_install/gcp_ce_vm/versions.tf b/sap_solman_sapase_single_node_install/gcp_ce_vm/versions.tf new file mode 100644 index 0000000..346ab78 --- /dev/null +++ b/sap_solman_sapase_single_node_install/gcp_ce_vm/versions.tf @@ -0,0 +1,34 @@ +# Terraform declaration + +terraform { + required_version = ">= 1.0" + required_providers { + google = { + #source = "localdomain/provider/google" // Local, on macOS path to place files would be $HOME/.terraform.d/plugins/localdomain/provider/google/1.xx.xx/darwin_amd6 + source = "hashicorp/google" // Terraform Registry + version = ">=4.50.0" + } + } +} + +# Terraform Provider declaration +# +# Nested provider configurations cannot be used with depends_on meta-argument between modules +# +# The calling module block can use either: +# - "providers" argument in the module block +# - none, inherit default (un-aliased) provider configuration +# +# Therefore the below is blank and is only for reference if this module needs to be executed manually + + +# Terraform Provider declaration + +provider "google" { + project = var.google_cloud_project + region = local.google_cloud_region + zone = var.google_cloud_region_zone + + credentials = var.google_cloud_credentials_json + +} diff --git a/sap_solman_sapase_single_node_install/ibmcloud_vs/main.tf b/sap_solman_sapase_single_node_install/ibmcloud_vs/main.tf new file mode 100644 index 0000000..bb7f1b9 --- /dev/null +++ b/sap_solman_sapase_single_node_install/ibmcloud_vs/main.tf @@ -0,0 +1,331 @@ + +module "run_ansible_dry_run" { + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=dev" + + module_var_dry_run_test = "x86_64" // x86_64 or ppc64le + + # Terraform Module Variables which are mandatory, all with an empty string + module_var_bastion_boolean = false + module_var_bastion_user = "" + module_var_bastion_ssh_port = 0 + module_var_bastion_private_ssh_key = "" + module_var_bastion_floating_ip = "" + module_var_host_private_ssh_key = "" + module_var_host_private_ip = "" + module_var_hostname = "software_media_dry_run" + module_var_dns_root_domain_name = "" + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + module_var_sap_swpm_sid = "" + module_var_sap_swpm_db_schema_abap = "" + module_var_sap_swpm_db_schema_abap_password = "" + module_var_sap_swpm_ddic_000_password = "" + module_var_sap_swpm_template_selected = "sap_solman_72_sr2_sapase_onehost" +} + + +module "run_account_init_module" { + + depends_on = [ + module.run_ansible_dry_run + ] + + # Use GitHub API to identify latest Terraform Modules for SAP release and use as HTTP ZIP for the Terraform Module Source and use sub-directory + # (https://developer.hashicorp.com/terraform/language/modules/sources#http-urls) + #source = "https://api.github.com/repos/sap-linuxlab/terraform.modules_for_sap/zipball//*/ibmcloud_vs/account_init?archive=zip" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_init?ref=0.7.5" + + module_var_resource_group_name = local.resource_group_create_boolean ? 0 : var.ibmcloud_resource_group + module_var_resource_group_create_boolean = local.resource_group_create_boolean + + module_var_resource_prefix = var.resource_prefix + + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? 0 : var.ibmcloud_vpc_subnet_name + module_var_ibmcloud_vpc_subnet_create_boolean = local.ibmcloud_vpc_subnet_create_boolean + module_var_ibmcloud_vpc_availability_zone = var.ibmcloud_vpc_availability_zone + +} + + +module "run_account_bootstrap_module" { + + depends_on = [ + module.run_account_init_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_bootstrap?ref=dev" + + module_var_resource_group_id = module.run_account_init_module.output_resource_group_id + module_var_resource_prefix = var.resource_prefix + + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name + module_var_ibmcloud_vpc_availability_zone = var.ibmcloud_vpc_availability_zone + + module_var_dns_root_domain_name = var.dns_root_domain + +} + + +module "run_account_iam_module" { + + depends_on = [ + module.run_account_bootstrap_module + ] + + count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=dev" + + module_var_resource_group_id = module.run_account_init_module.output_resource_group_id + module_var_resource_prefix = var.resource_prefix + +} + + +module "run_bastion_inject_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/bastion_inject?ref=dev" + + module_var_resource_group_id = module.run_account_init_module.output_resource_group_id + module_var_resource_prefix = var.resource_prefix + module_var_resource_tags = var.resource_tags + + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_ssh_key_id = module.run_account_bootstrap_module.output_bastion_ssh_key_id + module_var_bastion_public_ssh_key = module.run_account_bootstrap_module.output_bastion_public_ssh_key + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_os_image = var.map_os_image_regex[var.bastion_os_image] + +} + + +module "run_host_network_access_sap_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_network_access_sap?ref=dev" + + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name + module_var_host_security_group_id = module.run_account_bootstrap_module.output_host_security_group_id + + + module_var_sap_nwas_abap_ascs_instance_no = var.sap_nwas_abap_ascs_instance_no + module_var_sap_nwas_abap_pas_instance_no = var.sap_nwas_abap_pas_instance_no + module_var_sap_nwas_java_ci_instance_no = var.sap_nwas_java_ci_instance_no + module_var_sap_hana_instance_no = "" + +} + + +module "run_host_network_access_sap_public_via_proxy_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_network_access_sap_public_via_proxy?ref=dev" + + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name + + module_var_bastion_security_group_id = module.run_bastion_inject_module.output_bastion_security_group_id + module_var_bastion_connection_security_group_id = module.run_bastion_inject_module.output_bastion_connection_security_group_id + module_var_host_security_group_id = module.run_account_bootstrap_module.output_host_security_group_id + + module_var_sap_nwas_abap_pas_instance_no = var.sap_nwas_abap_pas_instance_no + module_var_sap_nwas_java_ci_instance_no = var.sap_nwas_java_ci_instance_no + module_var_sap_hana_instance_no = "" + +} + + +module "run_host_provision_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_provision?ref=dev" + + # Set Terraform Module Variables using Terraform Variables at runtime + + module_var_resource_group_id = module.run_account_init_module.output_resource_group_id + module_var_resource_prefix = var.resource_prefix + module_var_resource_tags = var.resource_tags + + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_floating_ip = module.run_bastion_inject_module.output_bastion_ip + module_var_bastion_connection_security_group_id = module.run_bastion_inject_module.output_bastion_connection_security_group_id + + module_var_host_ssh_key_id = module.run_account_bootstrap_module.output_host_ssh_key_id + module_var_host_private_ssh_key = module.run_account_bootstrap_module.output_host_private_ssh_key + module_var_host_security_group_id = module.run_account_bootstrap_module.output_host_security_group_id + + module_var_host_os_image = var.map_os_image_regex[var.host_os_image] + + module_var_dns_root_domain_name = var.dns_root_domain + module_var_dns_services_instance = module.run_account_bootstrap_module.output_host_dns_services_instance + + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable with nested objects + + for_each = toset([ + for key, value in var.map_host_specifications[var.host_specification_plan] : key + ]) + + module_var_virtual_server_hostname = each.key + + module_var_virtual_server_profile = var.map_host_specifications[var.host_specification_plan][each.key].virtual_server_profile + + module_var_disk_volume_count_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data + module_var_disk_volume_type_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data + module_var_disk_volume_capacity_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_data + module_var_disk_volume_iops_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_data : null + module_var_lvm_enable_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data + module_var_lvm_pv_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_data : 0 + module_var_lvm_vg_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_data : 0 + module_var_lvm_vg_physical_extent_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_data : 0 + module_var_lvm_lv_stripe_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_data : 0 + module_var_filesystem_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_data + module_var_physical_partition_filesystem_block_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_data + + module_var_disk_volume_count_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log + module_var_disk_volume_type_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log + module_var_disk_volume_capacity_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_log + module_var_disk_volume_iops_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_log : null + module_var_lvm_enable_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log + module_var_lvm_pv_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_log : 0 + module_var_lvm_vg_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_log : 0 + module_var_lvm_vg_physical_extent_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_log : 0 + module_var_lvm_lv_stripe_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_log : 0 + module_var_filesystem_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_log + module_var_physical_partition_filesystem_block_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_log + + module_var_disk_volume_count_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared + module_var_disk_volume_type_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared + module_var_disk_volume_capacity_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_shared + module_var_disk_volume_iops_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_shared : null + module_var_lvm_enable_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared + module_var_lvm_pv_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_shared : 0 + module_var_lvm_vg_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_shared : 0 + module_var_lvm_vg_physical_extent_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_shared : 0 + module_var_lvm_lv_stripe_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_shared : 0 + module_var_filesystem_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_shared + module_var_physical_partition_filesystem_block_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_shared + + module_var_disk_volume_count_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb + module_var_disk_volume_type_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb + module_var_disk_volume_capacity_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_anydb + module_var_disk_volume_iops_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_anydb : null + module_var_lvm_enable_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb + module_var_lvm_pv_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_anydb : 0 + module_var_lvm_vg_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_anydb : 0 + module_var_lvm_vg_physical_extent_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_anydb : 0 + module_var_lvm_lv_stripe_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_anydb : 0 + module_var_filesystem_mount_path_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_mount_path_anydb + module_var_filesystem_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_anydb + module_var_physical_partition_filesystem_block_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_anydb + + module_var_disk_volume_count_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_usr_sap + module_var_disk_volume_type_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_usr_sap + module_var_disk_volume_capacity_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_usr_sap + module_var_filesystem_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_usr_sap + + module_var_disk_volume_count_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_sapmnt + module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt + module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt + module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation + + module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb + module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap + module_var_disk_volume_type_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_swap : 0 + module_var_disk_volume_capacity_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_swap : 0 + module_var_filesystem_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].filesystem_swap : 0 + + module_var_disk_volume_type_software = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_software + module_var_disk_volume_capacity_software = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_software + module_var_sap_software_download_directory = var.sap_software_download_directory + + module_var_disable_ip_anti_spoofing = false + +} + + +module "run_ansible_sap_solman_java_sapase_install" { + + depends_on = [module.run_host_provision_module] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=dev" + + + # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) + module_var_bastion_boolean = true // required as true boolean for any Cloud Service Provider (CSP) + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_floating_ip = module.run_bastion_inject_module.output_bastion_ip + + module_var_host_private_ssh_key = module.run_account_bootstrap_module.output_host_private_ssh_key + + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable at runtime + + for_each = module.run_host_provision_module + module_var_host_private_ip = join(", ", each.value.*.output_host_private_ip) + module_var_hostname = join(", ", each.value.*.output_host_name) + module_var_dns_root_domain_name = var.dns_root_domain + + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + + module_var_sap_anydb_install_sid = var.sap_anydb_install_sid + module_var_sap_anydb_install_instance_number = var.sap_anydb_install_instance_number + + module_var_sap_swpm_sid = var.sap_nwas_install_sid + + module_var_sap_swpm_db_schema_abap = "SAPJAVA1" + module_var_sap_swpm_db_schema_abap_password = var.sap_anydb_install_master_password + module_var_sap_swpm_db_system_password = var.sap_anydb_install_master_password + module_var_sap_swpm_db_systemdb_password = var.sap_anydb_install_master_password + module_var_sap_swpm_db_sidadm_password = var.sap_anydb_install_master_password + module_var_sap_swpm_ddic_000_password = var.sap_anydb_install_master_password + + module_var_sap_swpm_ascs_instance_nr = var.sap_nwas_abap_ascs_instance_no + module_var_sap_swpm_pas_instance_nr = var.sap_nwas_abap_pas_instance_no + + module_var_sap_swpm_nwas_java_instance_nr = var.sap_nwas_java_ci_instance_no + + module_var_sap_swpm_master_password = var.sap_anydb_install_master_password + + module_var_sap_swpm_template_selected = "sap_solman_72_sr2_sapase_onehost" + + module_var_filesystem_mount_path_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_mount_path_anydb + + module_var_sap_software_download_directory = var.sap_software_download_directory + +} diff --git a/sap_solman_sapase_single_node_install/ibmcloud_vs/outputs.tf b/sap_solman_sapase_single_node_install/ibmcloud_vs/outputs.tf new file mode 100644 index 0000000..0759d42 --- /dev/null +++ b/sap_solman_sapase_single_node_install/ibmcloud_vs/outputs.tf @@ -0,0 +1,211 @@ + +############################################################## +# Export SSH key to file on local +############################################################## + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "bastion_rsa" { + content = module.run_account_bootstrap_module.output_bastion_private_ssh_key + filename = "${path.root}/ssh/bastion_rsa" + file_permission = "0400" +} + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "hosts_rsa" { + content = module.run_account_bootstrap_module.output_host_private_ssh_key + filename = "${path.root}/ssh/hosts_rsa" + file_permission = "0400" +} + + +output "ssh_sap_connection_details" { + value = local.is_wsl ? "IGNORE" : <>> Chosen option $REPLY: $opt" + select opt_ip in "$${target_host_array[@]}"; do + if [ $opt_ip = "Quit" ]; then break 2; fi + target_ip=$opt_ip + echo "---- Selected option $REPLY, tunneling into $target_ip ----" + break + done + echo "" + echo "#### HTTP/S JAVA endpoints: ####" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N \ + $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file \ + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -L localhost:5$${sap_nwas_java_ci_instance_no}00:$target_ip:5$${sap_nwas_java_ci_instance_no}01 \ + -L localhost:5$${sap_nwas_java_ci_instance_no}20:$target_ip:5$${sap_nwas_java_ci_instance_no}20 \ + -L localhost:5$${sap_nwas_java_ci_instance_no}13:$target_ip:5$${sap_nwas_java_ci_instance_no}14 + break + ;; + "OS root access, via SSH stdin/stdout forwarding proxy") + echo ">>> Chosen option $REPLY: $opt" + select opt_ssh in "$${target_host_array[@]}"; do + if [ $opt_ssh = "Quit" ]; then break 2; fi + target_ip=$opt_ssh + echo "---- Selected option $REPLY, logging into $target_ip ----" + break + done + + if [ -n "$target_ip" ]; then + ssh -i $target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + fi + break + ;; + "Quit") + break + ;; + *) echo "Invalid option $REPLY" ;; + esac + done +} + +# Then call shell function and select which target +sshjump + +EOF +} + + +# If detected Windows WSL2, then find the installed name using external resource to return a JSON string +data "external" "wsl_distro_name" { + count = local.is_wsl ? 1 : 0 + program = ["bash", "-c", "echo \"{\\\"stdout\\\":\\\"$(echo $WSL_DISTRO_NAME)\\\"}\""] +} + +output "ssh_sap_connection_details_windows" { + value = local.not_wsl ? "IGNORE" : <>> Chosen option $(PSItem)" + echo "" + echo "#### HTTP/S JAVA endpoints: ####" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N ` + $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -L localhost:5$${sap_nwas_java_ci_instance_no}00:$${target_ip}:5$${sap_nwas_java_ci_instance_no}01 ` + -L localhost:5$${sap_nwas_java_ci_instance_no}20:$${target_ip}:5$${sap_nwas_java_ci_instance_no}20 ` + -L localhost:5$${sap_nwas_java_ci_instance_no}13:$${target_ip}:5$${sap_nwas_java_ci_instance_no}14 + } + } + 2 { + foreach ($target_host in $target_host_array) { + $i=$target_host_array.IndexOf($target_host) + echo "$i) $target_host" + } + $target_host_selection = Read-Host "Please make a selection" + if ($target_host_array[$target_host_selection] -eq "Quit" ){ + break + }else { + $target_ip = $target_host_array[$target_host_selection] + #echo ">>> Chosen option $(PSItem)" + ssh -i $temp_target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + } + } + 3 { + break + } + } +} + +EOF + +} diff --git a/sap_solman_sapase_single_node_install/ibmcloud_vs/outputs_debug.tf b/sap_solman_sapase_single_node_install/ibmcloud_vs/outputs_debug.tf new file mode 100644 index 0000000..c21429d --- /dev/null +++ b/sap_solman_sapase_single_node_install/ibmcloud_vs/outputs_debug.tf @@ -0,0 +1,92 @@ + +############################################################## +# DEBUG variable map +############################################################## + +# Show all Storage Test Template names defined +#output "DEBUG_show_storage_test_template_names_all" { +# value = [ +# for key, value in var.storage_test_templates_map : key +# ] +#} + +# Show each Storage Test Template object, and all the variables set therein +#output "DEBUG_show_storage_test_template_all_variables" { +# value = [ +# for key, value in var.storage_test_templates_map : value +# ] +#} + +# Show value for specific variable within each Storage Test Template object +#output "DEBUG_show_template_value_single_all_items" { +# value = [ +# for key, value in var.storage_test_templates_map : value.*.disk_volume_count_hana_data +# ] +#} + +# Show value for specific variable within each Storage Test Template, and de-duplicate e.g. unique Virtual Server Profiles used in the Storage Test Templates +#output "DEBUG_show_storage_test_template_profiles_condense" { +# value = toset([ +# for key, value in var.storage_test_templates_map : value.*.virtual_server_profile +# ]) +#} + + +# Show value for specific output from module output in one string +#output "DEBUG_show_host_storage_test_module_output_private_ip_one_string" { +# value = join(" ", flatten([for key, value in module.run_host_storage_test_template_provision_module: value.*.output_host_private_ip])) +#} + + + +############################################################## +# DEBUG Bastion - Display key values, shown after successful execution +############################################################## + +#output "bastion_display_private_key" { +# value = "\n${tls_private_key.bastion_ssh.private_key_pem}" +# sensitive = true +#} + +#output "bastion_display_public_key" { +# value = "public_key_openssh is:\n ${tls_private_key.bastion_ssh.public_key_openssh}" +#} + +############################################################## +# DEBUG Bastion - Display key values, shown before execution but with poor output +############################################################## + +#resource "null_resource" "bastion_show_keys" { +# provisioner "local-exec" { +# command = "echo '${tls_private_key.bastion_ssh.private_key_pem}'" +# } +# provisioner "local-exec" { +# command = "echo '${tls_private_key.bastion_ssh.public_key_openssh}'" +# } +#} + +############################################################## +# DEBUG Intel VS target - Display key values, shown after successful execution +############################################################## + +#output "virtual_server_display_private_key" { +# value = "\n${tls_private_key.virtual_server_ssh.private_key_pem}" +# sensitive = true +#} + +#output "virtual_server_display_public_key" { +# value = "public_key_openssh:\n ${tls_private_key.virtual_server_ssh.public_key_openssh}" +#} + +############################################################## +# DEBUG Intel VS target - Display key values, shown before execution but with poor output +############################################################## + +#resource "null_resource" "host_show_keys" { +# provisioner "local-exec" { +# command = "echo '${tls_private_key.virtual_server_ssh.private_key_pem}'" +# } +# provisioner "local-exec" { +# command = "echo '${tls_private_key.virtual_server_ssh.public_key_openssh}'" +# } +#} \ No newline at end of file diff --git a/sap_solman_sapase_single_node_install/ibmcloud_vs/variable_locals.tf b/sap_solman_sapase_single_node_install/ibmcloud_vs/variable_locals.tf new file mode 100644 index 0000000..7c05148 --- /dev/null +++ b/sap_solman_sapase_single_node_install/ibmcloud_vs/variable_locals.tf @@ -0,0 +1,28 @@ +locals { + + resource_group_create_boolean = var.ibmcloud_resource_group == "new" ? true : false + + ibmcloud_vpc_subnet_create_boolean = var.ibmcloud_vpc_subnet_name == "new" ? true : false + + ibmcloud_vpc_subnet_name_entry_is_ip = ( + can( + regex("^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)([/][0-3][0-2]?|[/][1-2][0-9]|[/][0-9])$", + var.ibmcloud_vpc_subnet_name + ) + ) ? true : false) + + ibmcloud_region = replace(var.ibmcloud_vpc_availability_zone, "/-[^-]*$/", "") + + # Directories start with "C:..." on Windows; All other OSs use "/" for root. + detect_windows = substr(pathexpand("~"), 0, 1) == "/" ? false : true + detect_shell = substr(pathexpand("~"), 0, 1) == "/" ? true : false + + # Used for displaying Shell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + not_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? false : true : true + + # Used for displaying Windows PowerShell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + is_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? true : false : false + +} diff --git a/sap_solman_sapase_single_node_install/ibmcloud_vs/variable_map_hosts.tf b/sap_solman_sapase_single_node_install/ibmcloud_vs/variable_map_hosts.tf new file mode 100644 index 0000000..93fa455 --- /dev/null +++ b/sap_solman_sapase_single_node_install/ibmcloud_vs/variable_map_hosts.tf @@ -0,0 +1,61 @@ + +variable "map_host_specifications" { + + description = "Map of host specficiations for SAP NetWeaver AS (ABAP) with SAP ASE single node install" + + type = map(any) + + default = { + + small_32vcpu = { + + nw01 = { // Hostname + virtual_server_profile = "bx2-32x128" + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 0 + + disk_volume_count_hana_log = 0 + + disk_volume_count_hana_shared = 0 + + disk_volume_count_anydb = 2 + disk_volume_type_anydb = "10iops-tier" // Does NOT use Burst IOPS storage. + disk_volume_capacity_anydb = 224 + #disk_volume_iops_anydb = + lvm_enable_anydb = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_anydb = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_anydb = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_mount_path_anydb = "/sybase" + filesystem_anydb = "xfs" + physical_partition_filesystem_block_size_anydb = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_usr_sap = 1 // max of 1 + disk_volume_type_usr_sap = "general-purpose" + disk_volume_capacity_usr_sap = 256 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 1 // max of 1 + disk_volume_type_sapmnt = "general-purpose" + disk_volume_capacity_sapmnt = 56 + filesystem_sapmnt = "xfs" + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "general-purpose" + disk_volume_capacity_swap = 64 + filesystem_swap = "xfs" + + disk_volume_type_software = "5iops-tier" + disk_volume_capacity_software = 150 + + } + + } + + } + +} diff --git a/sap_solman_sapase_single_node_install/ibmcloud_vs/variable_map_os.tf b/sap_solman_sapase_single_node_install/ibmcloud_vs/variable_map_os.tf new file mode 100644 index 0000000..16cfc85 --- /dev/null +++ b/sap_solman_sapase_single_node_install/ibmcloud_vs/variable_map_os.tf @@ -0,0 +1,42 @@ + +variable "map_os_image_regex" { + + description = "Map of operating systems OS Image regex, to identify latest OS Image for the OS major.minor version" + + type = map(any) + + default = { + + rhel-7-6-sap-ha = ".*redhat.*7-6.*amd64.*hana.*" + + rhel-8-1-sap-ha = ".*redhat.*8-1.*amd64.*hana.*" + + rhel-8-2-sap-ha = ".*redhat.*8-2.*amd64.*hana.*" + + rhel-8-4-sap-ha = ".*redhat.*8-4.*amd64.*hana.*" + + rhel-7-6-sap-applications = ".*redhat.*7-6.*amd64.*applications.*" + + rhel-8-1-sap-applications = ".*redhat.*8-1.*amd64.*applications.*" + + rhel-8-2-sap-applications = ".*redhat.*8-2.*amd64.*applications.*" + + rhel-8-4-sap-applications = ".*redhat.*8-4.*amd64.*applications.*" + + rhel-8-4 = ".*redhat.*8-4.*minimal.*amd64.*" + + sles-12-4-sap-ha = ".*sles.*12-4.*amd64.*hana.*" + + sles-15-1-sap-ha = ".*sles.*15-1.*amd64.*hana.*" + + sles-15-2-sap-ha = ".*sles.*15-2.*amd64.*hana.*" + + sles-12-4-sap-applications = ".*sles.*12-4.*amd64.*applications.*" + + sles-15-1-sap-applications = ".*sles.*15-1.*amd64.*applications.*" + + sles-15-2-sap-applications = ".*sles.*15-2.*amd64.*applications.*" + + } + +} diff --git a/sap_solman_sapase_single_node_install/ibmcloud_vs/variables.tf b/sap_solman_sapase_single_node_install/ibmcloud_vs/variables.tf new file mode 100644 index 0000000..09fd417 --- /dev/null +++ b/sap_solman_sapase_single_node_install/ibmcloud_vs/variables.tf @@ -0,0 +1,136 @@ + +variable "ibmcloud_api_key" { + description = "Enter your IBM Cloud API Key" +} + +variable "resource_tags" { + type = list(string) + description = "Tags applied to each resource created" +} + +variable "resource_prefix" { + description = "Prefix to resource names" +} + +variable "ibmcloud_resource_group" { + description = "Enter existing/target Resource Group name, or enter 'new' to create a Resource Group using the defined prefix for all resources" +} + +variable "ibmcloud_vpc_availability_zone" { + description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" +} + +variable "ibmcloud_iam_yesno" { + description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +} + +variable "ibmcloud_vpc_subnet_name" { + description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range" +} + +variable "dns_root_domain" { + description = "Root Domain for Private DNS used with the Virtual Server" +} + +variable "bastion_os_image" { + description = "Bastion OS Image. This variable uses the locals mapping with regex of OS Images, and will alter bastion provisioning." +} + +variable "bastion_user" { + description = "OS User to create on Bastion host to avoid pass-through root user (e.g. bastionuser)" +} + +variable "bastion_ssh_port" { + type = number + description = "Bastion host SSH Port from IANA Dynamic Ports range (49152 to 65535)" + + #validation { + # condition = var.bastion_ssh_port > 49152 && var.bastion_ssh_port < 65535 + # error_message = "Bastion host SSH Port must fall within IANA Dynamic Ports range (49152 to 65535)." + #} +} + +variable "host_specification_plan" { + description = "Host specification plans are small_32vcpu. This variable uses the locals mapping with a nested list of host specifications, and will alter host provisioning." +} + +variable "host_os_image" { + description = "Host OS Image. This variable uses the locals mapping with regex of OS Images, and will alter host provisioning." +} + +variable "sap_software_download_directory" { + description = "Mount point for downloads of SAP Software" + + validation { + error_message = "Directory must start with forward slash." + condition = can(regex("^/", var.sap_software_download_directory)) + } + +} + + + +variable "sap_id_user" { + description = "Ansible - Please enter your SAP ID user (e.g. S-User)" +} + +variable "sap_id_user_password" { + description = "Ansible - Please enter your SAP ID password" +} + +variable "sap_anydb_install_master_password" { + description = "Ansible - SAP AnyDB install: set common initial password (e.g. NewPass@321)" +} + +variable "sap_anydb_install_sid" { + description = "Ansible - SAP AnyDB install: System ID (e.g. AS1)" +} + +variable "sap_anydb_install_instance_number" { + description = "Ansible - SAP AnyDB install: Instance Number (e.g. 90)" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_anydb_install_instance_number)) + } + +} + + +#variable "sap_swpm_template_selected" { +# description = "Ansible - Select template to use: sap_solman_72_sr2_sapase_onehost" +#} + +variable "sap_nwas_install_sid" { + description = "Ansible - SAP NetWeaver AS (ABAP) install: System ID (e.g. N01)" +} + +variable "sap_nwas_java_ci_instance_no" { + description = "Ansible - SAP NetWeaver AS (JAVA) - JAVA Central Instance (CI) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_java_ci_instance_no)) + } + +} + +variable "sap_nwas_abap_ascs_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - ABAP Central Services (ASCS) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_ascs_instance_no)) + } + +} + +variable "sap_nwas_abap_pas_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - Primary Application Server instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_pas_instance_no)) + } + +} diff --git a/sap_solman_sapase_single_node_install/ibmcloud_vs/variables_generic_for_cli.tfvars b/sap_solman_sapase_single_node_install/ibmcloud_vs/variables_generic_for_cli.tfvars new file mode 100644 index 0000000..4aa1ffe --- /dev/null +++ b/sap_solman_sapase_single_node_install/ibmcloud_vs/variables_generic_for_cli.tfvars @@ -0,0 +1,31 @@ +resource_tags = ["sap", "sapnwas"] + +resource_prefix = "sap" + +dns_root_domain = "poc.cloud" + +bastion_os_image = "rhel-8-4" + +bastion_user = "bastionuser" + +bastion_ssh_port = 50222 + +host_specification_plan = "small_32vcpu" + +host_os_image = "rhel-8-4-sap-ha" + +sap_anydb_install_master_password = "NewPass@321" + +sap_anydb_install_sid = "AS1" + +sap_anydb_install_instance_number = "10" + +sap_nwas_abap_ascs_instance_no = "01" + +sap_nwas_abap_pas_instance_no = "00" + +sap_nwas_install_sid = "N01" + +sap_nwas_java_ci_instance_no = "20" + +sap_software_download_directory = "/software" diff --git a/sap_solman_sapase_single_node_install/ibmcloud_vs/versions.tf b/sap_solman_sapase_single_node_install/ibmcloud_vs/versions.tf new file mode 100644 index 0000000..aea3f80 --- /dev/null +++ b/sap_solman_sapase_single_node_install/ibmcloud_vs/versions.tf @@ -0,0 +1,32 @@ +# Terraform declaration + +terraform { + required_version = ">= 1.0" + required_providers { + ibm = { + #source = "localdomain/provider/ibm" // Local, on macOS path to place files would be $HOME/.terraform.d/plugins/localdomain/provider/ibm/1.xx.xx/darwin_amd6 + source = "IBM-Cloud/ibm" // Terraform Registry + version = ">=1.45.0" + } + } +} + + +# Terraform Provider declaration + +provider "ibm" { + + # Define Provider inputs manually + # ibmcloud_api_key = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + + # Define Provider inputs from given Terraform Variables + ibmcloud_api_key = var.ibmcloud_api_key + + # If using IBM Cloud Automation Manager, the Provider declaration values are populated automatically + # from the Cloud Connection credentials (by using Environment Variables) + + # If using IBM Cloud Schematics, the Provider declaration values are populated automatically + + region = local.ibmcloud_region + +} diff --git a/sap_solman_sapase_single_node_install/msazure_vm/main.tf b/sap_solman_sapase_single_node_install/msazure_vm/main.tf new file mode 100644 index 0000000..e875552 --- /dev/null +++ b/sap_solman_sapase_single_node_install/msazure_vm/main.tf @@ -0,0 +1,343 @@ + +module "run_ansible_dry_run" { + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=dev" + + module_var_dry_run_test = "x86_64" // x86_64 or ppc64le + + # Terraform Module Variables which are mandatory, all with an empty string + module_var_bastion_boolean = false + module_var_bastion_user = "" + module_var_bastion_ssh_port = 0 + module_var_bastion_private_ssh_key = "" + module_var_bastion_floating_ip = "" + module_var_host_private_ssh_key = "" + module_var_host_private_ip = "" + module_var_hostname = "software_media_dry_run" + module_var_dns_root_domain_name = "" + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + module_var_sap_swpm_sid = "" + module_var_sap_swpm_db_schema_abap = "" + module_var_sap_swpm_db_schema_abap_password = "" + module_var_sap_swpm_ddic_000_password = "" + module_var_sap_swpm_template_selected = "sap_solman_72_sr2_sapase_onehost" +} + + +module "run_account_init_module" { + + depends_on = [ + module.run_ansible_dry_run + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/account_init?ref=main" + + module_var_az_resource_group_name = local.resource_group_create_boolean ? 0 : var.az_resource_group_name + module_var_az_resource_group_create_boolean = local.resource_group_create_boolean + + module_var_resource_prefix = var.resource_prefix + + module_var_az_location_region = var.az_location_region + module_var_az_location_availability_zone_no = var.az_location_availability_zone_no + + module_var_az_vnet_name = local.az_vnet_name_create_boolean ? 0 : var.az_vnet_name + module_var_az_vnet_name_create_boolean = local.az_vnet_name_create_boolean + + module_var_az_vnet_subnet_name = local.az_vnet_subnet_name_create_boolean ? 0 : var.az_vnet_subnet_name + module_var_az_vnet_subnet_name_create_boolean = local.az_vnet_subnet_name_create_boolean + +} + + +module "run_account_bootstrap_module" { + + depends_on = [ + module.run_account_init_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/account_bootstrap?ref=main" + + module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name + module_var_resource_prefix = var.resource_prefix + + module_var_az_location_region = var.az_location_region + module_var_az_location_availability_zone_no = var.az_location_availability_zone_no + + module_var_az_vnet_name = module.run_account_init_module.output_vnet_name + module_var_az_vnet_subnet_name = module.run_account_init_module.output_vnet_subnet_name + + module_var_dns_root_domain_name = var.dns_root_domain +} + + +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.az_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/account_iam?ref=main" +# +# module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name +# module_var_resource_prefix = var.resource_prefix +# +#} + + +module "run_bastion_inject_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/bastion_inject?ref=main" + + module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name + module_var_resource_prefix = var.resource_prefix + + module_var_az_location_region = var.az_location_region + module_var_az_location_availability_zone_no = var.az_location_availability_zone_no + + module_var_az_vnet_name = module.run_account_init_module.output_vnet_name + module_var_az_vnet_subnet_name = module.run_account_init_module.output_vnet_subnet_name + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_ssh_key_id = module.run_account_bootstrap_module.output_bastion_ssh_key_id + module_var_bastion_public_ssh_key = module.run_account_bootstrap_module.output_bastion_public_ssh_key + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_os_image = var.map_os_image_regex[var.bastion_os_image] + +} + + +module "run_host_network_access_sap_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/host_network_access_sap?ref=main" + + module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name + + module_var_az_vnet_name = module.run_account_init_module.output_vnet_name + module_var_az_vnet_subnet_name = module.run_account_init_module.output_vnet_subnet_name + + module_var_host_security_group_name = module.run_account_bootstrap_module.output_host_security_group_name + + module_var_sap_nwas_abap_pas_instance_no = "" + module_var_sap_nwas_java_ci_instance_no = var.sap_nwas_java_ci_instance_no + module_var_sap_hana_instance_no = "" + +} + + +module "run_host_network_access_sap_public_via_proxy_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/host_network_access_sap_public_via_proxy?ref=main" + + module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name + + module_var_az_vnet_name = module.run_account_init_module.output_vnet_name + module_var_az_vnet_subnet_name = module.run_account_init_module.output_vnet_subnet_name + module_var_az_vnet_bastion_subnet_name = module.run_bastion_inject_module.output_vnet_bastion_subnet_name + + module_var_host_security_group_name = module.run_account_bootstrap_module.output_host_security_group_name + module_var_bastion_security_group_name = module.run_bastion_inject_module.output_bastion_security_group_name + module_var_bastion_connection_security_group_name = module.run_bastion_inject_module.output_bastion_connection_security_group_name + + module_var_sap_nwas_abap_pas_instance_no = "" + module_var_sap_nwas_java_ci_instance_no = var.sap_nwas_java_ci_instance_no + module_var_sap_hana_instance_no = "" + +} + + +module "run_host_provision_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/host_provision?ref=main" + + + module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name + module_var_resource_prefix = var.resource_prefix + + module_var_az_location_region = var.az_location_region + module_var_az_location_availability_zone_no = var.az_location_availability_zone_no + + module_var_az_vnet_name = module.run_account_init_module.output_vnet_name + module_var_az_vnet_subnet_name = module.run_account_init_module.output_vnet_subnet_name + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + module_var_bastion_ip = module.run_bastion_inject_module.output_bastion_ip + module_var_bastion_connection_sg_id = module.run_bastion_inject_module.output_bastion_connection_security_group_id + + module_var_host_ssh_key_id = module.run_account_bootstrap_module.output_host_ssh_key_id + module_var_host_ssh_public_key = module.run_account_bootstrap_module.output_host_public_ssh_key + module_var_host_ssh_private_key = module.run_account_bootstrap_module.output_host_private_ssh_key + module_var_host_sg_id = module.run_account_bootstrap_module.output_host_security_group_id + + module_var_host_os_image = var.map_os_image_regex[var.host_os_image] + + module_var_dns_zone_name = module.run_account_bootstrap_module.output_dns_zone_name + module_var_dns_root_domain_name = var.dns_root_domain + + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable with nested objects + + for_each = toset([ + for key, value in var.map_host_specifications[var.host_specification_plan] : key + ]) + + module_var_host_name = each.key + + module_var_az_vm_instance = var.map_host_specifications[var.host_specification_plan][each.key].vm_instance + + module_var_disk_volume_count_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data + module_var_disk_volume_type_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data + module_var_disk_volume_capacity_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_data + module_var_disk_volume_iops_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_data : null + module_var_lvm_enable_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data + module_var_lvm_pv_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_data : 0 + module_var_lvm_vg_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_data : 0 + module_var_lvm_vg_physical_extent_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_data : 0 + module_var_lvm_lv_stripe_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_data : 0 + module_var_filesystem_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_data + module_var_physical_partition_filesystem_block_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_data + + module_var_disk_volume_count_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log + module_var_disk_volume_type_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log + module_var_disk_volume_capacity_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_log + module_var_disk_volume_iops_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_log : null + module_var_lvm_enable_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log + module_var_lvm_pv_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_log : 0 + module_var_lvm_vg_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_log : 0 + module_var_lvm_vg_physical_extent_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_log : 0 + module_var_lvm_lv_stripe_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_log : 0 + module_var_filesystem_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_log + module_var_physical_partition_filesystem_block_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_log + + module_var_disk_volume_count_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared + module_var_disk_volume_type_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared + module_var_disk_volume_capacity_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_shared + module_var_disk_volume_iops_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_shared : null + module_var_lvm_enable_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared + module_var_lvm_pv_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_shared : 0 + module_var_lvm_vg_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_shared : 0 + module_var_lvm_vg_physical_extent_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_shared : 0 + module_var_lvm_lv_stripe_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_shared : 0 + module_var_filesystem_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_shared + module_var_physical_partition_filesystem_block_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_shared + + module_var_disk_volume_count_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb + module_var_disk_volume_type_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb + module_var_disk_volume_capacity_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_anydb + module_var_disk_volume_iops_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_anydb : null + module_var_lvm_enable_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb + module_var_lvm_pv_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_anydb : 0 + module_var_lvm_vg_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_anydb : 0 + module_var_lvm_vg_physical_extent_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_anydb : 0 + module_var_lvm_lv_stripe_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_anydb : 0 + module_var_filesystem_mount_path_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_mount_path_anydb + module_var_filesystem_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_anydb + module_var_physical_partition_filesystem_block_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_anydb + + module_var_disk_volume_count_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_usr_sap + module_var_disk_volume_type_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_usr_sap + module_var_disk_volume_capacity_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_usr_sap + module_var_filesystem_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_usr_sap + + module_var_disk_volume_count_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_sapmnt + module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt + module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt + module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation + + module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb + module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap + module_var_disk_volume_type_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_swap : 0 + module_var_disk_volume_capacity_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_swap : 0 + module_var_filesystem_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].filesystem_swap : 0 + + module_var_disk_volume_capacity_software = var.disk_volume_capacity_software + module_var_sap_software_download_directory = var.sap_software_download_directory + +} + + +module "run_ansible_sap_solman_java_sapase_install" { + + depends_on = [module.run_host_provision_module] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=dev" + + + # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) + module_var_bastion_boolean = true // required as true boolean for any Cloud Service Provider (CSP) + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_floating_ip = module.run_bastion_inject_module.output_bastion_ip + + module_var_host_private_ssh_key = module.run_account_bootstrap_module.output_host_private_ssh_key + + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable at runtime + + for_each = module.run_host_provision_module + module_var_host_private_ip = join(", ", each.value.*.output_host_private_ip) + module_var_hostname = join(", ", each.value.*.output_host_name) + module_var_dns_root_domain_name = var.dns_root_domain + + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + + module_var_sap_anydb_install_sid = var.sap_anydb_install_sid + module_var_sap_anydb_install_instance_number = var.sap_anydb_install_instance_number + + module_var_sap_swpm_sid = var.sap_nwas_install_sid + + module_var_sap_swpm_db_schema_abap = "SAPJAVA1" + module_var_sap_swpm_db_schema_abap_password = var.sap_anydb_install_master_password + module_var_sap_swpm_db_system_password = var.sap_anydb_install_master_password + module_var_sap_swpm_db_systemdb_password = var.sap_anydb_install_master_password + module_var_sap_swpm_db_sidadm_password = var.sap_anydb_install_master_password + module_var_sap_swpm_ddic_000_password = var.sap_anydb_install_master_password + + module_var_sap_swpm_ascs_instance_nr = var.sap_nwas_abap_ascs_instance_no + module_var_sap_swpm_pas_instance_nr = var.sap_nwas_abap_pas_instance_no + + module_var_sap_swpm_nwas_java_instance_nr = var.sap_nwas_java_ci_instance_no + + module_var_sap_swpm_master_password = var.sap_anydb_install_master_password + + module_var_sap_swpm_template_selected = "sap_solman_72_sr2_sapase_onehost" + + module_var_filesystem_mount_path_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_mount_path_anydb + + module_var_sap_software_download_directory = var.sap_software_download_directory + +} diff --git a/sap_solman_sapase_single_node_install/msazure_vm/outputs.tf b/sap_solman_sapase_single_node_install/msazure_vm/outputs.tf new file mode 100644 index 0000000..0759d42 --- /dev/null +++ b/sap_solman_sapase_single_node_install/msazure_vm/outputs.tf @@ -0,0 +1,211 @@ + +############################################################## +# Export SSH key to file on local +############################################################## + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "bastion_rsa" { + content = module.run_account_bootstrap_module.output_bastion_private_ssh_key + filename = "${path.root}/ssh/bastion_rsa" + file_permission = "0400" +} + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "hosts_rsa" { + content = module.run_account_bootstrap_module.output_host_private_ssh_key + filename = "${path.root}/ssh/hosts_rsa" + file_permission = "0400" +} + + +output "ssh_sap_connection_details" { + value = local.is_wsl ? "IGNORE" : <>> Chosen option $REPLY: $opt" + select opt_ip in "$${target_host_array[@]}"; do + if [ $opt_ip = "Quit" ]; then break 2; fi + target_ip=$opt_ip + echo "---- Selected option $REPLY, tunneling into $target_ip ----" + break + done + echo "" + echo "#### HTTP/S JAVA endpoints: ####" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N \ + $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file \ + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -L localhost:5$${sap_nwas_java_ci_instance_no}00:$target_ip:5$${sap_nwas_java_ci_instance_no}01 \ + -L localhost:5$${sap_nwas_java_ci_instance_no}20:$target_ip:5$${sap_nwas_java_ci_instance_no}20 \ + -L localhost:5$${sap_nwas_java_ci_instance_no}13:$target_ip:5$${sap_nwas_java_ci_instance_no}14 + break + ;; + "OS root access, via SSH stdin/stdout forwarding proxy") + echo ">>> Chosen option $REPLY: $opt" + select opt_ssh in "$${target_host_array[@]}"; do + if [ $opt_ssh = "Quit" ]; then break 2; fi + target_ip=$opt_ssh + echo "---- Selected option $REPLY, logging into $target_ip ----" + break + done + + if [ -n "$target_ip" ]; then + ssh -i $target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + fi + break + ;; + "Quit") + break + ;; + *) echo "Invalid option $REPLY" ;; + esac + done +} + +# Then call shell function and select which target +sshjump + +EOF +} + + +# If detected Windows WSL2, then find the installed name using external resource to return a JSON string +data "external" "wsl_distro_name" { + count = local.is_wsl ? 1 : 0 + program = ["bash", "-c", "echo \"{\\\"stdout\\\":\\\"$(echo $WSL_DISTRO_NAME)\\\"}\""] +} + +output "ssh_sap_connection_details_windows" { + value = local.not_wsl ? "IGNORE" : <>> Chosen option $(PSItem)" + echo "" + echo "#### HTTP/S JAVA endpoints: ####" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N ` + $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -L localhost:5$${sap_nwas_java_ci_instance_no}00:$${target_ip}:5$${sap_nwas_java_ci_instance_no}01 ` + -L localhost:5$${sap_nwas_java_ci_instance_no}20:$${target_ip}:5$${sap_nwas_java_ci_instance_no}20 ` + -L localhost:5$${sap_nwas_java_ci_instance_no}13:$${target_ip}:5$${sap_nwas_java_ci_instance_no}14 + } + } + 2 { + foreach ($target_host in $target_host_array) { + $i=$target_host_array.IndexOf($target_host) + echo "$i) $target_host" + } + $target_host_selection = Read-Host "Please make a selection" + if ($target_host_array[$target_host_selection] -eq "Quit" ){ + break + }else { + $target_ip = $target_host_array[$target_host_selection] + #echo ">>> Chosen option $(PSItem)" + ssh -i $temp_target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + } + } + 3 { + break + } + } +} + +EOF + +} diff --git a/sap_solman_sapase_single_node_install/msazure_vm/variable_locals.tf b/sap_solman_sapase_single_node_install/msazure_vm/variable_locals.tf new file mode 100644 index 0000000..ff321be --- /dev/null +++ b/sap_solman_sapase_single_node_install/msazure_vm/variable_locals.tf @@ -0,0 +1,21 @@ +locals { + + resource_group_create_boolean = var.az_resource_group_name == "new" ? true : false + + az_vnet_name_create_boolean = var.az_vnet_name == "new" ? true : false + + az_vnet_subnet_name_create_boolean = var.az_vnet_subnet_name == "new" ? true : false + + # Directories start with "C:..." on Windows; All other OSs use "/" for root. + detect_windows = substr(pathexpand("~"), 0, 1) == "/" ? false : true + detect_shell = substr(pathexpand("~"), 0, 1) == "/" ? true : false + + # Used for displaying Shell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + not_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? false : true : true + + # Used for displaying Windows PowerShell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + is_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? true : false : false + +} diff --git a/sap_solman_sapase_single_node_install/msazure_vm/variable_map_hosts.tf b/sap_solman_sapase_single_node_install/msazure_vm/variable_map_hosts.tf new file mode 100644 index 0000000..aed59e6 --- /dev/null +++ b/sap_solman_sapase_single_node_install/msazure_vm/variable_map_hosts.tf @@ -0,0 +1,57 @@ + +variable "map_host_specifications" { + + description = "Map of host specficiations for SAP NetWeaver AS (JAVA) with SAP ASE single node install" + + type = map(any) + + default = { + + small_32vcpu = { + + nw01 = { // Hostname + vm_instance = "Standard_D32s_v5" + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 0 + + disk_volume_count_hana_log = 0 + + disk_volume_count_hana_shared = 0 + + disk_volume_count_anydb = 1 + disk_volume_type_anydb = "P20" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_anydb = 512 + #disk_volume_iops_anydb = + lvm_enable_anydb = false // if false, then disk volume count should be 1 + #lvm_pv_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + #lvm_vg_data_alignment_anydb = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + #lvm_vg_physical_extent_size_anydb = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + #lvm_lv_stripe_size_anydb = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_mount_path_anydb = "/sybase" + filesystem_anydb = "xfs" + physical_partition_filesystem_block_size_anydb = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_usr_sap = 1 // max of 1 + disk_volume_type_usr_sap = "E15" + disk_volume_capacity_usr_sap = 256 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 1 // max of 1 + disk_volume_type_sapmnt = "E6" + disk_volume_capacity_sapmnt = 64 // bad sizing, but use this so each drive size is unique + filesystem_sapmnt = "xfs" + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "E10" + disk_volume_capacity_swap = 128 // minimum 128GB swap for IBM DB2 LUW + filesystem_swap = "xfs" + } + + } + + } + +} diff --git a/sap_solman_sapase_single_node_install/msazure_vm/variable_map_os.tf b/sap_solman_sapase_single_node_install/msazure_vm/variable_map_os.tf new file mode 100644 index 0000000..010c0a6 --- /dev/null +++ b/sap_solman_sapase_single_node_install/msazure_vm/variable_map_os.tf @@ -0,0 +1,59 @@ + +# Find latest OS Image for RHEL +# az account list-locations | jq .[].displayName +# az vm image list --all --publisher redhat --offer RHEL-SAP-APPS --sku 8 --query "[?starts_with(version,'8.4')]" | jq .[].version --raw-output | sort -r | head -1 +# az vm image list --all --publisher redhat --offer RHEL-SAP-HA --sku 8 --query "[?starts_with(version,'8.4')]" | jq .[].version --raw-output | sort -r | head -1 + +variable "map_os_image_regex" { + + description = "Map of operating systems OS Image regex, to identify latest OS Image for the OS major.minor version" + + type = map(any) + + default = { + + rhel-8-4 = { + publisher = "RedHat" + offer = "RHEL" + sku = "84-gen2" + }, + + rhel-8-1-sap-ha = { + publisher = "RedHat" + offer = "RHEL-SAP-HA" + sku = "81sapha-gen2" + }, + + rhel-8-2-sap-ha = { + publisher = "RedHat" + offer = "RHEL-SAP-HA" + sku = "82sapha-gen2" + }, + + rhel-8-4-sap-ha = { + publisher = "RedHat" + offer = "RHEL-SAP-HA" + sku = "84sapha-gen2" + }, + + rhel-8-1-sap-applications = { + publisher = "RedHat" + offer = "RHEL-SAP-APPS" + sku = "81sapapps-gen2" + }, + + rhel-8-2-sap-applications = { + publisher = "RedHat" + offer = "RHEL-SAP-APPS" + sku = "82sapapps-gen2" + }, + + rhel-8-4-sap-applications = { + publisher = "RedHat" + offer = "RHEL-SAP-APPS" + sku = "84sapapps-gen2" + } + + } + +} diff --git a/sap_solman_sapase_single_node_install/msazure_vm/variables.tf b/sap_solman_sapase_single_node_install/msazure_vm/variables.tf new file mode 100644 index 0000000..432b7a9 --- /dev/null +++ b/sap_solman_sapase_single_node_install/msazure_vm/variables.tf @@ -0,0 +1,152 @@ + +variable "az_tenant_id" { + description = "Azure Tenant ID" +} + +variable "az_subscription_id" { + description = "Azure Subscription ID" +} + +variable "az_app_client_id" { + description = "Azure AD App Client ID" +} + +variable "az_app_client_secret" { + description = "Azure AD App Client Secret" +} + +variable "resource_prefix" { + description = "Enter prefix to resource names" +} + +variable "az_resource_group_name" { + description = "Enter existing/target Azure Resource Group name, or enter 'new' to create a Resource Group using the defined prefix for all resources" +} + +variable "az_location_region" { + description = "Target Azure Region aka. Azure Location Display Name (e.g. 'West Europe')" +} + +variable "az_location_availability_zone_no" { + description = "Target Azure Availability Zone (e.g. 1)" +} + +variable "az_vnet_name" { + description = "Enter existing/target Azure VNet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range (cannot be 'new' if using existing VNet Subnet)" +} + +variable "az_vnet_subnet_name" { + description = "Enter existing/target Azure VNet Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range (if using existing VNet, ensure default subnet range matches to VNet address space and does not conflict with existing Subnet)" +} + +variable "dns_root_domain" { + description = "Root Domain for Private DNS used with the Virtual Machine" +} + +variable "bastion_os_image" { + description = "Bastion OS Image. This variable uses the locals mapping with regex of OS Images, and will alter bastion provisioning." +} + +variable "bastion_user" { + description = "OS User to create on Bastion host to avoid pass-through root user (e.g. bastionuser)" +} + +variable "bastion_ssh_port" { + type = number + description = "Bastion host SSH Port from IANA Dynamic Ports range (49152 to 65535)" + + validation { + condition = var.bastion_ssh_port > 49152 && var.bastion_ssh_port < 65535 + error_message = "Bastion host SSH Port must fall within IANA Dynamic Ports range (49152 to 65535)." + } +} + +variable "host_specification_plan" { + description = "Host specification plans are small_32vcpu. This variable uses the locals mapping with a nested list of host specifications, and will alter host provisioning." +} + +variable "host_os_image" { + description = "Host OS Image. This variable uses the locals mapping with regex of OS Images, and will alter host provisioning." +} + +variable "disk_volume_capacity_software" { + type = number + description = "Disk volume capacity for downloads of SAP Software" +} + +variable "sap_software_download_directory" { + description = "Mount point for downloads of SAP Software" + + validation { + error_message = "Directory must start with forward slash." + condition = can(regex("^/", var.sap_software_download_directory)) + } + +} + + + +variable "sap_id_user" { + description = "Ansible - Please enter your SAP ID user (e.g. S-User)" +} + +variable "sap_id_user_password" { + description = "Ansible - Please enter your SAP ID password" +} + +variable "sap_anydb_install_master_password" { + description = "Ansible - SAP AnyDB install: set common initial password (e.g. NewPass@321)" +} + +variable "sap_anydb_install_sid" { + description = "Ansible - SAP AnyDB install: System ID (e.g. AS1)" +} + +variable "sap_anydb_install_instance_number" { + description = "Ansible - SAP AnyDB install: Instance Number (e.g. 90)" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_anydb_install_instance_number)) + } + +} + + +#variable "sap_swpm_template_selected" { +# description = "Ansible - Select template to use: sap_solman_72_sr2_sapase_onehost" +#} + +variable "sap_nwas_install_sid" { + description = "Ansible - SAP NetWeaver AS (ABAP) install: System ID (e.g. N01)" +} + +variable "sap_nwas_java_ci_instance_no" { + description = "Ansible - SAP NetWeaver AS (JAVA) - JAVA Central Instance (CI) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_java_ci_instance_no)) + } + +} + +variable "sap_nwas_abap_ascs_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - ABAP Central Services (ASCS) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_ascs_instance_no)) + } + +} + +variable "sap_nwas_abap_pas_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - Primary Application Server instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_pas_instance_no)) + } + +} diff --git a/sap_solman_sapase_single_node_install/msazure_vm/variables_generic_for_cli.tfvars b/sap_solman_sapase_single_node_install/msazure_vm/variables_generic_for_cli.tfvars new file mode 100644 index 0000000..b2fbb86 --- /dev/null +++ b/sap_solman_sapase_single_node_install/msazure_vm/variables_generic_for_cli.tfvars @@ -0,0 +1,31 @@ +resource_prefix = "sap" + +dns_root_domain = "poc.cloud" + +bastion_os_image = "rhel-8-4" + +bastion_user = "bastionuser" + +bastion_ssh_port = 50222 + +host_specification_plan = "small_32vcpu" + +host_os_image = "rhel-8-4-sap-ha" + +disk_volume_capacity_software = 304 + +sap_anydb_install_master_password = "NewPass@321" + +sap_anydb_install_sid = "AS1" + +sap_anydb_install_instance_number = "10" + +sap_nwas_abap_ascs_instance_no = "01" + +sap_nwas_abap_pas_instance_no = "00" + +sap_nwas_install_sid = "N01" + +sap_nwas_java_ci_instance_no = "20" + +sap_software_download_directory = "/software" diff --git a/sap_solman_sapase_single_node_install/msazure_vm/versions.tf b/sap_solman_sapase_single_node_install/msazure_vm/versions.tf new file mode 100644 index 0000000..74aaca6 --- /dev/null +++ b/sap_solman_sapase_single_node_install/msazure_vm/versions.tf @@ -0,0 +1,28 @@ +# Terraform declaration +terraform { + required_version = ">= 1.0" + required_providers { + azurerm = { + #source = "localdomain/provider/azurerm" // Local, on macOS path to place files would be $HOME/.terraform.d/plugins/localdomain/provider/azurerm/1.xx.xx/darwin_amd6 + source = "hashicorp/azurerm" // Terraform Registry + version = ">=2.90.0" + } + } +} + +# Terraform Provider declaration + +provider "azurerm" { + + features {} + + tenant_id = var.az_tenant_id // Azure Tenant ID, linked to the Azure Active Directory instance + subscription_id = var.az_subscription_id // Azure Subscription ID, linked to an Azure Tenant. All resource groups belong to the Azure Subscription. + + client_id = var.az_app_client_id // Azure Client ID, defined in the Azure Active Directory instance; equivalent to Active Directory Application ID. + client_secret = var.az_app_client_secret // Azure Application ID Password, defined in the Azure Active Directory instance + + # Role-based Access Control (RBAC) permissions control the actions for resources within the Azure Subscription. + # The Roles are assigned to a Security Principal - which can be a User, Group, Service Principal or Managed Identity. + +} diff --git a/sap_solman_saphana_single_node_install/aws_ec2_instance/main.tf b/sap_solman_saphana_single_node_install/aws_ec2_instance/main.tf new file mode 100644 index 0000000..bc28726 --- /dev/null +++ b/sap_solman_saphana_single_node_install/aws_ec2_instance/main.tf @@ -0,0 +1,304 @@ + +module "run_ansible_dry_run" { + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=dev" + + module_var_dry_run_test = "x86_64" // x86_64 or ppc64le + + # Terraform Module Variables which are mandatory, all with an empty string + module_var_bastion_boolean = false + module_var_bastion_user = "" + module_var_bastion_ssh_port = 0 + module_var_bastion_private_ssh_key = "" + module_var_bastion_floating_ip = "" + module_var_host_private_ssh_key = "" + module_var_host_private_ip = "" + module_var_hostname = "software_media_dry_run" + module_var_dns_root_domain_name = "" + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + module_var_sap_swpm_sid = "" + module_var_sap_swpm_db_schema_abap = "" + module_var_sap_swpm_db_schema_abap_password = "" + module_var_sap_swpm_ddic_000_password = "" + module_var_sap_swpm_template_selected = "sap_solman_72_sr2_saphana_onehost" +} + + +module "run_account_init_module" { + + depends_on = [ + module.run_ansible_dry_run + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/account_init?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_aws_vpc_subnet_id = var.aws_vpc_subnet_id + + module_var_aws_vpc_subnet_create_boolean = local.aws_vpc_subnet_create_boolean + + module_var_aws_vpc_availability_zone = var.aws_vpc_availability_zone + +} + + +module "run_account_bootstrap_module" { + + depends_on = [ + module.run_account_init_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/account_bootstrap?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_aws_vpc_subnet_id = local.aws_vpc_subnet_create_boolean ? module.run_account_init_module.output_aws_vpc_subnet_id : var.aws_vpc_subnet_id + + module_var_dns_root_domain_name = var.dns_root_domain + +} + + +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] + + +module "run_bastion_inject_module" { + + depends_on = [ + module.run_account_bootstrap_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/bastion_inject?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_aws_vpc_subnet_id = local.aws_vpc_subnet_create_boolean ? module.run_account_init_module.output_aws_vpc_subnet_id : var.aws_vpc_subnet_id + module_var_aws_vpc_igw_id = module.run_account_init_module.output_aws_vpc_igw_id + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_os_image = var.map_os_image_regex[var.bastion_os_image] + module_var_bastion_ssh_key_name = module.run_account_bootstrap_module.output_bastion_ssh_key_name + module_var_bastion_public_ssh_key = module.run_account_bootstrap_module.output_bastion_public_ssh_key + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_aws_vpc_availability_zone = var.aws_vpc_availability_zone + +} + + +module "run_host_network_access_sap_module" { + + depends_on = [ + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/host_network_access_sap?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_aws_vpc_subnet_id = local.aws_vpc_subnet_create_boolean ? module.run_account_init_module.output_aws_vpc_subnet_id : var.aws_vpc_subnet_id + module_var_host_security_group_id = module.run_account_bootstrap_module.output_host_security_group_id + + module_var_sap_nwas_abap_pas_instance_no = var.sap_nwas_abap_pas_instance_no + module_var_sap_hana_instance_no = var.sap_hana_install_instance_number + +} + + +module "run_host_network_access_sap_public_via_proxy_module" { + + depends_on = [ + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/host_network_access_sap_public_via_proxy?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_aws_vpc_subnet_id = local.aws_vpc_subnet_create_boolean ? module.run_account_init_module.output_aws_vpc_subnet_id : var.aws_vpc_subnet_id + + module_var_bastion_sg_id = module.run_bastion_inject_module.output_bastion_security_group_id + module_var_bastion_connection_sg_id = module.run_bastion_inject_module.output_bastion_connection_security_group_id + + module_var_sap_nwas_abap_pas_instance_no = var.sap_nwas_abap_pas_instance_no + module_var_sap_hana_instance_no = var.sap_hana_install_instance_number + +} + + +module "run_host_provision_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/host_provision?ref=main" + + # Set Terraform Module Variables using Terraform Variables at runtime + + module_var_aws_vpc_subnet_id = local.aws_vpc_subnet_create_boolean ? module.run_account_init_module.output_aws_vpc_subnet_id : var.aws_vpc_subnet_id + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + module_var_bastion_ip = module.run_bastion_inject_module.output_bastion_ip + module_var_bastion_connection_sg_id = module.run_bastion_inject_module.output_bastion_connection_security_group_id + + module_var_host_ssh_key_name = module.run_account_bootstrap_module.output_host_ssh_key_name + module_var_host_ssh_public_key = module.run_account_bootstrap_module.output_host_public_ssh_key + module_var_host_ssh_private_key = module.run_account_bootstrap_module.output_host_private_ssh_key + module_var_host_sg_id = module.run_account_bootstrap_module.output_host_security_group_id + + module_var_host_os_image = var.map_os_image_regex[var.host_os_image] + + module_var_dns_zone_id = module.run_account_bootstrap_module.output_dns_zone_id + module_var_dns_root_domain_name = module.run_account_bootstrap_module.output_dns_domain_name + module_var_dns_nameserver_list = module.run_account_bootstrap_module.output_dns_nameserver_list + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable with nested objects + + for_each = toset([ + for key, value in var.map_host_specifications[var.host_specification_plan] : key + ]) + + module_var_host_name = each.key + + module_var_aws_ec2_instance_type = var.map_host_specifications[var.host_specification_plan][each.key].ec2_instance_type + + module_var_disk_volume_count_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data + module_var_disk_volume_type_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data + module_var_disk_volume_capacity_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_data + module_var_disk_volume_iops_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_data : null + module_var_lvm_enable_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data + module_var_lvm_pv_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_data : 0 + module_var_lvm_vg_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_data : 0 + module_var_lvm_vg_physical_extent_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_data : 0 + module_var_lvm_lv_stripe_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_data : 0 + module_var_filesystem_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_data + module_var_physical_partition_filesystem_block_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_data + + module_var_disk_volume_count_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log + module_var_disk_volume_type_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log + module_var_disk_volume_capacity_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_log + module_var_disk_volume_iops_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_log : null + module_var_lvm_enable_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log + module_var_lvm_pv_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_log : 0 + module_var_lvm_vg_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_log : 0 + module_var_lvm_vg_physical_extent_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_log : 0 + module_var_lvm_lv_stripe_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_log : 0 + module_var_filesystem_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_log + module_var_physical_partition_filesystem_block_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_log + + module_var_disk_volume_count_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared + module_var_disk_volume_type_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared + module_var_disk_volume_capacity_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_shared + module_var_disk_volume_iops_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_shared : null + module_var_lvm_enable_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared + module_var_lvm_pv_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_shared : 0 + module_var_lvm_vg_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_shared : 0 + module_var_lvm_vg_physical_extent_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_shared : 0 + module_var_lvm_lv_stripe_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_shared : 0 + module_var_filesystem_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_shared + module_var_physical_partition_filesystem_block_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_shared + + module_var_disk_volume_count_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb + module_var_disk_volume_type_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb + module_var_disk_volume_capacity_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_anydb + module_var_disk_volume_iops_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_anydb : null + module_var_lvm_enable_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb + module_var_lvm_pv_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_anydb : 0 + module_var_lvm_vg_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_anydb : 0 + module_var_lvm_vg_physical_extent_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_anydb : 0 + module_var_lvm_lv_stripe_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_anydb : 0 + module_var_filesystem_mount_path_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_mount_path_anydb + module_var_filesystem_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_anydb + module_var_physical_partition_filesystem_block_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_anydb + + module_var_disk_volume_count_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_usr_sap + module_var_disk_volume_type_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_usr_sap + module_var_disk_volume_capacity_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_usr_sap + module_var_filesystem_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_usr_sap + + module_var_disk_volume_count_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_sapmnt + module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt + module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt + module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation + + module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb + module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap + module_var_disk_volume_type_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_swap : 0 + module_var_disk_volume_capacity_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_swap : 0 + module_var_filesystem_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].filesystem_swap : 0 + + module_var_disk_volume_type_software = var.disk_volume_type_software + module_var_disk_volume_capacity_software = var.disk_volume_capacity_software + module_var_sap_software_download_directory = var.sap_software_download_directory + + module_var_disable_ip_anti_spoofing = false + +} + + +module "run_ansible_sap_solman_saphana_install" { + + depends_on = [module.run_host_provision_module] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=dev" + + + # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) + module_var_bastion_boolean = true // required as true boolean for any Cloud Service Provider (CSP) + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_floating_ip = module.run_bastion_inject_module.output_bastion_ip + + module_var_host_private_ssh_key = module.run_account_bootstrap_module.output_host_private_ssh_key + + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable at runtime + + for_each = module.run_host_provision_module + module_var_host_private_ip = join(", ", each.value.*.output_host_private_ip) + module_var_hostname = join(", ", each.value.*.output_host_name) + module_var_dns_root_domain_name = var.dns_root_domain + + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + + module_var_sap_hana_install_master_password = var.sap_hana_install_master_password + module_var_sap_hana_install_sid = var.sap_hana_install_sid + module_var_sap_hana_install_instance_number = var.sap_hana_install_instance_number + + module_var_sap_swpm_sid = var.sap_nwas_install_sid + + module_var_sap_swpm_db_schema_abap = "SAPABAP1" + module_var_sap_swpm_db_schema_abap_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_system_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_systemdb_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_sidadm_password = var.sap_hana_install_master_password + module_var_sap_swpm_ddic_000_password = var.sap_hana_install_master_password + module_var_sap_swpm_ascs_instance_nr = var.sap_nwas_abap_ascs_instance_no + module_var_sap_swpm_pas_instance_nr = var.sap_nwas_abap_pas_instance_no + + module_var_sap_swpm_nwas_java_instance_nr = var.sap_nwas_java_ci_instance_no + + module_var_sap_swpm_master_password = var.sap_hana_install_master_password + + module_var_sap_swpm_template_selected = "sap_solman_72_sr2_saphana_onehost" + + module_var_sap_software_download_directory = var.sap_software_download_directory + +} diff --git a/sap_solman_saphana_single_node_install/aws_ec2_instance/outputs.tf b/sap_solman_saphana_single_node_install/aws_ec2_instance/outputs.tf new file mode 100644 index 0000000..2a16c91 --- /dev/null +++ b/sap_solman_saphana_single_node_install/aws_ec2_instance/outputs.tf @@ -0,0 +1,234 @@ + +############################################################## +# Export SSH key to file on local +############################################################## + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "bastion_rsa" { + content = module.run_account_bootstrap_module.output_bastion_private_ssh_key + filename = "${path.root}/ssh/bastion_rsa" + file_permission = "0400" +} + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "hosts_rsa" { + content = module.run_account_bootstrap_module.output_host_private_ssh_key + filename = "${path.root}/ssh/hosts_rsa" + file_permission = "0400" +} + + +output "ssh_sap_connection_details" { + value = local.is_wsl ? "IGNORE" : <>> Chosen option $REPLY: $opt" + select opt_ip in "$${target_host_array[@]}"; do + if [ $opt_ip = "Quit" ]; then break 2; fi + target_ip=$opt_ip + echo "---- Selected option $REPLY, tunneling into $target_ip ----" + break + done + echo "" + echo "#### For SAP HANA Studio, use Add System with host name as localhost; do not add port numbers." + echo "#### If selecting 'Connect using SSL' on Connection Properties, then on Additional Properties (final) screen deselect 'Validate the SSL certificate'" + echo "" + echo "#### For SAPGUI, use expert mode SAP Logon String as: ####" + echo "conn=/H/localhost/S/32$sap_nwas_abap_pas_instance_no&expert=true" + echo "" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N \ + $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file \ + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -L localhost:32$sap_nwas_abap_pas_instance_no:$target_ip:32$sap_nwas_abap_pas_instance_no \ + -L localhost:33$sap_nwas_abap_pas_instance_no:$target_ip:33$sap_nwas_abap_pas_instance_no \ + -L localhost:3$${sap_hana_instance_no}13:$target_ip:3$${sap_hana_instance_no}13 \ + -L localhost:3$${sap_hana_instance_no}15:$target_ip:3$${sap_hana_instance_no}15 \ + -L localhost:3$${sap_hana_instance_no}41:$target_ip:3$${sap_hana_instance_no}41 \ + -L localhost:443$sap_hana_instance_no:$target_ip:443$sap_hana_instance_no \ + -L localhost:443$sap_nwas_abap_pas_instance_no:$target_ip:443$sap_nwas_abap_pas_instance_no \ + -L localhost:5$${sap_hana_instance_no}13:$target_ip:5$${sap_hana_instance_no}13 \ + -L localhost:5$${sap_hana_instance_no}14:$target_ip:5$${sap_hana_instance_no}14 + break + ;; + "OS root access, via SSH stdin/stdout forwarding proxy") + echo ">>> Chosen option $REPLY: $opt" + select opt_ssh in "$${target_host_array[@]}"; do + if [ $opt_ssh = "Quit" ]; then break 2; fi + target_ip=$opt_ssh + echo "---- Selected option $REPLY, logging into $target_ip ----" + break + done + + if [ -n "$target_ip" ]; then + ssh -i $target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + fi + break + ;; + "Quit") + break + ;; + *) echo "Invalid option $REPLY" ;; + esac + done +} + +# Then call shell function and select which target +sshjump + +EOF +} + +# If detected Windows WSL2, then find the installed name using external resource to return a JSON string +data "external" "wsl_distro_name" { + count = local.is_wsl ? 1 : 0 + program = ["bash", "-c", "echo \"{\\\"stdout\\\":\\\"$(echo $WSL_DISTRO_NAME)\\\"}\""] +} + +output "ssh_sap_connection_details_windows" { + value = local.not_wsl ? "IGNORE" : <>> Chosen option $(PSItem)" + echo "" + echo "#### For SAP HANA Studio, use Add System with host name as localhost; do not add port numbers." + echo "#### If selecting 'Connect using SSL' on Connection Properties, then on Additional Properties (final) screen deselect 'Validate the SSL certificate'" + echo "" + echo "#### For SAPGUI, use expert mode SAP Logon String as: ####" + echo "conn=/H/localhost/S/32$sap_nwas_abap_pas_instance_no&expert=true" + echo "" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N ` + $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -L localhost:32$${sap_nwas_abap_pas_instance_no}:$${target_ip}:32$${sap_nwas_abap_pas_instance_no} ` + -L localhost:33$${sap_nwas_abap_pas_instance_no}:$${target_ip}:33$${sap_nwas_abap_pas_instance_no} ` + -L localhost:3$${sap_hana_instance_no}13:$${target_ip}:3$${sap_hana_instance_no}13 ` + -L localhost:3$${sap_hana_instance_no}15:$${target_ip}:3$${sap_hana_instance_no}15 ` + -L localhost:3$${sap_hana_instance_no}41:$${target_ip}:3$${sap_hana_instance_no}41 ` + -L localhost:443$${sap_hana_instance_no}:$${target_ip}:443$${sap_hana_instance_no} ` + -L localhost:443$${sap_nwas_abap_pas_instance_no}:$${target_ip}:443$${sap_nwas_abap_pas_instance_no} ` + -L localhost:5$${sap_hana_instance_no}13:$${target_ip}:5$${sap_hana_instance_no}13 ` + -L localhost:5$${sap_hana_instance_no}14:$${target_ip}:5$${sap_hana_instance_no}14 + } + } + 2 { + foreach ($target_host in $target_host_array) { + $i=$target_host_array.IndexOf($target_host) + echo "$i) $target_host" + } + $target_host_selection = Read-Host "Please make a selection" + if ($target_host_array[$target_host_selection] -eq "Quit" ){ + break + }else { + $target_ip = $target_host_array[$target_host_selection] + #echo ">>> Chosen option $(PSItem)" + ssh -i $temp_target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + } + } + 3 { + break + } + } +} + +EOF + +} diff --git a/sap_solman_saphana_single_node_install/aws_ec2_instance/outputs_debug.tf b/sap_solman_saphana_single_node_install/aws_ec2_instance/outputs_debug.tf new file mode 100644 index 0000000..ff3141d --- /dev/null +++ b/sap_solman_saphana_single_node_install/aws_ec2_instance/outputs_debug.tf @@ -0,0 +1,4 @@ + +############################################################## +# DEBUG variable map +############################################################## diff --git a/sap_solman_saphana_single_node_install/aws_ec2_instance/variable_locals.tf b/sap_solman_saphana_single_node_install/aws_ec2_instance/variable_locals.tf new file mode 100644 index 0000000..8c2f87c --- /dev/null +++ b/sap_solman_saphana_single_node_install/aws_ec2_instance/variable_locals.tf @@ -0,0 +1,19 @@ +locals { + + aws_vpc_subnet_create_boolean = var.aws_vpc_subnet_id == "new" ? true : false + + # Directories start with "C:..." on Windows; All other OSs use "/" for root. + detect_windows = substr(pathexpand("~"), 0, 1) == "/" ? false : true + detect_shell = substr(pathexpand("~"), 0, 1) == "/" ? true : false + + # Used for displaying Shell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + not_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? false : true : true + + # Used for displaying Windows PowerShell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + is_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? true : false : false + + aws_region = replace(var.aws_vpc_availability_zone,"/[a-c]$/","") + +} diff --git a/sap_solman_saphana_single_node_install/aws_ec2_instance/variable_map_hosts.tf b/sap_solman_saphana_single_node_install/aws_ec2_instance/variable_map_hosts.tf new file mode 100644 index 0000000..0807532 --- /dev/null +++ b/sap_solman_saphana_single_node_install/aws_ec2_instance/variable_map_hosts.tf @@ -0,0 +1,75 @@ + +variable "map_host_specifications" { + + description = "Map of host specficiations for SAP NetWeaver AS (ABAP) with SAP HANA single node install" + + type = map(any) + + default = { + + small_256gb = { + + nw01 = { // Hostname + ec2_instance_type = "r5.8xlarge" + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 1 + disk_volume_type_hana_data = "gp3" + disk_volume_capacity_hana_data = 384 + #disk_volume_iops_hana_data = + lvm_enable_hana_data = false // if false, then disk volume count should be 1 + #lvm_pv_data_alignment_hana_data = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + #lvm_vg_data_alignment_hana_data = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + #lvm_vg_physical_extent_size_hana_data = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + #lvm_lv_stripe_size_hana_data = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_data = "xfs" + physical_partition_filesystem_block_size_hana_data = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_hana_log = 1 + disk_volume_type_hana_log = "gp3" + disk_volume_capacity_hana_log = 128 + #disk_volume_iops_hana_log = + lvm_enable_hana_log = false // if false, then disk volume count should be 1 + #lvm_pv_data_alignment_hana_log = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + #lvm_vg_data_alignment_hana_log = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + #lvm_vg_physical_extent_size_hana_log = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + #lvm_lv_stripe_size_hana_log = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_log = "xfs" + physical_partition_filesystem_block_size_hana_log = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_hana_shared = 1 + disk_volume_type_hana_shared = "gp3" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_hana_shared = 320 + #disk_volume_iops_hana_shared = + lvm_enable_hana_shared = false // if false, then disk volume count should be 1 + #lvm_pv_data_alignment_hana_shared = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + #lvm_vg_data_alignment_hana_shared = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + #lvm_vg_physical_extent_size_hana_shared = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + #lvm_lv_stripe_size_hana_shared = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_shared = "xfs" + physical_partition_filesystem_block_size_hana_shared = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 0 // max of 1 + disk_volume_type_usr_sap = "gp3" + disk_volume_capacity_usr_sap = 64 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_type_sapmnt = "gp3" + disk_volume_capacity_sapmnt = 50 + filesystem_sapmnt = "xfs" + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "gp3" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" + } + + } + + } +} diff --git a/sap_solman_saphana_single_node_install/aws_ec2_instance/variable_map_os.tf b/sap_solman_saphana_single_node_install/aws_ec2_instance/variable_map_os.tf new file mode 100644 index 0000000..6e9483c --- /dev/null +++ b/sap_solman_saphana_single_node_install/aws_ec2_instance/variable_map_os.tf @@ -0,0 +1,48 @@ + +variable "map_os_image_regex" { + + description = "Map of operating systems OS Image regex, to identify latest OS Image for the OS major.minor version" + + type = map(any) + + default = { + + rhel-8-1 = "*RHEL-8.1*_HVM*x86_64*" + + rhel-8-2 = "*RHEL-8.2*_HVM*x86_64*" + + rhel-8-4 = "*RHEL-8.4*_HVM*x86_64*" + + rhel-8-6 = "*RHEL-8.6*_HVM*x86_64*" + + rhel-7-7-sap-ha = "*RHEL-SAP-7.7*" + + rhel-7-9-sap-ha = "*RHEL-SAP-7.9*" + + rhel-8-1-sap-ha = "*RHEL-SAP-8.1.0*" + + rhel-8-2-sap-ha = "*RHEL-SAP-8.2.0*" + + rhel-8-4-sap-ha = "*RHEL-SAP-8.4.0*" + + rhel-8-6-sap-ha = "*RHEL-SAP-8.6.0*" + + sles-15-2 = "*suse-sles-15-sp2-v202*-hvm-ssd-x86_64*" + + sles-15-3 = "*suse-sles-15-sp3-v202*-hvm-ssd-x86_64*" + + sles-15-4 = "*suse-sles-15-sp4-v202*-hvm-ssd-x86_64*" + + sles-12-5-sap-ha = "*suse-sles-sap-12-sp5-v202*-hvm-ssd-x86_64*" + + sles-15-1-sap-ha = "*suse-sles-sap-15-sp1-v202*-hvm-ssd-x86_64*" + + sles-15-2-sap-ha = "*suse-sles-sap-15-sp2-v202*-hvm-ssd-x86_64*" + + sles-15-3-sap-ha = "*suse-sles-sap-15-sp3-v202*-hvm-ssd-x86_64*" + + sles-15-4-sap-ha = "*suse-sles-sap-15-sp4-v202*-hvm-ssd-x86_64*" + + } + +} diff --git a/sap_solman_saphana_single_node_install/aws_ec2_instance/variables.tf b/sap_solman_saphana_single_node_install/aws_ec2_instance/variables.tf new file mode 100644 index 0000000..8536c21 --- /dev/null +++ b/sap_solman_saphana_single_node_install/aws_ec2_instance/variables.tf @@ -0,0 +1,131 @@ + +variable "aws_access_key" { + description = "AWS Access Key" +} + +variable "aws_secret_key" { + description = "AWS Secret Key" +} + +variable "resource_prefix" { + description = "Prefix to resource names" +} + +variable "aws_vpc_availability_zone" { + description = "Target AWS VPC Availability Zone (the AWS Region will be calculated from this value)" +} + +variable "aws_vpc_subnet_id" { + description = "Enter existing/target VPC Subnet ID, or enter 'new' to create a VPC with a default VPC prefix range" +} + +variable "dns_root_domain" { + description = "Root Domain for Private DNS used with the Virtual Server" +} + +variable "bastion_os_image" { + description = "Bastion OS Image. This variable uses the locals mapping with regex of OS Images, and will alter bastion provisioning." +} + +variable "bastion_user" { + description = "OS User to create on Bastion host to avoid pass-through root user (e.g. bastionuser)" +} + +variable "bastion_ssh_port" { + type = number + description = "Bastion host SSH Port from IANA Dynamic Ports range (49152 to 65535)" + + validation { + condition = var.bastion_ssh_port > 49152 && var.bastion_ssh_port < 65535 + error_message = "Bastion host SSH Port must fall within IANA Dynamic Ports range (49152 to 65535)." + } +} + +variable "host_specification_plan" { + description = "Host specification plans are small_256gb. This variable uses the locals mapping with a nested list of host specifications, and will alter host provisioning." +} + +variable "host_os_image" { + description = "Host OS Image. This variable uses the locals mapping with regex of OS Images, and will alter host provisioning." +} + +variable "disk_volume_capacity_software" { + type = number + description = "Disk volume capacity for downloads of SAP Software" +} + +variable "disk_volume_type_software" { + description = "Disk volume type for downloads of SAP Software" +} + +variable "sap_software_download_directory" { + description = "Mount point for downloads of SAP Software" + + validation { + error_message = "Directory must start with forward slash." + condition = can(regex("^/", var.sap_software_download_directory)) + } + +} + + + +variable "sap_id_user" { + description = "Ansible - Please enter your SAP ID user (e.g. S-User)" +} + +variable "sap_id_user_password" { + description = "Ansible - Please enter your SAP ID password" +} + +variable "sap_hana_install_master_password" { + description = "Ansible - SAP HANA install: set common initial password (e.g. NewPass$321)" +} + +variable "sap_hana_install_sid" { + description = "Ansible - SAP HANA install: System ID (e.g. H01)" +} + +variable "sap_hana_install_instance_number" { + description = "Ansible - SAP HANA install: Instance Number (e.g. 90)" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_hana_install_instance_number)) + } + +} + +variable "sap_nwas_install_sid" { + description = "Ansible - SAP NetWeaver AS (ABAP) install: System ID (e.g. N01)" +} + +variable "sap_nwas_java_ci_instance_no" { + description = "Ansible - SAP NetWeaver AS (JAVA) - JAVA Central Instance (CI) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_java_ci_instance_no)) + } + +} + +variable "sap_nwas_abap_ascs_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - ABAP Central Services (ASCS) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_ascs_instance_no)) + } + +} + +variable "sap_nwas_abap_pas_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - Primary Application Server instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_pas_instance_no)) + } + +} diff --git a/sap_solman_saphana_single_node_install/aws_ec2_instance/variables_generic_for_cli.tfvars b/sap_solman_saphana_single_node_install/aws_ec2_instance/variables_generic_for_cli.tfvars new file mode 100644 index 0000000..6d45227 --- /dev/null +++ b/sap_solman_saphana_single_node_install/aws_ec2_instance/variables_generic_for_cli.tfvars @@ -0,0 +1,31 @@ +resource_prefix = "sap" + +dns_root_domain = "poc.cloud" + +bastion_os_image = "rhel-8-4-sap-ha" + +bastion_user = "bastionuser" + +bastion_ssh_port = 50222 + +host_specification_plan = "small_256gb" + +host_os_image = "rhel-8-4-sap-ha" + +disk_volume_capacity_software = 304 + +disk_volume_type_software = "gp3" + +sap_hana_install_master_password = "NewPass$321" + +sap_hana_install_sid = "H01" + +sap_hana_install_instance_number = "90" + +sap_nwas_abap_ascs_instance_no = "01" + +sap_nwas_abap_pas_instance_no = "00" + +sap_nwas_install_sid = "N01" + +sap_software_download_directory = "/software" diff --git a/sap_solman_saphana_single_node_install/aws_ec2_instance/versions.tf b/sap_solman_saphana_single_node_install/aws_ec2_instance/versions.tf new file mode 100644 index 0000000..f3d8ef7 --- /dev/null +++ b/sap_solman_saphana_single_node_install/aws_ec2_instance/versions.tf @@ -0,0 +1,29 @@ +# Terraform declaration + +terraform { + required_version = ">= 1.0" + required_providers { + aws = { + #source = "localdomain/provider/aws" // Local, on macOS path to place files would be $HOME/.terraform.d/plugins/localdomain/provider/aws/1.xx.xx/darwin_amd6 + source = "hashicorp/aws" // Terraform Registry + version = ">=3.73.0" + } + } +} + + +# Terraform Provider declaration + +provider "aws" { + + # Define Provider inputs manually + # access_key = "xxxxxxx" + # secret_key = "xxxxxxx" + # region = "xxxxxxx" + + # Define Provider inputs from given Terraform Variables + access_key = var.aws_access_key + secret_key = var.aws_secret_key + region = local.aws_region + +} diff --git a/sap_solman_saphana_single_node_install/gcp_ce_vm/main.tf b/sap_solman_saphana_single_node_install/gcp_ce_vm/main.tf new file mode 100644 index 0000000..97c2001 --- /dev/null +++ b/sap_solman_saphana_single_node_install/gcp_ce_vm/main.tf @@ -0,0 +1,288 @@ + +module "run_ansible_dry_run" { + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=dev" + + module_var_dry_run_test = "x86_64" // x86_64 or ppc64le + + # Terraform Module Variables which are mandatory, all with an empty string + module_var_bastion_boolean = false + module_var_bastion_user = "" + module_var_bastion_ssh_port = 0 + module_var_bastion_private_ssh_key = "" + module_var_bastion_floating_ip = "" + module_var_host_private_ssh_key = "" + module_var_host_private_ip = "" + module_var_hostname = "software_media_dry_run" + module_var_dns_root_domain_name = "" + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + module_var_sap_swpm_sid = "" + module_var_sap_swpm_db_schema_abap = "" + module_var_sap_swpm_db_schema_abap_password = "" + module_var_sap_swpm_ddic_000_password = "" + module_var_sap_swpm_template_selected = "sap_solman_72_sr2_saphana_onehost" +} + + +module "run_account_init_module" { + + depends_on = [ + module.run_ansible_dry_run + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/account_init?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_region = local.google_cloud_region + module_var_gcp_vpc_subnet_create_boolean = local.google_cloud_vpc_subnet_create_boolean + module_var_gcp_vpc_subnet_name = local.google_cloud_vpc_subnet_create_boolean ? 0 : var.google_cloud_vpc_subnet_name + +} + + +module "run_account_bootstrap_module" { + + depends_on = [ + module.run_account_init_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/account_bootstrap?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_vpc_subnet_name = module.run_account_init_module.output_vpc_subnet_name + + module_var_dns_root_domain_name = var.dns_root_domain + +} + + +module "run_bastion_inject_module" { + + depends_on = [ + module.run_account_bootstrap_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/bastion_inject?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_region = local.google_cloud_region + module_var_gcp_region_zone = var.google_cloud_region_zone + module_var_gcp_vpc_subnet_name = module.run_account_init_module.output_vpc_subnet_name + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_os_image = var.map_os_image_regex[var.bastion_os_image] + + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + module_var_bastion_public_ssh_key = module.run_account_bootstrap_module.output_bastion_public_ssh_key + +} + + +module "run_host_network_access_sap_module" { + + depends_on = [ + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/host_network_access_sap?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_vpc_subnet_name = module.run_account_init_module.output_vpc_subnet_name + + module_var_sap_nwas_abap_pas_instance_no = var.sap_nwas_abap_pas_instance_no + module_var_sap_hana_instance_no = var.sap_hana_install_instance_number + +} + + +module "run_host_network_access_sap_public_via_proxy_module" { + + depends_on = [ + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/host_network_access_sap_public_via_proxy?ref=main" + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_vpc_subnet_name = module.run_account_init_module.output_vpc_subnet_name + + module_var_sap_nwas_abap_pas_instance_no = var.sap_nwas_abap_pas_instance_no + module_var_sap_hana_instance_no = var.sap_hana_install_instance_number + + module_var_bastion_subnet_name = module.run_bastion_inject_module.output_bastion_subnet_name + +} + + +module "run_host_provision_module" { + + depends_on = [ + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//gcp_ce_vm/host_provision?ref=main" + + + module_var_resource_prefix = var.resource_prefix + + module_var_gcp_region_zone = var.google_cloud_region_zone + module_var_gcp_vpc_subnet_name = module.run_account_init_module.output_vpc_subnet_name + + module_var_dns_root_domain_name = var.dns_root_domain + module_var_dns_zone_name = module.run_account_bootstrap_module.output_dns_zone_name + + module_var_host_os_image = var.map_os_image_regex[var.host_os_image] + + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_user = var.bastion_user + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + module_var_bastion_ip = module.run_bastion_inject_module.output_bastion_ip + + module_var_host_ssh_public_key = module.run_account_bootstrap_module.output_host_public_ssh_key + module_var_host_ssh_private_key = module.run_account_bootstrap_module.output_host_private_ssh_key + + + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable with nested objects + + for_each = toset([ + for key, value in var.map_host_specifications[var.host_specification_plan] : key + ]) + + module_var_virtual_machine_hostname = each.key + + module_var_virtual_machine_profile = var.map_host_specifications[var.host_specification_plan][each.key].virtual_machine_profile + + module_var_disk_volume_count_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data + module_var_disk_volume_type_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data + module_var_disk_volume_capacity_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_data + module_var_disk_volume_iops_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_data : null + module_var_lvm_enable_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data + module_var_lvm_pv_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_data : 0 + module_var_lvm_vg_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_data : 0 + module_var_lvm_vg_physical_extent_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_data : 0 + module_var_lvm_lv_stripe_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_data : 0 + module_var_filesystem_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_data + module_var_physical_partition_filesystem_block_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_data + + module_var_disk_volume_count_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log + module_var_disk_volume_type_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log + module_var_disk_volume_capacity_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_log + module_var_disk_volume_iops_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_log : null + module_var_lvm_enable_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log + module_var_lvm_pv_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_log : 0 + module_var_lvm_vg_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_log : 0 + module_var_lvm_vg_physical_extent_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_log : 0 + module_var_lvm_lv_stripe_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_log : 0 + module_var_filesystem_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_log + module_var_physical_partition_filesystem_block_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_log + + module_var_disk_volume_count_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared + module_var_disk_volume_type_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared + module_var_disk_volume_capacity_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_shared + module_var_disk_volume_iops_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_shared : null + module_var_lvm_enable_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared + module_var_lvm_pv_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_shared : 0 + module_var_lvm_vg_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_shared : 0 + module_var_lvm_vg_physical_extent_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_shared : 0 + module_var_lvm_lv_stripe_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_shared : 0 + module_var_filesystem_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_shared + module_var_physical_partition_filesystem_block_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_shared + + module_var_disk_volume_count_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb + module_var_disk_volume_type_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb + module_var_disk_volume_capacity_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_anydb + module_var_disk_volume_iops_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_anydb : null + module_var_lvm_enable_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb + module_var_lvm_pv_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_anydb : 0 + module_var_lvm_vg_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_anydb : 0 + module_var_lvm_vg_physical_extent_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_anydb : 0 + module_var_lvm_lv_stripe_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_anydb : 0 + module_var_filesystem_mount_path_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_mount_path_anydb + module_var_filesystem_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_anydb + module_var_physical_partition_filesystem_block_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_anydb + + module_var_disk_volume_count_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_usr_sap + module_var_disk_volume_type_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_usr_sap + module_var_disk_volume_capacity_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_usr_sap + module_var_filesystem_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_usr_sap + + module_var_disk_volume_count_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_sapmnt + module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt + module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt + module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation + + module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb + module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap + module_var_disk_volume_type_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_swap : 0 + module_var_disk_volume_capacity_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_swap : 0 + module_var_filesystem_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].filesystem_swap : 0 + + module_var_disk_volume_type_software = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_software + module_var_disk_volume_capacity_software = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_software + module_var_sap_software_download_directory = var.sap_software_download_directory + +} + + +module "run_ansible_sap_solman_saphana_install" { + + depends_on = [module.run_host_provision_module] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=dev" + + + # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) + module_var_bastion_boolean = true // required as true boolean for any Cloud Service Provider (CSP) + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_floating_ip = module.run_bastion_inject_module.output_bastion_ip + + module_var_host_private_ssh_key = module.run_account_bootstrap_module.output_host_private_ssh_key + + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable at runtime + + for_each = module.run_host_provision_module + module_var_host_private_ip = join(", ", each.value.*.output_host_private_ip) + module_var_hostname = join(", ", each.value.*.output_host_name) + module_var_dns_root_domain_name = var.dns_root_domain + + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + + module_var_sap_hana_install_master_password = var.sap_hana_install_master_password + module_var_sap_hana_install_sid = var.sap_hana_install_sid + module_var_sap_hana_install_instance_number = var.sap_hana_install_instance_number + + module_var_sap_swpm_sid = var.sap_nwas_install_sid + + module_var_sap_swpm_db_schema_abap = "SAPABAP1" + module_var_sap_swpm_db_schema_abap_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_system_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_systemdb_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_sidadm_password = var.sap_hana_install_master_password + module_var_sap_swpm_ddic_000_password = var.sap_hana_install_master_password + module_var_sap_swpm_ascs_instance_nr = var.sap_nwas_abap_ascs_instance_no + module_var_sap_swpm_pas_instance_nr = var.sap_nwas_abap_pas_instance_no + + module_var_sap_swpm_nwas_java_instance_nr = var.sap_nwas_java_ci_instance_no + + module_var_sap_swpm_master_password = var.sap_hana_install_master_password + + module_var_sap_swpm_template_selected = "sap_solman_72_sr2_saphana_onehost" + + module_var_sap_software_download_directory = var.sap_software_download_directory + +} diff --git a/sap_solman_saphana_single_node_install/gcp_ce_vm/outputs.tf b/sap_solman_saphana_single_node_install/gcp_ce_vm/outputs.tf new file mode 100644 index 0000000..f047a9b --- /dev/null +++ b/sap_solman_saphana_single_node_install/gcp_ce_vm/outputs.tf @@ -0,0 +1,235 @@ + +############################################################## +# Export SSH key to file on local +############################################################## + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "bastion_rsa" { + content = module.run_account_bootstrap_module.output_bastion_private_ssh_key + filename = "${path.root}/ssh/bastion_rsa" + file_permission = "0400" +} + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "hosts_rsa" { + content = module.run_account_bootstrap_module.output_host_private_ssh_key + filename = "${path.root}/ssh/hosts_rsa" + file_permission = "0400" +} + + +output "ssh_sap_connection_details" { + value = local.is_wsl ? "IGNORE" : <>> Chosen option $REPLY: $opt" + select opt_ip in "$${target_host_array[@]}"; do + if [ $opt_ip = "Quit" ]; then break 2; fi + target_ip=$opt_ip + echo "---- Selected option $REPLY, tunneling into $target_ip ----" + break + done + echo "" + echo "#### For SAP HANA Studio, use Add System with host name as localhost; do not add port numbers." + echo "#### If selecting 'Connect using SSL' on Connection Properties, then on Additional Properties (final) screen deselect 'Validate the SSL certificate'" + echo "" + echo "#### For SAPGUI, use expert mode SAP Logon String as: ####" + echo "conn=/H/localhost/S/32$sap_nwas_abap_pas_instance_no&expert=true" + echo "" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N \ + $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file \ + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -L localhost:32$sap_nwas_abap_pas_instance_no:$target_ip:32$sap_nwas_abap_pas_instance_no \ + -L localhost:33$sap_nwas_abap_pas_instance_no:$target_ip:33$sap_nwas_abap_pas_instance_no \ + -L localhost:3$${sap_hana_instance_no}13:$target_ip:3$${sap_hana_instance_no}13 \ + -L localhost:3$${sap_hana_instance_no}15:$target_ip:3$${sap_hana_instance_no}15 \ + -L localhost:3$${sap_hana_instance_no}41:$target_ip:3$${sap_hana_instance_no}41 \ + -L localhost:443$sap_hana_instance_no:$target_ip:443$sap_hana_instance_no \ + -L localhost:443$sap_nwas_abap_pas_instance_no:$target_ip:443$sap_nwas_abap_pas_instance_no \ + -L localhost:5$${sap_hana_instance_no}13:$target_ip:5$${sap_hana_instance_no}13 \ + -L localhost:5$${sap_hana_instance_no}14:$target_ip:5$${sap_hana_instance_no}14 + break + ;; + "OS root access, via SSH stdin/stdout forwarding proxy") + echo ">>> Chosen option $REPLY: $opt" + select opt_ssh in "$${target_host_array[@]}"; do + if [ $opt_ssh = "Quit" ]; then break 2; fi + target_ip=$opt_ssh + echo "---- Selected option $REPLY, logging into $target_ip ----" + break + done + + if [ -n "$target_ip" ]; then + ssh -i $target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + fi + break + ;; + "Quit") + break + ;; + *) echo "Invalid option $REPLY" ;; + esac + done +} + +# Then call shell function and select which target +sshjump + +EOF +} + + +# If detected Windows WSL2, then find the installed name using external resource to return a JSON string +data "external" "wsl_distro_name" { + count = local.is_wsl ? 1 : 0 + program = ["bash", "-c", "echo \"{\\\"stdout\\\":\\\"$(echo $WSL_DISTRO_NAME)\\\"}\""] +} + +output "ssh_sap_connection_details_windows" { + value = local.not_wsl ? "IGNORE" : <>> Chosen option $(PSItem)" + echo "" + echo "#### For SAP HANA Studio, use Add System with host name as localhost; do not add port numbers." + echo "#### If selecting 'Connect using SSL' on Connection Properties, then on Additional Properties (final) screen deselect 'Validate the SSL certificate'" + echo "" + echo "#### For SAPGUI, use expert mode SAP Logon String as: ####" + echo "conn=/H/localhost/S/32$sap_nwas_abap_pas_instance_no&expert=true" + echo "" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N ` + $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -L localhost:32$${sap_nwas_abap_pas_instance_no}:$${target_ip}:32$${sap_nwas_abap_pas_instance_no} ` + -L localhost:33$${sap_nwas_abap_pas_instance_no}:$${target_ip}:33$${sap_nwas_abap_pas_instance_no} ` + -L localhost:3$${sap_hana_instance_no}13:$${target_ip}:3$${sap_hana_instance_no}13 ` + -L localhost:3$${sap_hana_instance_no}15:$${target_ip}:3$${sap_hana_instance_no}15 ` + -L localhost:3$${sap_hana_instance_no}41:$${target_ip}:3$${sap_hana_instance_no}41 ` + -L localhost:443$${sap_hana_instance_no}:$${target_ip}:443$${sap_hana_instance_no} ` + -L localhost:443$${sap_nwas_abap_pas_instance_no}:$${target_ip}:443$${sap_nwas_abap_pas_instance_no} ` + -L localhost:5$${sap_hana_instance_no}13:$${target_ip}:5$${sap_hana_instance_no}13 ` + -L localhost:5$${sap_hana_instance_no}14:$${target_ip}:5$${sap_hana_instance_no}14 + } + } + 2 { + foreach ($target_host in $target_host_array) { + $i=$target_host_array.IndexOf($target_host) + echo "$i) $target_host" + } + $target_host_selection = Read-Host "Please make a selection" + if ($target_host_array[$target_host_selection] -eq "Quit" ){ + break + }else { + $target_ip = $target_host_array[$target_host_selection] + #echo ">>> Chosen option $(PSItem)" + ssh -i $temp_target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + } + } + 3 { + break + } + } +} + +EOF + +} diff --git a/sap_solman_saphana_single_node_install/gcp_ce_vm/variable_locals.tf b/sap_solman_saphana_single_node_install/gcp_ce_vm/variable_locals.tf new file mode 100644 index 0000000..8f30669 --- /dev/null +++ b/sap_solman_saphana_single_node_install/gcp_ce_vm/variable_locals.tf @@ -0,0 +1,19 @@ +locals { + + google_cloud_vpc_subnet_create_boolean = var.google_cloud_vpc_subnet_name == "new" ? true : false + + google_cloud_region = replace(var.google_cloud_region_zone, "/-[^-]*$/", "") + + # Directories start with "C:..." on Windows; All other OSs use "/" for root. + detect_windows = substr(pathexpand("~"), 0, 1) == "/" ? false : true + detect_shell = substr(pathexpand("~"), 0, 1) == "/" ? true : false + + # Used for displaying Shell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + not_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? false : true : true + + # Used for displaying Windows PowerShell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + is_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? true : false : false + +} diff --git a/sap_solman_saphana_single_node_install/gcp_ce_vm/variable_map_hosts.tf b/sap_solman_saphana_single_node_install/gcp_ce_vm/variable_map_hosts.tf new file mode 100644 index 0000000..2bf6c07 --- /dev/null +++ b/sap_solman_saphana_single_node_install/gcp_ce_vm/variable_map_hosts.tf @@ -0,0 +1,81 @@ + +variable "map_host_specifications" { + + description = "Map of host specficiations for SAP NetWeaver AS (ABAP) with SAP HANA single node install" + + type = map(any) + + default = { + + small_256gb = { + + hana01 = { + virtual_machine_profile = "n2-highmem-32" // 32 vCPU, 256GB Memory + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 1 + disk_volume_type_hana_data = "pd-ssd" + disk_volume_capacity_hana_data = 384 + #disk_volume_iops_hana_data = + lvm_enable_hana_data = false // if false, then disk volume count should be 1 + #lvm_pv_data_alignment_hana_data = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + #lvm_vg_data_alignment_hana_data = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + #lvm_vg_physical_extent_size_hana_data = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + #lvm_lv_stripe_size_hana_data = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_data = "xfs" + physical_partition_filesystem_block_size_hana_data = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_hana_log = 1 + disk_volume_type_hana_log = "pd-ssd" + disk_volume_capacity_hana_log = 128 + #disk_volume_iops_hana_log = + lvm_enable_hana_log = false // if false, then disk volume count should be 1 + #lvm_pv_data_alignment_hana_log = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + #lvm_vg_data_alignment_hana_log = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + #lvm_vg_physical_extent_size_hana_log = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + #lvm_lv_stripe_size_hana_log = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_log = "xfs" + physical_partition_filesystem_block_size_hana_log = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_hana_shared = 1 + disk_volume_type_hana_shared = "pd-balanced" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_hana_shared = 320 + #disk_volume_iops_hana_shared = + lvm_enable_hana_shared = false // if false, then disk volume count should be 1 + #lvm_pv_data_alignment_hana_shared = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + #lvm_vg_data_alignment_hana_shared = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + #lvm_vg_physical_extent_size_hana_shared = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + #lvm_lv_stripe_size_hana_shared = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_shared = "xfs" + physical_partition_filesystem_block_size_hana_shared = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 0 // max of 1 + disk_volume_type_usr_sap = "pd-standard" + disk_volume_capacity_usr_sap = 64 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_type_sapmnt = "pd-standard" + disk_volume_capacity_sapmnt = 50 + filesystem_sapmnt = "xfs" + nfs_boolean_sapmnt = false + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "pd-standard" + disk_volume_capacity_swap = 32 + filesystem_swap = "xfs" + + disk_volume_type_software = "pd-standard" + disk_volume_capacity_software = 100 + } + + } + + } + +} + diff --git a/sap_solman_saphana_single_node_install/gcp_ce_vm/variable_map_os.tf b/sap_solman_saphana_single_node_install/gcp_ce_vm/variable_map_os.tf new file mode 100644 index 0000000..954ecd3 --- /dev/null +++ b/sap_solman_saphana_single_node_install/gcp_ce_vm/variable_map_os.tf @@ -0,0 +1,79 @@ + +# There is no Terraform Resource for data lookup of all GCP OS Images, therefore the input does not use wildcard + +variable "map_os_image_regex" { + + description = "Map of operating systems OS Image, static OS Image names, to identify latest OS Image for the OS major.minor version" + + type = map(any) + + default = { + + rhel-8-latest = { + project = "rhel-cloud" + family = "rhel-8" + }, + + rhel-7-7-sap-ha = { + project = "rhel-sap-cloud" + family = "rhel-7-7-sap-ha" + }, + + rhel-7-9-sap-ha = { + project = "rhel-sap-cloud" + family = "rhel-7-9-sap-ha" + }, + + rhel-8-1-sap-ha = { + project = "rhel-sap-cloud" + family = "rhel-8-1-sap-ha" + }, + + rhel-8-2-sap-ha = { + project = "rhel-sap-cloud" + family = "rhel-8-2-sap-ha" + }, + + rhel-8-4-sap-ha = { + project = "rhel-sap-cloud" + family = "rhel-8-4-sap-ha" + }, + + rhel-8-6-sap-ha = { + project = "rhel-sap-cloud" + family = "rhel-8-6-sap-ha" + }, + + sles-15-latest = { + project = "suse-cloud" + family = "sles-15" + }, + + sles-12-sp5-sap = { + project = "suse-sap-cloud" + family = "sles-12-sp5-sap" + }, + + sles-15-sp1-sap = { + project = "suse-sap-cloud" + family = "sles-15-sp1-sap" + }, + + sles-15-sp2-sap = { + project = "suse-sap-cloud" + family = "sles-15-sp2-sap" + }, + + sles-15-sp3-sap = { + project = "suse-sap-cloud" + family = "sles-15-sp3-sap" + }, + + sles-15-sp4-sap = { + project = "suse-sap-cloud" + family = "sles-15-sp4-sap" + }, + + } + +} diff --git a/sap_solman_saphana_single_node_install/gcp_ce_vm/variables.tf b/sap_solman_saphana_single_node_install/gcp_ce_vm/variables.tf new file mode 100644 index 0000000..6a30cc8 --- /dev/null +++ b/sap_solman_saphana_single_node_install/gcp_ce_vm/variables.tf @@ -0,0 +1,122 @@ + +variable "google_cloud_project" { + description = "Target GCP Project ID" +} + +variable "google_cloud_region_zone" { + description = "Target GCP Zone, the GCP Region will be calculated from this value (e.g. europe-west9-a)" +} + +variable "google_cloud_credentials_json" { + description = "Enter path to GCP Key File for Service Account (or Google Application Default Credentials JSON file for GCloud CLI)" +} + +variable "google_cloud_vpc_subnet_name" { + description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC" +} + +variable "resource_prefix" { + description = "Prefix to resource names" +} + +variable "dns_root_domain" { + description = "Root Domain for Private DNS used with the Virtual Machine" +} + +variable "bastion_os_image" { + description = "Bastion OS Image. This variable uses the locals mapping with regex of OS Images, and will alter bastion provisioning." +} + +variable "bastion_user" { + description = "OS User to create on Bastion host to avoid pass-through root user (e.g. bastionuser)" +} + +variable "bastion_ssh_port" { + type = number + description = "Bastion host SSH Port from IANA Dynamic Ports range (49152 to 65535)" + + validation { + condition = var.bastion_ssh_port > 49152 && var.bastion_ssh_port < 65535 + error_message = "Bastion host SSH Port must fall within IANA Dynamic Ports range (49152 to 65535)." + } +} + +variable "host_specification_plan" { + description = "Host specification plans are small_256gb. This variable uses the locals mapping with a nested list of host specifications, and will alter host provisioning." +} + +variable "host_os_image" { + description = "Host OS Image. This variable uses the locals mapping with regex of OS Images, and will alter host provisioning." +} + +variable "sap_software_download_directory" { + description = "Mount point for downloads of SAP Software" + + validation { + error_message = "Directory must start with forward slash." + condition = can(regex("^/", var.sap_software_download_directory)) + } + +} + + + +variable "sap_id_user" { + description = "Ansible - Please enter your SAP ID user (e.g. S-User)" +} + +variable "sap_id_user_password" { + description = "Ansible - Please enter your SAP ID password" +} + +variable "sap_hana_install_master_password" { + description = "Ansible - SAP HANA install: set common initial password (e.g. NewPass$321)" +} + +variable "sap_hana_install_sid" { + description = "Ansible - SAP HANA install: System ID (e.g. H01)" +} + +variable "sap_hana_install_instance_number" { + description = "Ansible - SAP HANA install: Instance Number (e.g. 90)" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_hana_install_instance_number)) + } + +} + +variable "sap_nwas_install_sid" { + description = "Ansible - SAP NetWeaver AS (ABAP) install: System ID (e.g. N01)" +} + +variable "sap_nwas_java_ci_instance_no" { + description = "Ansible - SAP NetWeaver AS (JAVA) - JAVA Central Instance (CI) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_java_ci_instance_no)) + } + +} + +variable "sap_nwas_abap_ascs_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - ABAP Central Services (ASCS) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_ascs_instance_no)) + } + +} + +variable "sap_nwas_abap_pas_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - Primary Application Server instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_pas_instance_no)) + } + +} diff --git a/sap_solman_saphana_single_node_install/gcp_ce_vm/variables_generic_for_cli.tfvars b/sap_solman_saphana_single_node_install/gcp_ce_vm/variables_generic_for_cli.tfvars new file mode 100644 index 0000000..4962bd3 --- /dev/null +++ b/sap_solman_saphana_single_node_install/gcp_ce_vm/variables_generic_for_cli.tfvars @@ -0,0 +1,28 @@ + +resource_prefix = "sap" + +dns_root_domain = "poc.cloud" + +bastion_os_image = "rhel-8-latest" + +bastion_user = "bastionuser" + +bastion_ssh_port = 50222 + +host_specification_plan = "small_256gb" + +host_os_image = "rhel-8-4-sap-ha" + +sap_hana_install_master_password = "NewPass$321" + +sap_hana_install_sid = "H01" + +sap_hana_install_instance_number = "90" + +sap_nwas_abap_ascs_instance_no = "01" + +sap_nwas_abap_pas_instance_no = "00" + +sap_nwas_install_sid = "N01" + +sap_software_download_directory = "/software" diff --git a/sap_solman_saphana_single_node_install/gcp_ce_vm/versions.tf b/sap_solman_saphana_single_node_install/gcp_ce_vm/versions.tf new file mode 100644 index 0000000..346ab78 --- /dev/null +++ b/sap_solman_saphana_single_node_install/gcp_ce_vm/versions.tf @@ -0,0 +1,34 @@ +# Terraform declaration + +terraform { + required_version = ">= 1.0" + required_providers { + google = { + #source = "localdomain/provider/google" // Local, on macOS path to place files would be $HOME/.terraform.d/plugins/localdomain/provider/google/1.xx.xx/darwin_amd6 + source = "hashicorp/google" // Terraform Registry + version = ">=4.50.0" + } + } +} + +# Terraform Provider declaration +# +# Nested provider configurations cannot be used with depends_on meta-argument between modules +# +# The calling module block can use either: +# - "providers" argument in the module block +# - none, inherit default (un-aliased) provider configuration +# +# Therefore the below is blank and is only for reference if this module needs to be executed manually + + +# Terraform Provider declaration + +provider "google" { + project = var.google_cloud_project + region = local.google_cloud_region + zone = var.google_cloud_region_zone + + credentials = var.google_cloud_credentials_json + +} diff --git a/sap_solman_saphana_single_node_install/ibmcloud_vs/main.tf b/sap_solman_saphana_single_node_install/ibmcloud_vs/main.tf new file mode 100644 index 0000000..9615bd7 --- /dev/null +++ b/sap_solman_saphana_single_node_install/ibmcloud_vs/main.tf @@ -0,0 +1,326 @@ + +module "run_ansible_dry_run" { + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=dev" + + module_var_dry_run_test = "x86_64" // x86_64 or ppc64le + + # Terraform Module Variables which are mandatory, all with an empty string + module_var_bastion_boolean = false + module_var_bastion_user = "" + module_var_bastion_ssh_port = 0 + module_var_bastion_private_ssh_key = "" + module_var_bastion_floating_ip = "" + module_var_host_private_ssh_key = "" + module_var_host_private_ip = "" + module_var_hostname = "software_media_dry_run" + module_var_dns_root_domain_name = "" + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + module_var_sap_swpm_sid = "" + module_var_sap_swpm_db_schema_abap = "" + module_var_sap_swpm_db_schema_abap_password = "" + module_var_sap_swpm_ddic_000_password = "" + module_var_sap_swpm_template_selected = "sap_solman_72_sr2_saphana_onehost" +} + + +module "run_account_init_module" { + + depends_on = [ + module.run_ansible_dry_run + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_init?ref=main" + + module_var_resource_group_name = local.resource_group_create_boolean ? 0 : var.ibmcloud_resource_group + module_var_resource_group_create_boolean = local.resource_group_create_boolean + + module_var_resource_prefix = var.resource_prefix + + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? 0 : var.ibmcloud_vpc_subnet_name + module_var_ibmcloud_vpc_subnet_create_boolean = local.ibmcloud_vpc_subnet_create_boolean + module_var_ibmcloud_vpc_availability_zone = var.ibmcloud_vpc_availability_zone + +} + + +module "run_account_bootstrap_module" { + + depends_on = [ + module.run_account_init_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_bootstrap?ref=main" + + module_var_resource_group_id = module.run_account_init_module.output_resource_group_id + module_var_resource_prefix = var.resource_prefix + + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name + module_var_ibmcloud_vpc_availability_zone = var.ibmcloud_vpc_availability_zone + + module_var_dns_root_domain_name = var.dns_root_domain + +} + + +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} + + +module "run_bastion_inject_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/bastion_inject?ref=main" + + module_var_resource_group_id = module.run_account_init_module.output_resource_group_id + module_var_resource_prefix = var.resource_prefix + module_var_resource_tags = var.resource_tags + + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_ssh_key_id = module.run_account_bootstrap_module.output_bastion_ssh_key_id + module_var_bastion_public_ssh_key = module.run_account_bootstrap_module.output_bastion_public_ssh_key + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_os_image = var.map_os_image_regex[var.bastion_os_image] + +} + + +module "run_host_network_access_sap_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_network_access_sap?ref=main" + + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name + module_var_host_security_group_id = module.run_account_bootstrap_module.output_host_security_group_id + + module_var_sap_nwas_abap_ascs_instance_no = var.sap_nwas_abap_ascs_instance_no + module_var_sap_nwas_abap_pas_instance_no = var.sap_nwas_abap_pas_instance_no + module_var_sap_nwas_java_ci_instance_no = var.sap_nwas_java_ci_instance_no + module_var_sap_hana_instance_no = "" + +} + + +module "run_host_network_access_sap_public_via_proxy_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_network_access_sap_public_via_proxy?ref=main" + + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name + + module_var_bastion_security_group_id = module.run_bastion_inject_module.output_bastion_security_group_id + module_var_bastion_connection_security_group_id = module.run_bastion_inject_module.output_bastion_connection_security_group_id + module_var_host_security_group_id = module.run_account_bootstrap_module.output_host_security_group_id + + module_var_sap_nwas_abap_pas_instance_no = var.sap_nwas_abap_pas_instance_no + module_var_sap_nwas_java_ci_instance_no = var.sap_nwas_java_ci_instance_no + module_var_sap_hana_instance_no = "" + +} + + +module "run_host_provision_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_provision?ref=main" + + # Set Terraform Module Variables using Terraform Variables at runtime + + module_var_resource_group_id = module.run_account_init_module.output_resource_group_id + module_var_resource_prefix = var.resource_prefix + module_var_resource_tags = var.resource_tags + + module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_floating_ip = module.run_bastion_inject_module.output_bastion_ip + module_var_bastion_connection_security_group_id = module.run_bastion_inject_module.output_bastion_connection_security_group_id + + module_var_host_ssh_key_id = module.run_account_bootstrap_module.output_host_ssh_key_id + module_var_host_private_ssh_key = module.run_account_bootstrap_module.output_host_private_ssh_key + module_var_host_security_group_id = module.run_account_bootstrap_module.output_host_security_group_id + + module_var_host_os_image = var.map_os_image_regex[var.host_os_image] + + module_var_dns_root_domain_name = var.dns_root_domain + module_var_dns_services_instance = module.run_account_bootstrap_module.output_host_dns_services_instance + + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable with nested objects + + for_each = toset([ + for key, value in var.map_host_specifications[var.host_specification_plan] : key + ]) + + module_var_virtual_server_hostname = each.key + + module_var_virtual_server_profile = var.map_host_specifications[var.host_specification_plan][each.key].virtual_server_profile + + module_var_disk_volume_count_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data + module_var_disk_volume_type_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data + module_var_disk_volume_capacity_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_data + module_var_disk_volume_iops_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_data : null + module_var_lvm_enable_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data + module_var_lvm_pv_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_data : 0 + module_var_lvm_vg_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_data : 0 + module_var_lvm_vg_physical_extent_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_data : 0 + module_var_lvm_lv_stripe_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_data : 0 + module_var_filesystem_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_data + module_var_physical_partition_filesystem_block_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_data + + module_var_disk_volume_count_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log + module_var_disk_volume_type_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log + module_var_disk_volume_capacity_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_log + module_var_disk_volume_iops_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_log : null + module_var_lvm_enable_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log + module_var_lvm_pv_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_log : 0 + module_var_lvm_vg_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_log : 0 + module_var_lvm_vg_physical_extent_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_log : 0 + module_var_lvm_lv_stripe_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_log : 0 + module_var_filesystem_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_log + module_var_physical_partition_filesystem_block_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_log + + module_var_disk_volume_count_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared + module_var_disk_volume_type_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared + module_var_disk_volume_capacity_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_shared + module_var_disk_volume_iops_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_shared : null + module_var_lvm_enable_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared + module_var_lvm_pv_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_shared : 0 + module_var_lvm_vg_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_shared : 0 + module_var_lvm_vg_physical_extent_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_shared : 0 + module_var_lvm_lv_stripe_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_shared : 0 + module_var_filesystem_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_shared + module_var_physical_partition_filesystem_block_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_shared + + module_var_disk_volume_count_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb + module_var_disk_volume_type_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb + module_var_disk_volume_capacity_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_anydb + module_var_disk_volume_iops_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_anydb : null + module_var_lvm_enable_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb + module_var_lvm_pv_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_anydb : 0 + module_var_lvm_vg_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_anydb : 0 + module_var_lvm_vg_physical_extent_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_anydb : 0 + module_var_lvm_lv_stripe_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_anydb : 0 + module_var_filesystem_mount_path_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_mount_path_anydb + module_var_filesystem_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_anydb + module_var_physical_partition_filesystem_block_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_anydb + + module_var_disk_volume_count_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_usr_sap + module_var_disk_volume_type_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_usr_sap + module_var_disk_volume_capacity_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_usr_sap + module_var_filesystem_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_usr_sap + + module_var_disk_volume_count_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_sapmnt + module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt + module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt + module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation + + module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb + module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap + module_var_disk_volume_type_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_swap : 0 + module_var_disk_volume_capacity_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_swap : 0 + module_var_filesystem_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].filesystem_swap : 0 + + module_var_disk_volume_type_software = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_software + module_var_disk_volume_capacity_software = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_software + module_var_sap_software_download_directory = var.sap_software_download_directory + + module_var_disable_ip_anti_spoofing = false + +} + + + +module "run_ansible_sap_solman_saphana_install" { + + depends_on = [module.run_host_provision_module] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=dev" + + + # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) + module_var_bastion_boolean = true // required as true boolean for any Cloud Service Provider (CSP) + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_floating_ip = module.run_bastion_inject_module.output_bastion_ip + + module_var_host_private_ssh_key = module.run_account_bootstrap_module.output_host_private_ssh_key + + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable at runtime + + for_each = module.run_host_provision_module + module_var_host_private_ip = join(", ", each.value.*.output_host_private_ip) + module_var_hostname = join(", ", each.value.*.output_host_name) + module_var_dns_root_domain_name = var.dns_root_domain + + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + + module_var_sap_hana_install_master_password = var.sap_hana_install_master_password + module_var_sap_hana_install_sid = var.sap_hana_install_sid + module_var_sap_hana_install_instance_number = var.sap_hana_install_instance_number + + module_var_sap_swpm_sid = var.sap_nwas_install_sid + + module_var_sap_swpm_db_schema_abap = "SAPABAP1" + module_var_sap_swpm_db_schema_abap_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_system_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_systemdb_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_sidadm_password = var.sap_hana_install_master_password + module_var_sap_swpm_ddic_000_password = var.sap_hana_install_master_password + module_var_sap_swpm_ascs_instance_nr = var.sap_nwas_abap_ascs_instance_no + module_var_sap_swpm_pas_instance_nr = var.sap_nwas_abap_pas_instance_no + + module_var_sap_swpm_nwas_java_instance_nr = var.sap_nwas_java_ci_instance_no + + module_var_sap_swpm_master_password = var.sap_hana_install_master_password + + module_var_sap_swpm_template_selected = "sap_solman_72_sr2_saphana_onehost" + + module_var_sap_software_download_directory = var.sap_software_download_directory + +} diff --git a/sap_solman_saphana_single_node_install/ibmcloud_vs/outputs.tf b/sap_solman_saphana_single_node_install/ibmcloud_vs/outputs.tf new file mode 100644 index 0000000..0759d42 --- /dev/null +++ b/sap_solman_saphana_single_node_install/ibmcloud_vs/outputs.tf @@ -0,0 +1,211 @@ + +############################################################## +# Export SSH key to file on local +############################################################## + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "bastion_rsa" { + content = module.run_account_bootstrap_module.output_bastion_private_ssh_key + filename = "${path.root}/ssh/bastion_rsa" + file_permission = "0400" +} + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "hosts_rsa" { + content = module.run_account_bootstrap_module.output_host_private_ssh_key + filename = "${path.root}/ssh/hosts_rsa" + file_permission = "0400" +} + + +output "ssh_sap_connection_details" { + value = local.is_wsl ? "IGNORE" : <>> Chosen option $REPLY: $opt" + select opt_ip in "$${target_host_array[@]}"; do + if [ $opt_ip = "Quit" ]; then break 2; fi + target_ip=$opt_ip + echo "---- Selected option $REPLY, tunneling into $target_ip ----" + break + done + echo "" + echo "#### HTTP/S JAVA endpoints: ####" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N \ + $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file \ + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -L localhost:5$${sap_nwas_java_ci_instance_no}00:$target_ip:5$${sap_nwas_java_ci_instance_no}01 \ + -L localhost:5$${sap_nwas_java_ci_instance_no}20:$target_ip:5$${sap_nwas_java_ci_instance_no}20 \ + -L localhost:5$${sap_nwas_java_ci_instance_no}13:$target_ip:5$${sap_nwas_java_ci_instance_no}14 + break + ;; + "OS root access, via SSH stdin/stdout forwarding proxy") + echo ">>> Chosen option $REPLY: $opt" + select opt_ssh in "$${target_host_array[@]}"; do + if [ $opt_ssh = "Quit" ]; then break 2; fi + target_ip=$opt_ssh + echo "---- Selected option $REPLY, logging into $target_ip ----" + break + done + + if [ -n "$target_ip" ]; then + ssh -i $target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + fi + break + ;; + "Quit") + break + ;; + *) echo "Invalid option $REPLY" ;; + esac + done +} + +# Then call shell function and select which target +sshjump + +EOF +} + + +# If detected Windows WSL2, then find the installed name using external resource to return a JSON string +data "external" "wsl_distro_name" { + count = local.is_wsl ? 1 : 0 + program = ["bash", "-c", "echo \"{\\\"stdout\\\":\\\"$(echo $WSL_DISTRO_NAME)\\\"}\""] +} + +output "ssh_sap_connection_details_windows" { + value = local.not_wsl ? "IGNORE" : <>> Chosen option $(PSItem)" + echo "" + echo "#### HTTP/S JAVA endpoints: ####" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N ` + $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -L localhost:5$${sap_nwas_java_ci_instance_no}00:$${target_ip}:5$${sap_nwas_java_ci_instance_no}01 ` + -L localhost:5$${sap_nwas_java_ci_instance_no}20:$${target_ip}:5$${sap_nwas_java_ci_instance_no}20 ` + -L localhost:5$${sap_nwas_java_ci_instance_no}13:$${target_ip}:5$${sap_nwas_java_ci_instance_no}14 + } + } + 2 { + foreach ($target_host in $target_host_array) { + $i=$target_host_array.IndexOf($target_host) + echo "$i) $target_host" + } + $target_host_selection = Read-Host "Please make a selection" + if ($target_host_array[$target_host_selection] -eq "Quit" ){ + break + }else { + $target_ip = $target_host_array[$target_host_selection] + #echo ">>> Chosen option $(PSItem)" + ssh -i $temp_target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + } + } + 3 { + break + } + } +} + +EOF + +} diff --git a/sap_solman_saphana_single_node_install/ibmcloud_vs/outputs_debug.tf b/sap_solman_saphana_single_node_install/ibmcloud_vs/outputs_debug.tf new file mode 100644 index 0000000..c21429d --- /dev/null +++ b/sap_solman_saphana_single_node_install/ibmcloud_vs/outputs_debug.tf @@ -0,0 +1,92 @@ + +############################################################## +# DEBUG variable map +############################################################## + +# Show all Storage Test Template names defined +#output "DEBUG_show_storage_test_template_names_all" { +# value = [ +# for key, value in var.storage_test_templates_map : key +# ] +#} + +# Show each Storage Test Template object, and all the variables set therein +#output "DEBUG_show_storage_test_template_all_variables" { +# value = [ +# for key, value in var.storage_test_templates_map : value +# ] +#} + +# Show value for specific variable within each Storage Test Template object +#output "DEBUG_show_template_value_single_all_items" { +# value = [ +# for key, value in var.storage_test_templates_map : value.*.disk_volume_count_hana_data +# ] +#} + +# Show value for specific variable within each Storage Test Template, and de-duplicate e.g. unique Virtual Server Profiles used in the Storage Test Templates +#output "DEBUG_show_storage_test_template_profiles_condense" { +# value = toset([ +# for key, value in var.storage_test_templates_map : value.*.virtual_server_profile +# ]) +#} + + +# Show value for specific output from module output in one string +#output "DEBUG_show_host_storage_test_module_output_private_ip_one_string" { +# value = join(" ", flatten([for key, value in module.run_host_storage_test_template_provision_module: value.*.output_host_private_ip])) +#} + + + +############################################################## +# DEBUG Bastion - Display key values, shown after successful execution +############################################################## + +#output "bastion_display_private_key" { +# value = "\n${tls_private_key.bastion_ssh.private_key_pem}" +# sensitive = true +#} + +#output "bastion_display_public_key" { +# value = "public_key_openssh is:\n ${tls_private_key.bastion_ssh.public_key_openssh}" +#} + +############################################################## +# DEBUG Bastion - Display key values, shown before execution but with poor output +############################################################## + +#resource "null_resource" "bastion_show_keys" { +# provisioner "local-exec" { +# command = "echo '${tls_private_key.bastion_ssh.private_key_pem}'" +# } +# provisioner "local-exec" { +# command = "echo '${tls_private_key.bastion_ssh.public_key_openssh}'" +# } +#} + +############################################################## +# DEBUG Intel VS target - Display key values, shown after successful execution +############################################################## + +#output "virtual_server_display_private_key" { +# value = "\n${tls_private_key.virtual_server_ssh.private_key_pem}" +# sensitive = true +#} + +#output "virtual_server_display_public_key" { +# value = "public_key_openssh:\n ${tls_private_key.virtual_server_ssh.public_key_openssh}" +#} + +############################################################## +# DEBUG Intel VS target - Display key values, shown before execution but with poor output +############################################################## + +#resource "null_resource" "host_show_keys" { +# provisioner "local-exec" { +# command = "echo '${tls_private_key.virtual_server_ssh.private_key_pem}'" +# } +# provisioner "local-exec" { +# command = "echo '${tls_private_key.virtual_server_ssh.public_key_openssh}'" +# } +#} \ No newline at end of file diff --git a/sap_solman_saphana_single_node_install/ibmcloud_vs/variable_locals.tf b/sap_solman_saphana_single_node_install/ibmcloud_vs/variable_locals.tf new file mode 100644 index 0000000..7c05148 --- /dev/null +++ b/sap_solman_saphana_single_node_install/ibmcloud_vs/variable_locals.tf @@ -0,0 +1,28 @@ +locals { + + resource_group_create_boolean = var.ibmcloud_resource_group == "new" ? true : false + + ibmcloud_vpc_subnet_create_boolean = var.ibmcloud_vpc_subnet_name == "new" ? true : false + + ibmcloud_vpc_subnet_name_entry_is_ip = ( + can( + regex("^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)([/][0-3][0-2]?|[/][1-2][0-9]|[/][0-9])$", + var.ibmcloud_vpc_subnet_name + ) + ) ? true : false) + + ibmcloud_region = replace(var.ibmcloud_vpc_availability_zone, "/-[^-]*$/", "") + + # Directories start with "C:..." on Windows; All other OSs use "/" for root. + detect_windows = substr(pathexpand("~"), 0, 1) == "/" ? false : true + detect_shell = substr(pathexpand("~"), 0, 1) == "/" ? true : false + + # Used for displaying Shell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + not_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? false : true : true + + # Used for displaying Windows PowerShell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + is_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? true : false : false + +} diff --git a/sap_solman_saphana_single_node_install/ibmcloud_vs/variable_map_hosts.tf b/sap_solman_saphana_single_node_install/ibmcloud_vs/variable_map_hosts.tf new file mode 100644 index 0000000..76e8ae5 --- /dev/null +++ b/sap_solman_saphana_single_node_install/ibmcloud_vs/variable_map_hosts.tf @@ -0,0 +1,78 @@ + +variable "map_host_specifications" { + + description = "Map of host specficiations for SAP Solution Manager with SAP HANA install" + + type = map(any) + + default = { + + small_256gb = { + + solman1 = { + virtual_server_profile = "mx2-32x256" + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 3 + disk_volume_type_hana_data = "10iops-tier" + disk_volume_capacity_hana_data = 128 + #disk_volume_iops_hana_data = + lvm_enable_hana_data = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_hana_data = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_hana_data = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_hana_data = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_hana_data = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_data = "xfs" + #physical_partition_filesystem_block_size_hana_data = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_hana_log = 3 + disk_volume_type_hana_log = "10iops-tier" + disk_volume_capacity_hana_log = 48 + #disk_volume_iops_hana_log = + lvm_enable_hana_log = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_hana_log = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_hana_log = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_hana_log = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_hana_log = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_log = "xfs" + #physical_partition_filesystem_block_size_hana_log = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_hana_shared = 1 + disk_volume_type_hana_shared = "10iops-tier" // Does NOT use Burst IOPS storage. Approx same cost as 1TB at lower IOPS Tiers, use lower capacity and increase to 10IOPS/GB to ensure quicker DB Backup Restore from /hana/shared//HDB/backup/data/DB_ + disk_volume_capacity_hana_shared = 320 + #disk_volume_iops_hana_shared = + lvm_enable_hana_shared = false // if false, then disk volume count should be 1 + #lvm_pv_data_alignment_hana_shared = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + #lvm_vg_data_alignment_hana_shared = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + #lvm_vg_physical_extent_size_hana_shared = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + #lvm_lv_stripe_size_hana_shared = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_shared = "xfs" + physical_partition_filesystem_block_size_hana_shared = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 0 // max of 1 + disk_volume_type_usr_sap = "general-purpose" + disk_volume_capacity_usr_sap = 64 + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 0 // max of 1 + disk_volume_type_sapmnt = "general-purpose" + disk_volume_capacity_sapmnt = 50 + filesystem_sapmnt = "xfs" + + disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 0 // max of 1 + #disk_volume_type_swap = "5iops-tier" + #disk_volume_capacity_swap = 10 + #filesystem_swap = "xfs" + + disk_volume_type_software = "5iops-tier" + disk_volume_capacity_software = 100 + } + + } + + } +} diff --git a/sap_solman_saphana_single_node_install/ibmcloud_vs/variable_map_os.tf b/sap_solman_saphana_single_node_install/ibmcloud_vs/variable_map_os.tf new file mode 100644 index 0000000..16cfc85 --- /dev/null +++ b/sap_solman_saphana_single_node_install/ibmcloud_vs/variable_map_os.tf @@ -0,0 +1,42 @@ + +variable "map_os_image_regex" { + + description = "Map of operating systems OS Image regex, to identify latest OS Image for the OS major.minor version" + + type = map(any) + + default = { + + rhel-7-6-sap-ha = ".*redhat.*7-6.*amd64.*hana.*" + + rhel-8-1-sap-ha = ".*redhat.*8-1.*amd64.*hana.*" + + rhel-8-2-sap-ha = ".*redhat.*8-2.*amd64.*hana.*" + + rhel-8-4-sap-ha = ".*redhat.*8-4.*amd64.*hana.*" + + rhel-7-6-sap-applications = ".*redhat.*7-6.*amd64.*applications.*" + + rhel-8-1-sap-applications = ".*redhat.*8-1.*amd64.*applications.*" + + rhel-8-2-sap-applications = ".*redhat.*8-2.*amd64.*applications.*" + + rhel-8-4-sap-applications = ".*redhat.*8-4.*amd64.*applications.*" + + rhel-8-4 = ".*redhat.*8-4.*minimal.*amd64.*" + + sles-12-4-sap-ha = ".*sles.*12-4.*amd64.*hana.*" + + sles-15-1-sap-ha = ".*sles.*15-1.*amd64.*hana.*" + + sles-15-2-sap-ha = ".*sles.*15-2.*amd64.*hana.*" + + sles-12-4-sap-applications = ".*sles.*12-4.*amd64.*applications.*" + + sles-15-1-sap-applications = ".*sles.*15-1.*amd64.*applications.*" + + sles-15-2-sap-applications = ".*sles.*15-2.*amd64.*applications.*" + + } + +} diff --git a/sap_solman_saphana_single_node_install/ibmcloud_vs/variables.tf b/sap_solman_saphana_single_node_install/ibmcloud_vs/variables.tf new file mode 100644 index 0000000..922e24e --- /dev/null +++ b/sap_solman_saphana_single_node_install/ibmcloud_vs/variables.tf @@ -0,0 +1,146 @@ + +variable "ibmcloud_api_key" { + description = "Enter your IBM Cloud API Key" +} + +variable "resource_tags" { + type = list(string) + description = "Tags applied to each resource created" +} + +variable "resource_prefix" { + description = "Prefix to resource names" +} + +variable "ibmcloud_resource_group" { + description = "Enter existing/target Resource Group name, or enter 'new' to create a Resource Group using the defined prefix for all resources" +} + +variable "ibmcloud_vpc_availability_zone" { + description = "Target IBM Cloud Availability Zone (e.g. us-south-1). The IBM Cloud Region will be calculated from this value" + + validation { + error_message = "Please enter an IBM Cloud Availability Zone (e.g. us-south-1)." + condition = can(regex("^([a-zA-Z0-9]*-[a-zA-Z0-9]*){2}$", var.ibmcloud_vpc_availability_zone)) + } + +} + +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} + +variable "ibmcloud_vpc_subnet_name" { + description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range. If using an existing VPC Subnet, it must be attached to a Public Gateway (i.e. SNAT)" +} + +variable "dns_root_domain" { + description = "Root Domain for Private DNS used with the Virtual Server" +} + +variable "bastion_os_image" { + description = "Bastion OS Image. This variable uses the locals mapping with regex of OS Images, and will alter bastion provisioning." +} + +variable "bastion_user" { + description = "OS User to create on Bastion host to avoid pass-through root user (e.g. bastionuser)" +} + +variable "bastion_ssh_port" { + type = number + description = "Bastion host SSH Port from IANA Dynamic Ports range (49152 to 65535)" + + validation { + condition = var.bastion_ssh_port > 49152 && var.bastion_ssh_port < 65535 + error_message = "Bastion host SSH Port must fall within IANA Dynamic Ports range (49152 to 65535)." + } +} + +variable "host_specification_plan" { + description = "Host specification plans are small_256gb. This variable uses the locals mapping with a nested list of host specifications, and will alter host provisioning." +} + +variable "host_os_image" { + description = "Host OS Image. This variable uses the locals mapping with regex of OS Images, and will alter host provisioning." +} + +variable "disk_volume_capacity_software" { + type = number + description = "Disk volume capacity for downloads of SAP Software" +} + +variable "disk_volume_type_software" { + description = "Disk volume type for downloads of SAP Software" +} + +variable "sap_software_download_directory" { + description = "Mount point for downloads of SAP Software" + + validation { + error_message = "Directory must start with forward slash." + condition = can(regex("^/", var.sap_software_download_directory)) + } + +} + + + +variable "sap_id_user" { + description = "Ansible - Please enter your SAP ID user (e.g. S-User)" +} + +variable "sap_id_user_password" { + description = "Ansible - Please enter your SAP ID password" +} + +variable "sap_hana_install_master_password" { + description = "Ansible - SAP HANA install: set common initial password (e.g. NewPass$321)" +} + +variable "sap_hana_install_sid" { + description = "Ansible - SAP HANA install: System ID (e.g. H01)" +} + +variable "sap_hana_install_instance_number" { + description = "Ansible - SAP HANA install: Instance Number (e.g. 90)" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_hana_install_instance_number)) + } + +} + +variable "sap_nwas_install_sid" { + description = "Ansible - SAP NetWeaver AS (ABAP) install: System ID (e.g. N01)" +} + +variable "sap_nwas_java_ci_instance_no" { + description = "Ansible - SAP NetWeaver AS (JAVA) - JAVA Central Instance (CI) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_java_ci_instance_no)) + } + +} + +variable "sap_nwas_abap_ascs_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - ABAP Central Services (ASCS) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_ascs_instance_no)) + } + +} + +variable "sap_nwas_abap_pas_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - Primary Application Server instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_pas_instance_no)) + } + +} diff --git a/sap_solman_saphana_single_node_install/ibmcloud_vs/variables_generic_for_cli.tfvars b/sap_solman_saphana_single_node_install/ibmcloud_vs/variables_generic_for_cli.tfvars new file mode 100644 index 0000000..80c8f09 --- /dev/null +++ b/sap_solman_saphana_single_node_install/ibmcloud_vs/variables_generic_for_cli.tfvars @@ -0,0 +1,36 @@ +resource_tags = ["sap", "saps4hana"] + +resource_prefix = "sap" + +dns_root_domain = "poc.cloud" + +bastion_os_image = "rhel-8-4" + +bastion_user = "bastionuser" + +bastion_ssh_port = 50222 + +host_specification_plan = "small_256gb" + +host_os_image = "rhel-8-4-sap-ha" + +disk_volume_capacity_software = 304 + +disk_volume_type_software = "10iops-tier" + +sap_nwas_abap_ascs_instance_no = "01" + +sap_nwas_abap_pas_instance_no = "00" + +sap_software_download_directory = "/software" + +sap_hana_install_master_password = "NewPass$321" + +sap_hana_install_sid = "H01" + +sap_hana_install_instance_number = "90" + +sap_nwas_install_sid = "N01" + +sap_nwas_java_ci_instance_no = "20" + diff --git a/sap_solman_saphana_single_node_install/ibmcloud_vs/versions.tf b/sap_solman_saphana_single_node_install/ibmcloud_vs/versions.tf new file mode 100644 index 0000000..aea3f80 --- /dev/null +++ b/sap_solman_saphana_single_node_install/ibmcloud_vs/versions.tf @@ -0,0 +1,32 @@ +# Terraform declaration + +terraform { + required_version = ">= 1.0" + required_providers { + ibm = { + #source = "localdomain/provider/ibm" // Local, on macOS path to place files would be $HOME/.terraform.d/plugins/localdomain/provider/ibm/1.xx.xx/darwin_amd6 + source = "IBM-Cloud/ibm" // Terraform Registry + version = ">=1.45.0" + } + } +} + + +# Terraform Provider declaration + +provider "ibm" { + + # Define Provider inputs manually + # ibmcloud_api_key = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + + # Define Provider inputs from given Terraform Variables + ibmcloud_api_key = var.ibmcloud_api_key + + # If using IBM Cloud Automation Manager, the Provider declaration values are populated automatically + # from the Cloud Connection credentials (by using Environment Variables) + + # If using IBM Cloud Schematics, the Provider declaration values are populated automatically + + region = local.ibmcloud_region + +} diff --git a/sap_solman_saphana_single_node_install/msazure_vm/main.tf b/sap_solman_saphana_single_node_install/msazure_vm/main.tf new file mode 100644 index 0000000..d168fdc --- /dev/null +++ b/sap_solman_saphana_single_node_install/msazure_vm/main.tf @@ -0,0 +1,339 @@ + +module "run_ansible_dry_run" { + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=dev" + + module_var_dry_run_test = "x86_64" // x86_64 or ppc64le + + # Terraform Module Variables which are mandatory, all with an empty string + module_var_bastion_boolean = false + module_var_bastion_user = "" + module_var_bastion_ssh_port = 0 + module_var_bastion_private_ssh_key = "" + module_var_bastion_floating_ip = "" + module_var_host_private_ssh_key = "" + module_var_host_private_ip = "" + module_var_hostname = "software_media_dry_run" + module_var_dns_root_domain_name = "" + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + module_var_sap_swpm_sid = "" + module_var_sap_swpm_db_schema_abap = "" + module_var_sap_swpm_db_schema_abap_password = "" + module_var_sap_swpm_ddic_000_password = "" + module_var_sap_swpm_template_selected = "sap_solman_72_sr2_saphana_onehost" +} + + +module "run_account_init_module" { + + depends_on = [ + module.run_ansible_dry_run + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/account_init?ref=main" + + module_var_az_resource_group_name = local.resource_group_create_boolean ? 0 : var.az_resource_group_name + module_var_az_resource_group_create_boolean = local.resource_group_create_boolean + + module_var_resource_prefix = var.resource_prefix + + module_var_az_location_region = var.az_location_region + module_var_az_location_availability_zone_no = var.az_location_availability_zone_no + + module_var_az_vnet_name = local.az_vnet_name_create_boolean ? 0 : var.az_vnet_name + module_var_az_vnet_name_create_boolean = local.az_vnet_name_create_boolean + + module_var_az_vnet_subnet_name = local.az_vnet_subnet_name_create_boolean ? 0 : var.az_vnet_subnet_name + module_var_az_vnet_subnet_name_create_boolean = local.az_vnet_subnet_name_create_boolean + +} + + +module "run_account_bootstrap_module" { + + depends_on = [ + module.run_account_init_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/account_bootstrap?ref=main" + + module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name + module_var_resource_prefix = var.resource_prefix + + module_var_az_location_region = var.az_location_region + module_var_az_location_availability_zone_no = var.az_location_availability_zone_no + + module_var_az_vnet_name = module.run_account_init_module.output_vnet_name + module_var_az_vnet_subnet_name = module.run_account_init_module.output_vnet_subnet_name + + module_var_dns_root_domain_name = var.dns_root_domain +} + + +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.az_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/account_iam?ref=main" +# +# module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name +# module_var_resource_prefix = var.resource_prefix +# +#} + + +module "run_bastion_inject_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/bastion_inject?ref=main" + + module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name + module_var_resource_prefix = var.resource_prefix + + module_var_az_location_region = var.az_location_region + module_var_az_location_availability_zone_no = var.az_location_availability_zone_no + + module_var_az_vnet_name = module.run_account_init_module.output_vnet_name + module_var_az_vnet_subnet_name = module.run_account_init_module.output_vnet_subnet_name + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_ssh_key_id = module.run_account_bootstrap_module.output_bastion_ssh_key_id + module_var_bastion_public_ssh_key = module.run_account_bootstrap_module.output_bastion_public_ssh_key + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_os_image = var.map_os_image_regex[var.bastion_os_image] + +} + + +module "run_host_network_access_sap_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/host_network_access_sap?ref=main" + + module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name + + module_var_az_vnet_name = module.run_account_init_module.output_vnet_name + module_var_az_vnet_subnet_name = module.run_account_init_module.output_vnet_subnet_name + + module_var_host_security_group_name = module.run_account_bootstrap_module.output_host_security_group_name + + module_var_sap_nwas_abap_pas_instance_no = var.sap_nwas_abap_pas_instance_no + module_var_sap_hana_instance_no = var.sap_hana_install_instance_number + +} + + +module "run_host_network_access_sap_public_via_proxy_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/host_network_access_sap_public_via_proxy?ref=main" + + module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name + + module_var_az_vnet_name = module.run_account_init_module.output_vnet_name + module_var_az_vnet_subnet_name = module.run_account_init_module.output_vnet_subnet_name + module_var_az_vnet_bastion_subnet_name = module.run_bastion_inject_module.output_vnet_bastion_subnet_name + + module_var_host_security_group_name = module.run_account_bootstrap_module.output_host_security_group_name + module_var_bastion_security_group_name = module.run_bastion_inject_module.output_bastion_security_group_name + module_var_bastion_connection_security_group_name = module.run_bastion_inject_module.output_bastion_connection_security_group_name + + module_var_sap_nwas_abap_pas_instance_no = var.sap_nwas_abap_pas_instance_no + module_var_sap_hana_instance_no = var.sap_hana_install_instance_number + +} + + +module "run_host_provision_module" { + + depends_on = [ + module.run_account_init_module, + module.run_account_bootstrap_module, + module.run_bastion_inject_module + ] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/host_provision?ref=main" + + + module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name + module_var_resource_prefix = var.resource_prefix + + module_var_az_location_region = var.az_location_region + module_var_az_location_availability_zone_no = var.az_location_availability_zone_no + + module_var_az_vnet_name = module.run_account_init_module.output_vnet_name + module_var_az_vnet_subnet_name = module.run_account_init_module.output_vnet_subnet_name + + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + module_var_bastion_ip = module.run_bastion_inject_module.output_bastion_ip + module_var_bastion_connection_sg_id = module.run_bastion_inject_module.output_bastion_connection_security_group_id + + module_var_host_ssh_key_id = module.run_account_bootstrap_module.output_host_ssh_key_id + module_var_host_ssh_public_key = module.run_account_bootstrap_module.output_host_public_ssh_key + module_var_host_ssh_private_key = module.run_account_bootstrap_module.output_host_private_ssh_key + module_var_host_sg_id = module.run_account_bootstrap_module.output_host_security_group_id + + module_var_host_os_image = var.map_os_image_regex[var.host_os_image] + + module_var_dns_zone_name = module.run_account_bootstrap_module.output_dns_zone_name + module_var_dns_root_domain_name = var.dns_root_domain + + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable with nested objects + + for_each = toset([ + for key, value in var.map_host_specifications[var.host_specification_plan] : key + ]) + + module_var_host_name = each.key + + module_var_az_vm_instance = var.map_host_specifications[var.host_specification_plan][each.key].vm_instance + + module_var_disk_volume_count_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data + module_var_disk_volume_type_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data + module_var_disk_volume_capacity_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_data + module_var_disk_volume_iops_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_data == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_data : null + module_var_lvm_enable_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data + module_var_lvm_pv_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_data : 0 + module_var_lvm_vg_data_alignment_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_data : 0 + module_var_lvm_vg_physical_extent_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_data : 0 + module_var_lvm_lv_stripe_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_data : 0 + module_var_filesystem_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_data + module_var_physical_partition_filesystem_block_size_hana_data = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_data == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_data ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_data + + module_var_disk_volume_count_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log + module_var_disk_volume_type_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log + module_var_disk_volume_capacity_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_log + module_var_disk_volume_iops_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_log == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_log : null + module_var_lvm_enable_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log + module_var_lvm_pv_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_log : 0 + module_var_lvm_vg_data_alignment_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_log : 0 + module_var_lvm_vg_physical_extent_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_log : 0 + module_var_lvm_lv_stripe_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_log : 0 + module_var_filesystem_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_log + module_var_physical_partition_filesystem_block_size_hana_log = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_log == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_log ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_log + + module_var_disk_volume_count_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared + module_var_disk_volume_type_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared + module_var_disk_volume_capacity_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_hana_shared + module_var_disk_volume_iops_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_hana_shared == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_hana_shared : null + module_var_lvm_enable_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared + module_var_lvm_pv_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_hana_shared : 0 + module_var_lvm_vg_data_alignment_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_hana_shared : 0 + module_var_lvm_vg_physical_extent_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_hana_shared : 0 + module_var_lvm_lv_stripe_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_hana_shared : 0 + module_var_filesystem_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_hana_shared + module_var_physical_partition_filesystem_block_size_hana_shared = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_hana_shared == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_hana_shared ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_hana_shared + + module_var_disk_volume_count_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb + module_var_disk_volume_type_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb + module_var_disk_volume_capacity_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_anydb + module_var_disk_volume_iops_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_anydb == "custom" ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_iops_anydb : null + module_var_lvm_enable_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? false : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb + module_var_lvm_pv_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_pv_data_alignment_anydb : 0 + module_var_lvm_vg_data_alignment_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_data_alignment_anydb : 0 + module_var_lvm_vg_physical_extent_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_vg_physical_extent_size_anydb : 0 + module_var_lvm_lv_stripe_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? var.map_host_specifications[var.host_specification_plan][each.key].lvm_lv_stripe_size_anydb : 0 + module_var_filesystem_mount_path_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_mount_path_anydb + module_var_filesystem_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].filesystem_anydb + module_var_physical_partition_filesystem_block_size_anydb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_anydb == 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].lvm_enable_anydb ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].physical_partition_filesystem_block_size_anydb + + module_var_disk_volume_count_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_usr_sap + module_var_disk_volume_type_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_usr_sap + module_var_disk_volume_capacity_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_usr_sap + module_var_filesystem_usr_sap = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_usr_sap + + module_var_disk_volume_count_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_sapmnt + module_var_disk_volume_type_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_sapmnt + module_var_disk_volume_capacity_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_sapmnt + module_var_filesystem_sapmnt = var.map_host_specifications[var.host_specification_plan][each.key].filesystem_sapmnt + module_var_nfs_boolean_sapmnt = false // always false, single node installation + module_var_nfs_fqdn_sapmnt = "" // always false, single node installation + + module_var_disk_swapfile_size_gb = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? 0 : var.map_host_specifications[var.host_specification_plan][each.key].disk_swapfile_size_gb + module_var_disk_volume_count_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap + module_var_disk_volume_type_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_type_swap : 0 + module_var_disk_volume_capacity_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_capacity_swap : 0 + module_var_filesystem_swap = var.map_host_specifications[var.host_specification_plan][each.key].disk_volume_count_swap > 0 ? var.map_host_specifications[var.host_specification_plan][each.key].filesystem_swap : 0 + + module_var_disk_volume_capacity_software = var.disk_volume_capacity_software + module_var_sap_software_download_directory = var.sap_software_download_directory + +} + + +module "run_ansible_sap_solman_saphana_install" { + + depends_on = [module.run_host_provision_module] + + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=dev" + + + # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) + module_var_bastion_boolean = true // required as true boolean for any Cloud Service Provider (CSP) + module_var_bastion_user = var.bastion_user + module_var_bastion_ssh_port = var.bastion_ssh_port + module_var_bastion_private_ssh_key = module.run_account_bootstrap_module.output_bastion_private_ssh_key + + module_var_bastion_floating_ip = module.run_bastion_inject_module.output_bastion_ip + + module_var_host_private_ssh_key = module.run_account_bootstrap_module.output_host_private_ssh_key + + + # Set Terraform Module Variables using for_each loop on a map Terraform Variable at runtime + + for_each = module.run_host_provision_module + module_var_host_private_ip = join(", ", each.value.*.output_host_private_ip) + module_var_hostname = join(", ", each.value.*.output_host_name) + module_var_dns_root_domain_name = var.dns_root_domain + + module_var_sap_id_user = var.sap_id_user + module_var_sap_id_user_password = var.sap_id_user_password + + module_var_sap_hana_install_master_password = var.sap_hana_install_master_password + module_var_sap_hana_install_sid = var.sap_hana_install_sid + module_var_sap_hana_install_instance_number = var.sap_hana_install_instance_number + + module_var_sap_swpm_sid = var.sap_nwas_install_sid + + module_var_sap_swpm_db_schema_abap = "SAPABAP1" + module_var_sap_swpm_db_schema_abap_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_system_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_systemdb_password = var.sap_hana_install_master_password + module_var_sap_swpm_db_sidadm_password = var.sap_hana_install_master_password + module_var_sap_swpm_ddic_000_password = var.sap_hana_install_master_password + module_var_sap_swpm_ascs_instance_nr = var.sap_nwas_abap_ascs_instance_no + module_var_sap_swpm_pas_instance_nr = var.sap_nwas_abap_pas_instance_no + + module_var_sap_swpm_nwas_java_instance_nr = var.sap_nwas_java_ci_instance_no + + module_var_sap_swpm_master_password = var.sap_hana_install_master_password + + module_var_sap_swpm_template_selected = "sap_solman_72_sr2_saphana_onehost" + + module_var_sap_software_download_directory = var.sap_software_download_directory + +} diff --git a/sap_solman_saphana_single_node_install/msazure_vm/outputs.tf b/sap_solman_saphana_single_node_install/msazure_vm/outputs.tf new file mode 100644 index 0000000..f4f4d5f --- /dev/null +++ b/sap_solman_saphana_single_node_install/msazure_vm/outputs.tf @@ -0,0 +1,235 @@ + +############################################################## +# Export SSH key to file on local +############################################################## + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "bastion_rsa" { + content = module.run_account_bootstrap_module.output_bastion_private_ssh_key + filename = "${path.root}/ssh/bastion_rsa" + file_permission = "0400" +} + +# Use path object to store key files temporarily in root of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info +resource "local_file" "hosts_rsa" { + content = module.run_account_bootstrap_module.output_host_private_ssh_key + filename = "${path.root}/ssh/hosts_rsa" + file_permission = "0400" +} + + +output "ssh_sap_connection_details" { + value = local.is_wsl ? "IGNORE" : <>> Chosen option $REPLY: $opt" + select opt_ip in "$${target_host_array[@]}"; do + if [ $opt_ip = "Quit" ]; then break 2; fi + target_ip=$opt_ip + echo "---- Selected option $REPLY, tunneling into $target_ip ----" + break + done + echo "" + echo "#### For SAP HANA Studio, use Add System with host name as localhost; do not add port numbers." + echo "#### If selecting 'Connect using SSL' on Connection Properties, then on Additional Properties (final) screen deselect 'Validate the SSL certificate'" + echo "" + echo "#### For SAPGUI, use expert mode SAP Logon String as: ####" + echo "conn=/H/localhost/S/32$sap_nwas_abap_pas_instance_no&expert=true" + echo "" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N \ + $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file \ + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -L localhost:32$sap_nwas_abap_pas_instance_no:$target_ip:32$sap_nwas_abap_pas_instance_no \ + -L localhost:33$sap_nwas_abap_pas_instance_no:$target_ip:33$sap_nwas_abap_pas_instance_no \ + -L localhost:3$${sap_hana_instance_no}13:$target_ip:3$${sap_hana_instance_no}13 \ + -L localhost:3$${sap_hana_instance_no}15:$target_ip:3$${sap_hana_instance_no}15 \ + -L localhost:3$${sap_hana_instance_no}41:$target_ip:3$${sap_hana_instance_no}41 \ + -L localhost:443$sap_hana_instance_no:$target_ip:443$sap_hana_instance_no \ + -L localhost:443$sap_nwas_abap_pas_instance_no:$target_ip:443$sap_nwas_abap_pas_instance_no \ + -L localhost:5$${sap_hana_instance_no}13:$target_ip:5$${sap_hana_instance_no}13 \ + -L localhost:5$${sap_hana_instance_no}14:$target_ip:5$${sap_hana_instance_no}14 + break + ;; + "OS root access, via SSH stdin/stdout forwarding proxy") + echo ">>> Chosen option $REPLY: $opt" + select opt_ssh in "$${target_host_array[@]}"; do + if [ $opt_ssh = "Quit" ]; then break 2; fi + target_ip=$opt_ssh + echo "---- Selected option $REPLY, logging into $target_ip ----" + break + done + + if [ -n "$target_ip" ]; then + ssh -i $target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $bastion_private_key_file -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + fi + break + ;; + "Quit") + break + ;; + *) echo "Invalid option $REPLY" ;; + esac + done +} + +# Then call shell function and select which target +sshjump + +EOF +} + + +# If detected Windows WSL2, then find the installed name using external resource to return a JSON string +data "external" "wsl_distro_name" { + count = local.is_wsl ? 1 : 0 + program = ["bash", "-c", "echo \"{\\\"stdout\\\":\\\"$(echo $WSL_DISTRO_NAME)\\\"}\""] +} + +output "ssh_sap_connection_details_windows" { + value = local.not_wsl ? "IGNORE" : <>> Chosen option $(PSItem)" + echo "" + echo "#### For SAP HANA Studio, use Add System with host name as localhost; do not add port numbers." + echo "#### If selecting 'Connect using SSL' on Connection Properties, then on Additional Properties (final) screen deselect 'Validate the SSL certificate'" + echo "" + echo "#### For SAPGUI, use expert mode SAP Logon String as: ####" + echo "conn=/H/localhost/S/32$sap_nwas_abap_pas_instance_no&expert=true" + echo "" + # SSH port forward binding, using -L local_host:local_port:remote_host:remote_port (add -vv for debugging) + ssh -N ` + $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -L localhost:32$${sap_nwas_abap_pas_instance_no}:$${target_ip}:32$${sap_nwas_abap_pas_instance_no} ` + -L localhost:33$${sap_nwas_abap_pas_instance_no}:$${target_ip}:33$${sap_nwas_abap_pas_instance_no} ` + -L localhost:3$${sap_hana_instance_no}13:$${target_ip}:3$${sap_hana_instance_no}13 ` + -L localhost:3$${sap_hana_instance_no}15:$${target_ip}:3$${sap_hana_instance_no}15 ` + -L localhost:3$${sap_hana_instance_no}41:$${target_ip}:3$${sap_hana_instance_no}41 ` + -L localhost:443$${sap_hana_instance_no}:$${target_ip}:443$${sap_hana_instance_no} ` + -L localhost:443$${sap_nwas_abap_pas_instance_no}:$${target_ip}:443$${sap_nwas_abap_pas_instance_no} ` + -L localhost:5$${sap_hana_instance_no}13:$${target_ip}:5$${sap_hana_instance_no}13 ` + -L localhost:5$${sap_hana_instance_no}14:$${target_ip}:5$${sap_hana_instance_no}14 + } + } + 2 { + foreach ($target_host in $target_host_array) { + $i=$target_host_array.IndexOf($target_host) + echo "$i) $target_host" + } + $target_host_selection = Read-Host "Please make a selection" + if ($target_host_array[$target_host_selection] -eq "Quit" ){ + break + }else { + $target_ip = $target_host_array[$target_host_selection] + #echo ">>> Chosen option $(PSItem)" + ssh -i $temp_target_private_key_file root@$target_ip -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ` + -o ProxyCommand="ssh -W %h:%p $bastion_user@$bastion_host -p $bastion_port -i $temp_bastion_private_key_file ` + -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + } + } + 3 { + break + } + } +} + +EOF + +} diff --git a/sap_solman_saphana_single_node_install/msazure_vm/variable_locals.tf b/sap_solman_saphana_single_node_install/msazure_vm/variable_locals.tf new file mode 100644 index 0000000..ff321be --- /dev/null +++ b/sap_solman_saphana_single_node_install/msazure_vm/variable_locals.tf @@ -0,0 +1,21 @@ +locals { + + resource_group_create_boolean = var.az_resource_group_name == "new" ? true : false + + az_vnet_name_create_boolean = var.az_vnet_name == "new" ? true : false + + az_vnet_subnet_name_create_boolean = var.az_vnet_subnet_name == "new" ? true : false + + # Directories start with "C:..." on Windows; All other OSs use "/" for root. + detect_windows = substr(pathexpand("~"), 0, 1) == "/" ? false : true + detect_shell = substr(pathexpand("~"), 0, 1) == "/" ? true : false + + # Used for displaying Shell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + not_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? false : true : true + + # Used for displaying Windows PowerShell ssh connection output + # /proc/version contains WSL subsstring, if detected then running Windows Subsystem for Linux + is_wsl = fileexists("/proc/version") ? length(regexall("WSL", file("/proc/version"))) > 0 ? true : false : false + +} diff --git a/sap_solman_saphana_single_node_install/msazure_vm/variable_map_hosts.tf b/sap_solman_saphana_single_node_install/msazure_vm/variable_map_hosts.tf new file mode 100644 index 0000000..6531ff9 --- /dev/null +++ b/sap_solman_saphana_single_node_install/msazure_vm/variable_map_hosts.tf @@ -0,0 +1,76 @@ + +variable "map_host_specifications" { + + description = "Map of host specficiations for SAP NetWeaver AS (ABAP) with SAP HANA single node install" + + type = map(any) + + default = { + + small_256gb = { + + nw01 = { // Hostname + vm_instance = "Standard_M32ls" + + // N.B. all capacities must be different from each other, due to Shell loop searching based on capacity GB + + disk_volume_count_hana_data = 4 + disk_volume_type_hana_data = "P6" + disk_volume_capacity_hana_data = 64 + #disk_volume_iops_hana_data = + lvm_enable_hana_data = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_hana_data = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_hana_data = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_hana_data = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_hana_data = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_data = "xfs" + #physical_partition_filesystem_block_size_hana_data = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_hana_log = 3 + disk_volume_type_hana_log = "P10" + disk_volume_capacity_hana_log = 128 + #disk_volume_iops_hana_log = + lvm_enable_hana_log = true // if false, then disk volume count should be 1 + lvm_pv_data_alignment_hana_log = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + lvm_vg_data_alignment_hana_log = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + lvm_vg_physical_extent_size_hana_log = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + lvm_lv_stripe_size_hana_log = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_log = "xfs" + #physical_partition_filesystem_block_size_hana_log = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_hana_shared = 1 + disk_volume_type_hana_shared = "P15" // Uses Burst IOPS for storage. May increase costs if there is consistent heavy usage (e.g. longer than 30mins burst, such as 200GB+ DB Backup Restore) + disk_volume_capacity_hana_shared = 256 + #disk_volume_iops_hana_shared = + lvm_enable_hana_shared = false // if false, then disk volume count should be 1 + #lvm_pv_data_alignment_hana_shared = "1M" //default 1MiB offset from disk start before first LVM PV Physical Extent. + #lvm_vg_data_alignment_hana_shared = "1M" //default 1MiB offset from disk start before first LVM VG Physical Extent. + #lvm_vg_physical_extent_size_hana_shared = "4M" //default 4MiB, difficult to change once set. Akin to Physical Block Size. + #lvm_lv_stripe_size_hana_shared = "64K" //default 64KiB. Akin to Virtualized Block Size. + filesystem_hana_shared = "xfs" + physical_partition_filesystem_block_size_hana_shared = "4k" // only if LVM is set to false; if XFS then only 4k value allowed otherwise will be overridden (see README about XFS and Page Size) + + disk_volume_count_anydb = 0 + + disk_volume_count_usr_sap = 1 // max of 1 + disk_volume_type_usr_sap = "E20" + disk_volume_capacity_usr_sap = 512 // bad sizing, but use this so each drive size is unique + filesystem_usr_sap = "xfs" + + disk_volume_count_sapmnt = 1 // max of 1 + disk_volume_type_sapmnt = "E4" + disk_volume_capacity_sapmnt = 32 // bad sizing, but use this so each drive size is unique + filesystem_sapmnt = "xfs" + + #disk_swapfile_size_gb = 2 // not required if disk volume set + disk_volume_count_swap = 1 // max of 1 + disk_volume_type_swap = "E3" + disk_volume_capacity_swap = 16 // bad sizing, but use this so each drive size is unique + filesystem_swap = "xfs" + } + + } + + } + +} diff --git a/sap_solman_saphana_single_node_install/msazure_vm/variable_map_os.tf b/sap_solman_saphana_single_node_install/msazure_vm/variable_map_os.tf new file mode 100644 index 0000000..010c0a6 --- /dev/null +++ b/sap_solman_saphana_single_node_install/msazure_vm/variable_map_os.tf @@ -0,0 +1,59 @@ + +# Find latest OS Image for RHEL +# az account list-locations | jq .[].displayName +# az vm image list --all --publisher redhat --offer RHEL-SAP-APPS --sku 8 --query "[?starts_with(version,'8.4')]" | jq .[].version --raw-output | sort -r | head -1 +# az vm image list --all --publisher redhat --offer RHEL-SAP-HA --sku 8 --query "[?starts_with(version,'8.4')]" | jq .[].version --raw-output | sort -r | head -1 + +variable "map_os_image_regex" { + + description = "Map of operating systems OS Image regex, to identify latest OS Image for the OS major.minor version" + + type = map(any) + + default = { + + rhel-8-4 = { + publisher = "RedHat" + offer = "RHEL" + sku = "84-gen2" + }, + + rhel-8-1-sap-ha = { + publisher = "RedHat" + offer = "RHEL-SAP-HA" + sku = "81sapha-gen2" + }, + + rhel-8-2-sap-ha = { + publisher = "RedHat" + offer = "RHEL-SAP-HA" + sku = "82sapha-gen2" + }, + + rhel-8-4-sap-ha = { + publisher = "RedHat" + offer = "RHEL-SAP-HA" + sku = "84sapha-gen2" + }, + + rhel-8-1-sap-applications = { + publisher = "RedHat" + offer = "RHEL-SAP-APPS" + sku = "81sapapps-gen2" + }, + + rhel-8-2-sap-applications = { + publisher = "RedHat" + offer = "RHEL-SAP-APPS" + sku = "82sapapps-gen2" + }, + + rhel-8-4-sap-applications = { + publisher = "RedHat" + offer = "RHEL-SAP-APPS" + sku = "84sapapps-gen2" + } + + } + +} diff --git a/sap_solman_saphana_single_node_install/msazure_vm/variables.tf b/sap_solman_saphana_single_node_install/msazure_vm/variables.tf new file mode 100644 index 0000000..d1fa96f --- /dev/null +++ b/sap_solman_saphana_single_node_install/msazure_vm/variables.tf @@ -0,0 +1,146 @@ + +variable "az_tenant_id" { + description = "Azure Tenant ID" +} + +variable "az_subscription_id" { + description = "Azure Subscription ID" +} + +variable "az_app_client_id" { + description = "Azure AD App Client ID" +} + +variable "az_app_client_secret" { + description = "Azure AD App Client Secret" +} + +variable "resource_prefix" { + description = "Enter prefix to resource names" +} + +variable "az_resource_group_name" { + description = "Enter existing/target Azure Resource Group name, or enter 'new' to create a Resource Group using the defined prefix for all resources" +} + +variable "az_location_region" { + description = "Target Azure Region aka. Azure Location Display Name (e.g. 'West Europe')" +} + +variable "az_location_availability_zone_no" { + description = "Target Azure Availability Zone (e.g. 1)" +} + +variable "az_vnet_name" { + description = "Enter existing/target Azure VNet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range (cannot be 'new' if using existing VNet Subnet)" +} + +variable "az_vnet_subnet_name" { + description = "Enter existing/target Azure VNet Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range (if using existing VNet, ensure default subnet range matches to VNet address space and does not conflict with existing Subnet)" +} + +variable "dns_root_domain" { + description = "Root Domain for Private DNS used with the Virtual Machine" +} + +variable "bastion_os_image" { + description = "Bastion OS Image. This variable uses the locals mapping with regex of OS Images, and will alter bastion provisioning." +} + +variable "bastion_user" { + description = "OS User to create on Bastion host to avoid pass-through root user (e.g. bastionuser)" +} + +variable "bastion_ssh_port" { + type = number + description = "Bastion host SSH Port from IANA Dynamic Ports range (49152 to 65535)" + + validation { + condition = var.bastion_ssh_port > 49152 && var.bastion_ssh_port < 65535 + error_message = "Bastion host SSH Port must fall within IANA Dynamic Ports range (49152 to 65535)." + } +} + +variable "host_specification_plan" { + description = "Host specification plans are small_256gb. This variable uses the locals mapping with a nested list of host specifications, and will alter host provisioning." +} + +variable "host_os_image" { + description = "Host OS Image. This variable uses the locals mapping with regex of OS Images, and will alter host provisioning." +} + +variable "disk_volume_capacity_software" { + type = number + description = "Disk volume capacity for downloads of SAP Software" +} + +variable "sap_software_download_directory" { + description = "Mount point for downloads of SAP Software" + + validation { + error_message = "Directory must start with forward slash." + condition = can(regex("^/", var.sap_software_download_directory)) + } + +} + + +variable "sap_id_user" { + description = "Ansible - Please enter your SAP ID user (e.g. S-User)" +} + +variable "sap_id_user_password" { + description = "Ansible - Please enter your SAP ID password" +} + +variable "sap_hana_install_master_password" { + description = "Ansible - SAP HANA install: set common initial password (e.g. NewPass$321)" +} + +variable "sap_hana_install_sid" { + description = "Ansible - SAP HANA install: System ID (e.g. H01)" +} + +variable "sap_hana_install_instance_number" { + description = "Ansible - SAP HANA install: Instance Number (e.g. 90)" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_hana_install_instance_number)) + } + +} + +variable "sap_nwas_install_sid" { + description = "Ansible - SAP NetWeaver AS (ABAP) install: System ID (e.g. N01)" +} + +variable "sap_nwas_java_ci_instance_no" { + description = "Ansible - SAP NetWeaver AS (JAVA) - JAVA Central Instance (CI) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_java_ci_instance_no)) + } + +} + +variable "sap_nwas_abap_ascs_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - ABAP Central Services (ASCS) instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_ascs_instance_no)) + } + +} + +variable "sap_nwas_abap_pas_instance_no" { + description = "Ansible - SAP NetWeaver AS (ABAP) - Primary Application Server instance number" + + validation { + error_message = "Cannot use Instance Number 43 (HA port number) or 89 (Windows Remote Desktop Services)." + condition = !can(regex("(43|89)", var.sap_nwas_abap_pas_instance_no)) + } + +} diff --git a/sap_solman_saphana_single_node_install/msazure_vm/variables_generic_for_cli.tfvars b/sap_solman_saphana_single_node_install/msazure_vm/variables_generic_for_cli.tfvars new file mode 100644 index 0000000..5629fb9 --- /dev/null +++ b/sap_solman_saphana_single_node_install/msazure_vm/variables_generic_for_cli.tfvars @@ -0,0 +1,29 @@ +resource_prefix = "sap" + +dns_root_domain = "poc.cloud" + +bastion_os_image = "rhel-8-4" + +bastion_user = "bastionuser" + +bastion_ssh_port = 50222 + +host_specification_plan = "small_256gb" + +host_os_image = "rhel-8-4-sap-ha" + +disk_volume_capacity_software = 304 + +sap_hana_install_master_password = "NewPass$321" + +sap_hana_install_sid = "H01" + +sap_hana_install_instance_number = "90" + +sap_nwas_abap_ascs_instance_no = "01" + +sap_nwas_abap_pas_instance_no = "00" + +sap_s4hana_install_sid = "S01" + +sap_software_download_directory = "/software" diff --git a/sap_solman_saphana_single_node_install/msazure_vm/versions.tf b/sap_solman_saphana_single_node_install/msazure_vm/versions.tf new file mode 100644 index 0000000..74aaca6 --- /dev/null +++ b/sap_solman_saphana_single_node_install/msazure_vm/versions.tf @@ -0,0 +1,28 @@ +# Terraform declaration +terraform { + required_version = ">= 1.0" + required_providers { + azurerm = { + #source = "localdomain/provider/azurerm" // Local, on macOS path to place files would be $HOME/.terraform.d/plugins/localdomain/provider/azurerm/1.xx.xx/darwin_amd6 + source = "hashicorp/azurerm" // Terraform Registry + version = ">=2.90.0" + } + } +} + +# Terraform Provider declaration + +provider "azurerm" { + + features {} + + tenant_id = var.az_tenant_id // Azure Tenant ID, linked to the Azure Active Directory instance + subscription_id = var.az_subscription_id // Azure Subscription ID, linked to an Azure Tenant. All resource groups belong to the Azure Subscription. + + client_id = var.az_app_client_id // Azure Client ID, defined in the Azure Active Directory instance; equivalent to Active Directory Application ID. + client_secret = var.az_app_client_secret // Azure Application ID Password, defined in the Azure Active Directory instance + + # Role-based Access Control (RBAC) permissions control the actions for resources within the Azure Subscription. + # The Roles are assigned to a Security Principal - which can be a User, Group, Service Principal or Managed Identity. + +} From 8461fdfb5764014c40bc2c0a67dfb52a8548d2e5 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Sun, 14 May 2023 19:46:03 +0100 Subject: [PATCH 09/12] fix: gh actions update --- .github/workflows/terraform_validate_100.yml | 2 +- .github/workflows/terraform_validate_110.yml | 2 +- .github/workflows/terraform_validate_120.yml | 2 +- .github/workflows/terraform_validate_130.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/terraform_validate_100.yml b/.github/workflows/terraform_validate_100.yml index b4a93c3..6111df7 100644 --- a/.github/workflows/terraform_validate_100.yml +++ b/.github/workflows/terraform_validate_100.yml @@ -18,7 +18,7 @@ jobs: max-parallel: 25 matrix: terraform_ver: [~1.0.0] # Job matrix can generate a maximum of 256 jobs per workflow run - sap_solution_scenario: [sap_bw4hana_single_node_install, sap_ecc_hana_single_node_install, sap_ecc_hana_single_node_system_copy_homogeneous_hdb, sap_ecc_ibmdb2_single_node_install, sap_ecc_oracledb_single_node_install, sap_ecc_sapase_single_node_install, sap_ecc_sapmaxdb_single_node_install, sap_hana_single_node_install, sap_nwas_abap_hana_install, sap_nwas_abap_ibmdb2_install, sap_nwas_abap_oracledb_install, sap_nwas_abap_sapase_install, sap_nwas_abap_sapmaxdb_install, sap_nwas_java_ibmdb2_install, sap_nwas_java_sapase_install, sap_s4hana_single_node_install, sap_s4hana_single_node_install_maintenance_plan, sap_s4hana_single_node_system_copy_homogeneous_hdb] + sap_solution_scenario: [sap_bw4hana_single_node_install, sap_ecc_hana_single_node_install, sap_ecc_hana_single_node_system_copy_homogeneous_hdb, sap_ecc_ibmdb2_single_node_install, sap_ecc_oracledb_single_node_install, sap_ecc_sapase_single_node_install, sap_ecc_sapmaxdb_single_node_install, sap_hana_single_node_install, sap_nwas_abap_hana_install, sap_nwas_abap_ibmdb2_install, sap_nwas_abap_oracledb_install, sap_nwas_abap_sapase_install, sap_nwas_abap_sapmaxdb_install, sap_nwas_java_ibmdb2_install, sap_nwas_java_sapase_install, sap_s4hana_distributed_install, sap_s4hana_single_node_install, sap_s4hana_single_node_install_maintenance_plan, sap_s4hana_single_node_system_copy_homogeneous_hdb, sap_solman_sapase_single_node_install, sap_solman_saphana_single_node_install] infrastructure_platform: [aws_ec2_instance, gcp_ce_vm, ibmcloud_vs, ibmcloud_powervs, ibmpowervc, msazure_vm, vmware_vm] steps: - name: Checkout diff --git a/.github/workflows/terraform_validate_110.yml b/.github/workflows/terraform_validate_110.yml index e76b194..e389acc 100644 --- a/.github/workflows/terraform_validate_110.yml +++ b/.github/workflows/terraform_validate_110.yml @@ -18,7 +18,7 @@ jobs: max-parallel: 25 matrix: terraform_ver: [~1.1.0] # Job matrix can generate a maximum of 256 jobs per workflow run - sap_solution_scenario: [sap_bw4hana_single_node_install, sap_ecc_hana_single_node_install, sap_ecc_hana_single_node_system_copy_homogeneous_hdb, sap_ecc_ibmdb2_single_node_install, sap_ecc_oracledb_single_node_install, sap_ecc_sapase_single_node_install, sap_ecc_sapmaxdb_single_node_install, sap_hana_single_node_install, sap_nwas_abap_hana_install, sap_nwas_abap_ibmdb2_install, sap_nwas_abap_oracledb_install, sap_nwas_abap_sapase_install, sap_nwas_abap_sapmaxdb_install, sap_nwas_java_ibmdb2_install, sap_nwas_java_sapase_install, sap_s4hana_single_node_install, sap_s4hana_single_node_install_maintenance_plan, sap_s4hana_single_node_system_copy_homogeneous_hdb] + sap_solution_scenario: [sap_bw4hana_single_node_install, sap_ecc_hana_single_node_install, sap_ecc_hana_single_node_system_copy_homogeneous_hdb, sap_ecc_ibmdb2_single_node_install, sap_ecc_oracledb_single_node_install, sap_ecc_sapase_single_node_install, sap_ecc_sapmaxdb_single_node_install, sap_hana_single_node_install, sap_nwas_abap_hana_install, sap_nwas_abap_ibmdb2_install, sap_nwas_abap_oracledb_install, sap_nwas_abap_sapase_install, sap_nwas_abap_sapmaxdb_install, sap_nwas_java_ibmdb2_install, sap_nwas_java_sapase_install, sap_s4hana_distributed_install, sap_s4hana_single_node_install, sap_s4hana_single_node_install_maintenance_plan, sap_s4hana_single_node_system_copy_homogeneous_hdb, sap_solman_sapase_single_node_install, sap_solman_saphana_single_node_install] infrastructure_platform: [aws_ec2_instance, gcp_ce_vm, ibmcloud_vs, ibmcloud_powervs, ibmpowervc, msazure_vm, vmware_vm] steps: - name: Checkout diff --git a/.github/workflows/terraform_validate_120.yml b/.github/workflows/terraform_validate_120.yml index 571b4b5..4930291 100644 --- a/.github/workflows/terraform_validate_120.yml +++ b/.github/workflows/terraform_validate_120.yml @@ -18,7 +18,7 @@ jobs: max-parallel: 25 matrix: terraform_ver: [~1.2.0] # Job matrix can generate a maximum of 256 jobs per workflow run - sap_solution_scenario: [sap_bw4hana_single_node_install, sap_ecc_hana_single_node_install, sap_ecc_hana_single_node_system_copy_homogeneous_hdb, sap_ecc_ibmdb2_single_node_install, sap_ecc_oracledb_single_node_install, sap_ecc_sapase_single_node_install, sap_ecc_sapmaxdb_single_node_install, sap_hana_single_node_install, sap_nwas_abap_hana_install, sap_nwas_abap_ibmdb2_install, sap_nwas_abap_oracledb_install, sap_nwas_abap_sapase_install, sap_nwas_abap_sapmaxdb_install, sap_nwas_java_ibmdb2_install, sap_nwas_java_sapase_install, sap_s4hana_single_node_install, sap_s4hana_single_node_install_maintenance_plan, sap_s4hana_single_node_system_copy_homogeneous_hdb] + sap_solution_scenario: [sap_bw4hana_single_node_install, sap_ecc_hana_single_node_install, sap_ecc_hana_single_node_system_copy_homogeneous_hdb, sap_ecc_ibmdb2_single_node_install, sap_ecc_oracledb_single_node_install, sap_ecc_sapase_single_node_install, sap_ecc_sapmaxdb_single_node_install, sap_hana_single_node_install, sap_nwas_abap_hana_install, sap_nwas_abap_ibmdb2_install, sap_nwas_abap_oracledb_install, sap_nwas_abap_sapase_install, sap_nwas_abap_sapmaxdb_install, sap_nwas_java_ibmdb2_install, sap_nwas_java_sapase_install, sap_s4hana_distributed_install, sap_s4hana_single_node_install, sap_s4hana_single_node_install_maintenance_plan, sap_s4hana_single_node_system_copy_homogeneous_hdb, sap_solman_sapase_single_node_install, sap_solman_saphana_single_node_install] infrastructure_platform: [aws_ec2_instance, gcp_ce_vm, ibmcloud_vs, ibmcloud_powervs, ibmpowervc, msazure_vm, vmware_vm] steps: - name: Checkout diff --git a/.github/workflows/terraform_validate_130.yml b/.github/workflows/terraform_validate_130.yml index dbe36ae..017075d 100644 --- a/.github/workflows/terraform_validate_130.yml +++ b/.github/workflows/terraform_validate_130.yml @@ -18,7 +18,7 @@ jobs: max-parallel: 25 matrix: terraform_ver: [~1.3.0] # Job matrix can generate a maximum of 256 jobs per workflow run - sap_solution_scenario: [sap_bw4hana_single_node_install, sap_ecc_hana_single_node_install, sap_ecc_hana_single_node_system_copy_homogeneous_hdb, sap_ecc_ibmdb2_single_node_install, sap_ecc_oracledb_single_node_install, sap_ecc_sapase_single_node_install, sap_ecc_sapmaxdb_single_node_install, sap_hana_single_node_install, sap_nwas_abap_hana_install, sap_nwas_abap_ibmdb2_install, sap_nwas_abap_oracledb_install, sap_nwas_abap_sapase_install, sap_nwas_abap_sapmaxdb_install, sap_nwas_java_ibmdb2_install, sap_nwas_java_sapase_install, sap_s4hana_single_node_install, sap_s4hana_single_node_install_maintenance_plan, sap_s4hana_single_node_system_copy_homogeneous_hdb] + sap_solution_scenario: [sap_bw4hana_single_node_install, sap_ecc_hana_single_node_install, sap_ecc_hana_single_node_system_copy_homogeneous_hdb, sap_ecc_ibmdb2_single_node_install, sap_ecc_oracledb_single_node_install, sap_ecc_sapase_single_node_install, sap_ecc_sapmaxdb_single_node_install, sap_hana_single_node_install, sap_nwas_abap_hana_install, sap_nwas_abap_ibmdb2_install, sap_nwas_abap_oracledb_install, sap_nwas_abap_sapase_install, sap_nwas_abap_sapmaxdb_install, sap_nwas_java_ibmdb2_install, sap_nwas_java_sapase_install, sap_s4hana_distributed_install, sap_s4hana_single_node_install, sap_s4hana_single_node_install_maintenance_plan, sap_s4hana_single_node_system_copy_homogeneous_hdb, sap_solman_sapase_single_node_install, sap_solman_saphana_single_node_install] infrastructure_platform: [aws_ec2_instance, gcp_ce_vm, ibmcloud_vs, ibmcloud_powervs, ibmpowervc, msazure_vm, vmware_vm] steps: - name: Checkout From f3090c8aee77dae6fc302670517958ca213348bf Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Sun, 14 May 2023 21:56:06 +0100 Subject: [PATCH 10/12] fix: wrong vars and update docs --- README.md | 5 +++++ sap_s4hana_distributed_install/aws_ec2_instance/main.tf | 7 +++++-- sap_s4hana_distributed_install/gcp_ce_vm/main.tf | 7 +++++-- sap_s4hana_distributed_install/ibmcloud_vs/main.tf | 7 +++++-- sap_s4hana_distributed_install/msazure_vm/main.tf | 7 +++++-- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4bf8524..ceacdaf 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ These Terraform Templates for SAP are designed to be: | **SAP HANA 2.0 (any version)**
single-node installation |
  • :white_check_mark: AWS EC2 instance
  • :white_check_mark: Google Cloud CE VM
  • :white_check_mark: IBM Cloud, Intel VS
  • :white_check_mark: IBM Cloud, Power VS
  • :white_check_mark: Microsoft Azure VM
  • :white_check_mark: IBM PowerVM LPAR
  • :white_check_mark: VMware vSphere VM
*Coming Soon: OVirt VM*
| | **SAP S/4HANA (2021, 2022)**
single-node installation |
  • :white_check_mark: AWS EC2 instance
  • :white_check_mark: Google Cloud CE VM
  • :white_check_mark: IBM Cloud, Intel VS
  • :white_check_mark: IBM Cloud, Power VS
  • :white_check_mark: Microsoft Azure VM
  • :white_check_mark: IBM PowerVM LPAR
  • :white_check_mark: VMware vSphere VM
*Coming Soon: OVirt VM*
| | **SAP S/4HANA (2020, 2021, 2022)**
single-node installation,
using SAP Maintenance Planner Stack XML
(to run SUM and SPAM / SAINT) |
  • :white_check_mark: AWS EC2 instance
  • :white_check_mark: Google Cloud CE VM
  • :white_check_mark: IBM Cloud, Intel VS
  • :white_check_mark: IBM Cloud, Power VS
  • :white_check_mark: Microsoft Azure VM
  • :white_check_mark: IBM PowerVM LPAR
  • :white_check_mark: VMware vSphere VM
*Coming Soon: OVirt VM*
| +| **SAP S/4HANA (2020, 2021, 2022)**
Distributed installation
(HDB, NWAS ASCS, NWAS PAS, NWAS AAS),
using SAP Maintenance Planner Stack XML
(to run SUM and SPAM / SAINT) |
  • :white_check_mark: AWS EC2 instance
  • :white_check_mark: Google Cloud CE VM
  • :white_check_mark: IBM Cloud, Intel VS
  • :warning: IBM Cloud, Power VS
  • :white_check_mark: Microsoft Azure VM
  • :x: IBM PowerVM LPAR
  • :x: VMware vSphere VM
*Coming Soon: OVirt VM*
| | **SAP S/4HANA (1909, 2020, 2021, 2022)**
single-node System Copy installation
(Homogeneous with SAP HANA Backup / Recovery) |
  • :warning: AWS EC2 instance
  • :warning: Google Cloud CE VM
  • :white_check_mark: IBM Cloud, Intel VS
  • :white_check_mark: IBM Cloud, Power VS
  • :warning: Microsoft Azure VM
  • :warning: IBM PowerVM LPAR
  • :warning: VMware vSphere VM
*Coming Soon: OVirt VM*
| | **SAP BW/4HANA (2021)**
single-node installation |
  • :white_check_mark: AWS EC2 instance
  • :white_check_mark: Google Cloud CE VM
  • :white_check_mark: IBM Cloud, Intel VS
  • :white_check_mark: IBM Cloud, Power VS
  • :white_check_mark: Microsoft Azure VM
  • :white_check_mark: IBM PowerVM LPAR
  • :white_check_mark: VMware vSphere VM
*Coming Soon: OVirt VM*
| | **SAP ECC on SAP HANA (EHP7, EHP8)**
single-node installation |
  • :white_check_mark: AWS EC2 instance
  • :white_check_mark: Google Cloud CE VM
  • :white_check_mark: IBM Cloud, Intel VS
  • :white_check_mark: IBM Cloud, Power VS
  • :white_check_mark: Microsoft Azure VM
  • :white_check_mark: IBM PowerVM LPAR
  • :white_check_mark: VMware vSphere VM
*Coming Soon: OVirt VM*
| @@ -47,6 +48,8 @@ These Terraform Templates for SAP are designed to be: | **SAP NetWeaver AS (ABAP) with SAP MaxDB (7.50, 7.52)**
single-node installation |
  • :white_check_mark: AWS EC2 instance
  • :white_check_mark: Google Cloud CE VM
  • :white_check_mark: IBM Cloud, Intel VS
  • :no_entry_sign: IBM Cloud, Power VS
  • :white_check_mark: Microsoft Azure VM
  • :no_entry_sign: IBM PowerVM LPAR
  • :white_check_mark: VMware vSphere VM
*Coming Soon: OVirt VM*
| | **SAP NetWeaver AS (`JAVA`) with IBM Db2 (7.50)**
single-node installation |
  • :white_check_mark: AWS EC2 instance
  • :white_check_mark: Google Cloud CE VM
  • :white_check_mark: IBM Cloud, Intel VS
  • :no_entry_sign: IBM Cloud, Power VS
  • :white_check_mark: Microsoft Azure VM
  • :no_entry_sign: IBM PowerVM LPAR
  • :white_check_mark: VMware vSphere VM
*Coming Soon: OVirt VM*
| | **SAP NetWeaver AS (`JAVA`) with SAP ASE (7.50)**
single-node installation |
  • :white_check_mark: AWS EC2 instance
  • :white_check_mark: Google Cloud CE VM
  • :white_check_mark: IBM Cloud, Intel VS
  • :no_entry_sign: IBM Cloud, Power VS
  • :white_check_mark: Microsoft Azure VM
  • :no_entry_sign: IBM PowerVM LPAR
  • :white_check_mark: VMware vSphere VM
*Coming Soon: OVirt VM*
| +| **SAP Solution Manager 7.2 SP2 (`ABAP/JAVA`)
with SAP ASE**
single-node installation |
  • :white_check_mark: AWS EC2 instance
  • :white_check_mark: Google Cloud CE VM
  • :white_check_mark: IBM Cloud, Intel VS
  • :no_entry_sign: IBM Cloud, Power VS
  • :white_check_mark: Microsoft Azure VM
  • :no_entry_sign: IBM PowerVM LPAR
  • :x: VMware vSphere VM
*Coming Soon: OVirt VM*
| +| **SAP Solution Manager 7.2 SP2 (`ABAP/JAVA`)
with SAP HANA**
single-node installation |
  • :white_check_mark: AWS EC2 instance
  • :white_check_mark: Google Cloud CE VM
  • :white_check_mark: IBM Cloud, Intel VS
  • :no_entry_sign: IBM Cloud, Power VS
  • :white_check_mark: Microsoft Azure VM
  • :no_entry_sign: IBM PowerVM LPAR
  • :x: VMware vSphere VM
*Coming Soon: OVirt VM*
| **Key:** @@ -76,6 +79,8 @@ The following is an overview of the Infrastructure-as-Code (IaC) provisioning, f | Create Bastion host and Public IP address | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | N/A | N/A | |
***Host Network Access for SAP*** | | | | | | | | | Append Network Security rules for SAP | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | N/A | N/A | +|
***Host NFS*** | | | | | | | | +| Create NFS Share | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :warning: | N/A | N/A | |
***Host Provision*** | | | | | | | | | Create DNS Records (i.e. A, CNAME, PTR) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | N/A | N/A | | Create Storage Volumes (Profile or Custom IOPS) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :warning:
no custom IOPS | :white_check_mark: | :white_check_mark: | diff --git a/sap_s4hana_distributed_install/aws_ec2_instance/main.tf b/sap_s4hana_distributed_install/aws_ec2_instance/main.tf index f5b06ec..c3f02e8 100644 --- a/sap_s4hana_distributed_install/aws_ec2_instance/main.tf +++ b/sap_s4hana_distributed_install/aws_ec2_instance/main.tf @@ -12,8 +12,6 @@ module "run_ansible_dry_run" { module_var_bastion_private_ssh_key = "" module_var_bastion_floating_ip = "" module_var_host_private_ssh_key = "" - module_var_host_private_ip = "" - module_var_hostname = "software_media_dry_run" module_var_dns_root_domain_name = "" module_var_sap_id_user = var.sap_id_user module_var_sap_id_user_password = var.sap_id_user_password @@ -24,6 +22,11 @@ module "run_ansible_dry_run" { module_var_sap_swpm_template_selected = var.sap_swpm_template_selected module_var_sap_maintenance_planner_transaction_name = var.sap_maintenance_planner_transaction_name + module_var_inventory_hana_primary = "software_media_dry_run" + module_var_inventory_nwas_ascs = "software_media_dry_run" + module_var_inventory_nwas_pas = "software_media_dry_run" + module_var_inventory_nwas_aas = "software_media_dry_run" + } diff --git a/sap_s4hana_distributed_install/gcp_ce_vm/main.tf b/sap_s4hana_distributed_install/gcp_ce_vm/main.tf index 8faaa17..75ff38b 100644 --- a/sap_s4hana_distributed_install/gcp_ce_vm/main.tf +++ b/sap_s4hana_distributed_install/gcp_ce_vm/main.tf @@ -12,8 +12,6 @@ module "run_ansible_dry_run" { module_var_bastion_private_ssh_key = "" module_var_bastion_floating_ip = "" module_var_host_private_ssh_key = "" - module_var_host_private_ip = "" - module_var_hostname = "software_media_dry_run" module_var_dns_root_domain_name = "" module_var_sap_id_user = var.sap_id_user module_var_sap_id_user_password = var.sap_id_user_password @@ -24,6 +22,11 @@ module "run_ansible_dry_run" { module_var_sap_swpm_template_selected = var.sap_swpm_template_selected module_var_sap_maintenance_planner_transaction_name = var.sap_maintenance_planner_transaction_name + module_var_inventory_hana_primary = "software_media_dry_run" + module_var_inventory_nwas_ascs = "software_media_dry_run" + module_var_inventory_nwas_pas = "software_media_dry_run" + module_var_inventory_nwas_aas = "software_media_dry_run" + } diff --git a/sap_s4hana_distributed_install/ibmcloud_vs/main.tf b/sap_s4hana_distributed_install/ibmcloud_vs/main.tf index c9c19df..b101696 100644 --- a/sap_s4hana_distributed_install/ibmcloud_vs/main.tf +++ b/sap_s4hana_distributed_install/ibmcloud_vs/main.tf @@ -12,8 +12,6 @@ module "run_ansible_dry_run" { module_var_bastion_private_ssh_key = "" module_var_bastion_floating_ip = "" module_var_host_private_ssh_key = "" - module_var_host_private_ip = "" - module_var_hostname = "software_media_dry_run" module_var_dns_root_domain_name = "" module_var_sap_id_user = var.sap_id_user module_var_sap_id_user_password = var.sap_id_user_password @@ -24,6 +22,11 @@ module "run_ansible_dry_run" { module_var_sap_swpm_template_selected = var.sap_swpm_template_selected module_var_sap_maintenance_planner_transaction_name = var.sap_maintenance_planner_transaction_name + module_var_inventory_hana_primary = "software_media_dry_run" + module_var_inventory_nwas_ascs = "software_media_dry_run" + module_var_inventory_nwas_pas = "software_media_dry_run" + module_var_inventory_nwas_aas = "software_media_dry_run" + } diff --git a/sap_s4hana_distributed_install/msazure_vm/main.tf b/sap_s4hana_distributed_install/msazure_vm/main.tf index 37abff8..19799ff 100644 --- a/sap_s4hana_distributed_install/msazure_vm/main.tf +++ b/sap_s4hana_distributed_install/msazure_vm/main.tf @@ -12,8 +12,6 @@ module "run_ansible_dry_run" { module_var_bastion_private_ssh_key = "" module_var_bastion_floating_ip = "" module_var_host_private_ssh_key = "" - module_var_host_private_ip = "" - module_var_hostname = "software_media_dry_run" module_var_dns_root_domain_name = "" module_var_sap_id_user = var.sap_id_user module_var_sap_id_user_password = var.sap_id_user_password @@ -24,6 +22,11 @@ module "run_ansible_dry_run" { module_var_sap_swpm_template_selected = var.sap_swpm_template_selected module_var_sap_maintenance_planner_transaction_name = var.sap_maintenance_planner_transaction_name + module_var_inventory_hana_primary = "software_media_dry_run" + module_var_inventory_nwas_ascs = "software_media_dry_run" + module_var_inventory_nwas_pas = "software_media_dry_run" + module_var_inventory_nwas_aas = "software_media_dry_run" + } From 06cbd930c3e9355b63bd6efbcd3c82f6dff49637 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Sun, 14 May 2023 22:10:05 +0100 Subject: [PATCH 11/12] fix: reset all refs to main branch --- .../aws_ec2_instance/main.tf | 4 ++-- .../ibmcloud_vs/main.tf | 12 ++++++------ .../msazure_vm/main.tf | 4 ++-- .../aws_ec2_instance/main.tf | 4 ++-- .../gcp_ce_vm/main.tf | 2 +- .../ibmcloud_vs/main.tf | 19 ++++++++++--------- .../msazure_vm/main.tf | 4 ++-- .../aws_ec2_instance/main.tf | 4 ++-- .../gcp_ce_vm/main.tf | 4 ++-- .../ibmcloud_vs/main.tf | 4 ++-- .../msazure_vm/main.tf | 4 ++-- 11 files changed, 33 insertions(+), 32 deletions(-) diff --git a/sap_s4hana_distributed_install/aws_ec2_instance/main.tf b/sap_s4hana_distributed_install/aws_ec2_instance/main.tf index c3f02e8..ba92bc4 100644 --- a/sap_s4hana_distributed_install/aws_ec2_instance/main.tf +++ b/sap_s4hana_distributed_install/aws_ec2_instance/main.tf @@ -55,7 +55,7 @@ module "run_account_bootstrap_module" { module.run_account_init_module ] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/account_bootstrap?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/account_bootstrap?ref=main" module_var_resource_prefix = var.resource_prefix @@ -104,7 +104,7 @@ module "run_host_network_access_sap_module" { module.run_bastion_inject_module ] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/host_network_access_sap?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//aws_ec2_instance/host_network_access_sap?ref=main" module_var_resource_prefix = var.resource_prefix diff --git a/sap_s4hana_distributed_install/ibmcloud_vs/main.tf b/sap_s4hana_distributed_install/ibmcloud_vs/main.tf index b101696..0d8d275 100644 --- a/sap_s4hana_distributed_install/ibmcloud_vs/main.tf +++ b/sap_s4hana_distributed_install/ibmcloud_vs/main.tf @@ -36,7 +36,7 @@ module "run_account_init_module" { module.run_ansible_dry_run ] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_init?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_init?ref=main" module_var_resource_group_name = local.resource_group_create_boolean ? 0 : var.ibmcloud_resource_group module_var_resource_group_create_boolean = local.resource_group_create_boolean @@ -56,7 +56,7 @@ module "run_account_bootstrap_module" { module.run_account_init_module ] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_bootstrap?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_bootstrap?ref=main" module_var_resource_group_id = module.run_account_init_module.output_resource_group_id module_var_resource_prefix = var.resource_prefix @@ -77,7 +77,7 @@ module "run_account_iam_module" { count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" module_var_resource_group_id = module.run_account_init_module.output_resource_group_id module_var_resource_prefix = var.resource_prefix @@ -92,7 +92,7 @@ module "run_bastion_inject_module" { module.run_account_bootstrap_module ] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/bastion_inject?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/bastion_inject?ref=main" module_var_resource_group_id = module.run_account_init_module.output_resource_group_id module_var_resource_prefix = var.resource_prefix @@ -119,7 +119,7 @@ module "run_host_network_access_sap_module" { module.run_bastion_inject_module ] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_network_access_sap?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_network_access_sap?ref=main" module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name module_var_host_security_group_id = module.run_account_bootstrap_module.output_host_security_group_id @@ -138,7 +138,7 @@ module "run_host_network_access_sap_public_via_proxy_module" { module.run_bastion_inject_module ] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_network_access_sap_public_via_proxy?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_network_access_sap_public_via_proxy?ref=main" module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name diff --git a/sap_s4hana_distributed_install/msazure_vm/main.tf b/sap_s4hana_distributed_install/msazure_vm/main.tf index 19799ff..140a9aa 100644 --- a/sap_s4hana_distributed_install/msazure_vm/main.tf +++ b/sap_s4hana_distributed_install/msazure_vm/main.tf @@ -61,7 +61,7 @@ module "run_account_bootstrap_module" { module.run_account_init_module ] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/account_bootstrap?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/account_bootstrap?ref=main" module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name module_var_resource_prefix = var.resource_prefix @@ -129,7 +129,7 @@ module "run_host_network_access_sap_module" { module.run_bastion_inject_module ] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/host_network_access_sap?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//msazure_vm/host_network_access_sap?ref=main" module_var_az_resource_group_name = module.run_account_init_module.output_resource_group_name diff --git a/sap_solman_sapase_single_node_install/aws_ec2_instance/main.tf b/sap_solman_sapase_single_node_install/aws_ec2_instance/main.tf index a185e6d..7d9117d 100644 --- a/sap_solman_sapase_single_node_install/aws_ec2_instance/main.tf +++ b/sap_solman_sapase_single_node_install/aws_ec2_instance/main.tf @@ -1,7 +1,7 @@ module "run_ansible_dry_run" { - source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=main" module_var_dry_run_test = "x86_64" // x86_64 or ppc64le @@ -256,7 +256,7 @@ module "run_ansible_sap_solman_java_sapase_install" { depends_on = [module.run_host_provision_module] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=main" # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) diff --git a/sap_solman_sapase_single_node_install/gcp_ce_vm/main.tf b/sap_solman_sapase_single_node_install/gcp_ce_vm/main.tf index 2f4917f..1b0b0b7 100644 --- a/sap_solman_sapase_single_node_install/gcp_ce_vm/main.tf +++ b/sap_solman_sapase_single_node_install/gcp_ce_vm/main.tf @@ -241,7 +241,7 @@ module "run_ansible_sap_solman_java_sapase_install" { depends_on = [module.run_host_provision_module] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=main" # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) diff --git a/sap_solman_sapase_single_node_install/ibmcloud_vs/main.tf b/sap_solman_sapase_single_node_install/ibmcloud_vs/main.tf index bb7f1b9..e792660 100644 --- a/sap_solman_sapase_single_node_install/ibmcloud_vs/main.tf +++ b/sap_solman_sapase_single_node_install/ibmcloud_vs/main.tf @@ -1,7 +1,7 @@ module "run_ansible_dry_run" { - source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=main" module_var_dry_run_test = "x86_64" // x86_64 or ppc64le @@ -34,7 +34,8 @@ module "run_account_init_module" { # Use GitHub API to identify latest Terraform Modules for SAP release and use as HTTP ZIP for the Terraform Module Source and use sub-directory # (https://developer.hashicorp.com/terraform/language/modules/sources#http-urls) #source = "https://api.github.com/repos/sap-linuxlab/terraform.modules_for_sap/zipball//*/ibmcloud_vs/account_init?archive=zip" - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_init?ref=0.7.5" +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_init?ref=0.7.5" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_init?ref=main" module_var_resource_group_name = local.resource_group_create_boolean ? 0 : var.ibmcloud_resource_group module_var_resource_group_create_boolean = local.resource_group_create_boolean @@ -54,7 +55,7 @@ module "run_account_bootstrap_module" { module.run_account_init_module ] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_bootstrap?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_bootstrap?ref=main" module_var_resource_group_id = module.run_account_init_module.output_resource_group_id module_var_resource_prefix = var.resource_prefix @@ -75,7 +76,7 @@ module "run_account_iam_module" { count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" module_var_resource_group_id = module.run_account_init_module.output_resource_group_id module_var_resource_prefix = var.resource_prefix @@ -90,7 +91,7 @@ module "run_bastion_inject_module" { module.run_account_bootstrap_module ] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/bastion_inject?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/bastion_inject?ref=main" module_var_resource_group_id = module.run_account_init_module.output_resource_group_id module_var_resource_prefix = var.resource_prefix @@ -117,7 +118,7 @@ module "run_host_network_access_sap_module" { module.run_bastion_inject_module ] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_network_access_sap?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_network_access_sap?ref=main" module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name module_var_host_security_group_id = module.run_account_bootstrap_module.output_host_security_group_id @@ -139,7 +140,7 @@ module "run_host_network_access_sap_public_via_proxy_module" { module.run_bastion_inject_module ] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_network_access_sap_public_via_proxy?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_network_access_sap_public_via_proxy?ref=main" module_var_ibmcloud_vpc_subnet_name = local.ibmcloud_vpc_subnet_create_boolean ? module.run_account_init_module.output_vpc_subnet_name : var.ibmcloud_vpc_subnet_name @@ -162,7 +163,7 @@ module "run_host_provision_module" { module.run_bastion_inject_module ] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_provision?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/host_provision?ref=main" # Set Terraform Module Variables using Terraform Variables at runtime @@ -279,7 +280,7 @@ module "run_ansible_sap_solman_java_sapase_install" { depends_on = [module.run_host_provision_module] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=main" # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) diff --git a/sap_solman_sapase_single_node_install/msazure_vm/main.tf b/sap_solman_sapase_single_node_install/msazure_vm/main.tf index e875552..1b0b480 100644 --- a/sap_solman_sapase_single_node_install/msazure_vm/main.tf +++ b/sap_solman_sapase_single_node_install/msazure_vm/main.tf @@ -1,7 +1,7 @@ module "run_ansible_dry_run" { - source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=main" module_var_dry_run_test = "x86_64" // x86_64 or ppc64le @@ -291,7 +291,7 @@ module "run_ansible_sap_solman_java_sapase_install" { depends_on = [module.run_host_provision_module] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_sapase_install?ref=main" # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) diff --git a/sap_solman_saphana_single_node_install/aws_ec2_instance/main.tf b/sap_solman_saphana_single_node_install/aws_ec2_instance/main.tf index bc28726..dc4a1eb 100644 --- a/sap_solman_saphana_single_node_install/aws_ec2_instance/main.tf +++ b/sap_solman_saphana_single_node_install/aws_ec2_instance/main.tf @@ -1,7 +1,7 @@ module "run_ansible_dry_run" { - source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=main" module_var_dry_run_test = "x86_64" // x86_64 or ppc64le @@ -254,7 +254,7 @@ module "run_ansible_sap_solman_saphana_install" { depends_on = [module.run_host_provision_module] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=main" # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) diff --git a/sap_solman_saphana_single_node_install/gcp_ce_vm/main.tf b/sap_solman_saphana_single_node_install/gcp_ce_vm/main.tf index 97c2001..2fb7380 100644 --- a/sap_solman_saphana_single_node_install/gcp_ce_vm/main.tf +++ b/sap_solman_saphana_single_node_install/gcp_ce_vm/main.tf @@ -1,7 +1,7 @@ module "run_ansible_dry_run" { - source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=main" module_var_dry_run_test = "x86_64" // x86_64 or ppc64le @@ -238,7 +238,7 @@ module "run_ansible_sap_solman_saphana_install" { depends_on = [module.run_host_provision_module] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=main" # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) diff --git a/sap_solman_saphana_single_node_install/ibmcloud_vs/main.tf b/sap_solman_saphana_single_node_install/ibmcloud_vs/main.tf index 9615bd7..cd361d2 100644 --- a/sap_solman_saphana_single_node_install/ibmcloud_vs/main.tf +++ b/sap_solman_saphana_single_node_install/ibmcloud_vs/main.tf @@ -1,7 +1,7 @@ module "run_ansible_dry_run" { - source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=main" module_var_dry_run_test = "x86_64" // x86_64 or ppc64le @@ -276,7 +276,7 @@ module "run_ansible_sap_solman_saphana_install" { depends_on = [module.run_host_provision_module] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=main" # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) diff --git a/sap_solman_saphana_single_node_install/msazure_vm/main.tf b/sap_solman_saphana_single_node_install/msazure_vm/main.tf index d168fdc..287a439 100644 --- a/sap_solman_saphana_single_node_install/msazure_vm/main.tf +++ b/sap_solman_saphana_single_node_install/msazure_vm/main.tf @@ -1,7 +1,7 @@ module "run_ansible_dry_run" { - source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=main" module_var_dry_run_test = "x86_64" // x86_64 or ppc64le @@ -289,7 +289,7 @@ module "run_ansible_sap_solman_saphana_install" { depends_on = [module.run_host_provision_module] - source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=dev" + source = "github.com/sap-linuxlab/terraform.modules_for_sap//all/ansible_sap_solman_saphana_install?ref=main" # Terraform Module Variables using the prior Terraform Module Variables (from bootstrap module) From ba0dae9d5b39dac3c3d268a02601d48c73261cb4 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Sun, 14 May 2023 22:14:09 +0100 Subject: [PATCH 12/12] fix: comment out iam --- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- .../ibmcloud_vs/main.tf | 28 +++++++++---------- .../ibmcloud_vs/variables.tf | 6 ++-- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/sap_s4hana_distributed_install/ibmcloud_vs/main.tf b/sap_s4hana_distributed_install/ibmcloud_vs/main.tf index 0d8d275..1069ea4 100644 --- a/sap_s4hana_distributed_install/ibmcloud_vs/main.tf +++ b/sap_s4hana_distributed_install/ibmcloud_vs/main.tf @@ -69,20 +69,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_s4hana_distributed_install/ibmcloud_vs/variables.tf b/sap_s4hana_distributed_install/ibmcloud_vs/variables.tf index 13c66de..b128473 100644 --- a/sap_s4hana_distributed_install/ibmcloud_vs/variables.tf +++ b/sap_s4hana_distributed_install/ibmcloud_vs/variables.tf @@ -20,9 +20,9 @@ variable "ibmcloud_vpc_availability_zone" { description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range" diff --git a/sap_solman_sapase_single_node_install/ibmcloud_vs/main.tf b/sap_solman_sapase_single_node_install/ibmcloud_vs/main.tf index e792660..6edf8fe 100644 --- a/sap_solman_sapase_single_node_install/ibmcloud_vs/main.tf +++ b/sap_solman_sapase_single_node_install/ibmcloud_vs/main.tf @@ -68,20 +68,20 @@ module "run_account_bootstrap_module" { } -module "run_account_iam_module" { - - depends_on = [ - module.run_account_bootstrap_module - ] - - count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 - - source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" - - module_var_resource_group_id = module.run_account_init_module.output_resource_group_id - module_var_resource_prefix = var.resource_prefix - -} +#module "run_account_iam_module" { +# +# depends_on = [ +# module.run_account_bootstrap_module +# ] +# +# count = var.ibmcloud_iam_yesno == "yes" ? 1 : 0 +# +# source = "github.com/sap-linuxlab/terraform.modules_for_sap//ibmcloud_vs/account_iam?ref=main" +# +# module_var_resource_group_id = module.run_account_init_module.output_resource_group_id +# module_var_resource_prefix = var.resource_prefix +# +#} module "run_bastion_inject_module" { diff --git a/sap_solman_sapase_single_node_install/ibmcloud_vs/variables.tf b/sap_solman_sapase_single_node_install/ibmcloud_vs/variables.tf index 09fd417..417db70 100644 --- a/sap_solman_sapase_single_node_install/ibmcloud_vs/variables.tf +++ b/sap_solman_sapase_single_node_install/ibmcloud_vs/variables.tf @@ -20,9 +20,9 @@ variable "ibmcloud_vpc_availability_zone" { description = "Target IBM Cloud Availability Zone (the IBM Cloud Region will be calculated from this value)" } -variable "ibmcloud_iam_yesno" { - description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" -} +#variable "ibmcloud_iam_yesno" { +# description = "Please choose 'yes' or 'no' for setup of default IBM Cloud Identity and Access Management (IAM) controls, for use by technicians to view and edit resources of SAP Systems run on IBM Cloud (NOTE: Requires admin privileges on API Key)" +#} variable "ibmcloud_vpc_subnet_name" { description = "Enter existing/target VPC Subnet name, or enter 'new' to create a VPC with a default VPC Address Prefix Range"