Skip to content

Commit d61b9cd

Browse files
committed
feat: VPC Landing Zone and SAP HANA one-click deployment(address code review comments)
1 parent 2efc0d6 commit d61b9cd

File tree

4 files changed

+27
-40
lines changed

4 files changed

+27
-40
lines changed

solutions/ibm-catalog/sap-ready-to-go/images.tf

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# Stock image data (only if not using custom)
22
data "ibm_pi_catalog_images" "catalog_images_ds" {
3-
count = local.use_custom_images ? 0 : 1
4-
3+
count = local.use_custom_images ? 0 : 1
54
provider = ibm.ibm-pi
6-
pi_cloud_instance_id = local.powervs_workspace_guid
5+
pi_cloud_instance_id = module.standard.powervs_workspace_guid
76
sap = true
87
}
98

@@ -12,7 +11,11 @@ data "ibm_pi_image" "custom_images" {
1211
count = local.use_custom_images ? 2 : 0
1312
provider = ibm.ibm-pi
1413
pi_image_name = element([local.selected_hana_image, local.selected_netweaver_image], count.index)
15-
pi_cloud_instance_id = local.powervs_workspace_guid
14+
pi_cloud_instance_id = module.standard.powervs_workspace_guid
15+
}
16+
17+
locals {
18+
powervs_custom_images = module.standard.powervs_images
1619
}
1720

1821
locals {
@@ -61,12 +64,12 @@ locals {
6164
byol_and_fls = local.use_fls && local.has_byol_creds
6265
missing_byol_creds = !local.use_fls && !local.has_byol_creds
6366

64-
#images_mixed_msg = "You've selected an fls image and a byol image for hana and netweaver. Using byol on one and fls on another is currently not supported."
65-
#validate_images_mixed = regex("^${local.images_mixed_msg}$", (local.images_mixed ? "" : local.images_mixed_msg))
67+
images_mixed_msg = "You've selected an fls image and a byol image for hana and netweaver. Using byol on one and fls on another is currently not supported."
68+
validate_images_mixed = regex("^${local.images_mixed_msg}$", (local.images_mixed ? "" : local.images_mixed_msg))
6669

67-
#missing_byol_msg = "Missing byol credentials for activation of linux subscription."
68-
#validate_byol_provided = regex("^${local.missing_byol_msg}$", (local.missing_byol_creds ? "" : local.missing_byol_msg))
70+
missing_byol_msg = "Missing byol credentials for activation of linux subscription."
71+
validate_byol_provided = regex("^${local.missing_byol_msg}$", (local.missing_byol_creds ? "" : local.missing_byol_msg))
6972

70-
#byol_and_fls_msg = "FLS images and user provided linux subscription detected. Can't use both at the same time."
71-
#validate_byol_and_fls = regex("^${local.byol_and_fls_msg}$", (local.byol_and_fls ? "" : local.byol_and_fls_msg))
73+
byol_and_fls_msg = "FLS images and user provided linux subscription detected. Can't use both at the same time."
74+
validate_byol_and_fls = regex("^${local.byol_and_fls_msg}$", (local.byol_and_fls ? "" : local.byol_and_fls_msg))
7275
}
Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
locals {
2-
powervs_workspace_guid = module.standard.powervs_workspace_guid
3-
powervs_sshkey_name = module.standard.powervs_ssh_public_key
4-
powervs_custom_images = module.standard.powervs_images
5-
# powervs_networks = module.standard.powervs_management_subnet.values
6-
access_host_or_ip = module.standard.access_host_or_ip
7-
proxy_host_or_ip_port = module.standard.proxy_host_or_ip_port
8-
dns_host_or_ip = module.standard.dns_host_or_ip
9-
ntp_host_or_ip = module.standard.ntp_host_or_ip
10-
nfs_host_or_ip_path = module.standard.nfs_host_or_ip_path
11-
ansible_host_or_ip = module.standard.ansible_host_or_ip
12-
network_services_config = module.standard.network_services_config
13-
scc_wp_instance = module.standard.scc_wp_instance
14-
}
15-
161
locals {
172
powervs_hana_instance = {
183
name = var.powervs_hana_instance_name
@@ -35,8 +20,8 @@ locals {
3520
locals {
3621
powervs_instance_init_linux = {
3722
enable = true
38-
bastion_host_ip = local.access_host_or_ip
39-
ansible_host_or_ip = local.ansible_host_or_ip
23+
bastion_host_ip = module.standard.access_host_or_ip
24+
ansible_host_or_ip = module.standard.ansible_host_or_ip
4025
ssh_private_key = var.ssh_private_key
4126
custom_os_registration = local.use_fls ? null : {
4227
"username" : var.powervs_os_registration_username,
@@ -46,24 +31,24 @@ locals {
4631

4732
powervs_network_services_config = {
4833
squid = {
49-
enable = true
50-
squid_server_ip_port = local.proxy_host_or_ip_port
34+
enable = false
35+
squid_server_ip_port = module.standard.proxy_host_or_ip_port
5136
no_proxy_hosts = "161.0.0.0/8,10.0.0.0/8"
5237
}
5338
nfs = {
54-
enable = local.nfs_host_or_ip_path != "" ? true : false
55-
nfs_server_path = local.nfs_host_or_ip_path
39+
enable = module.standard.nfs_host_or_ip_path != "" ? true : false
40+
nfs_server_path = module.standard.nfs_host_or_ip_path
5641
nfs_client_path = var.nfs_directory
57-
opts = local.network_services_config.nfs.opts
58-
fstype = local.network_services_config.nfs.fstype
42+
opts = module.standard.network_services_config.nfs.opts
43+
fstype = module.standard.network_services_config.nfs.fstype
5944
}
6045
dns = {
61-
enable = local.dns_host_or_ip != "" ? true : false
62-
dns_server_ip = local.dns_host_or_ip
46+
enable = module.standard.dns_host_or_ip != "" ? true : false
47+
dns_server_ip = module.standard.dns_host_or_ip
6348
}
6449
ntp = {
65-
enable = local.ntp_host_or_ip != "" ? true : false
66-
ntp_server_ip = local.ntp_host_or_ip
50+
enable = module.standard.ntp_host_or_ip != "" ? true : false
51+
ntp_server_ip = module.standard.ntp_host_or_ip
6752
}
6853
}
6954
}

solutions/ibm-catalog/sap-ready-to-go/main.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module "sap_system" {
5858
providers = { ibm = ibm.ibm-pi }
5959

6060
prefix = var.prefix
61-
pi_workspace_guid = local.powervs_workspace_guid
61+
pi_workspace_guid = module.standard.powervs_workspace_guid
6262
pi_region = var.powervs_zone
6363
pi_ssh_public_key_name = module.standard.powervs_ssh_public_key.name
6464
pi_networks = [module.standard.powervs_management_subnet, module.standard.powervs_backup_subnet]
@@ -70,5 +70,4 @@ module "sap_system" {
7070
sap_network_services_config = local.powervs_network_services_config
7171
sap_domain = var.sap_domain
7272
ansible_vault_password = var.ansible_vault_password
73-
scc_wp_instance = local.scc_wp_instance
7473
}

solutions/ibm-catalog/sap-ready-to-go/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ output "infrastructure_data" {
55

66
output "access_host_or_ip" {
77
description = "Public IP of Provided Bastion/JumpServer Host."
8-
value = local.access_host_or_ip
8+
value = module.standard.access_host_or_ip
99
}
1010

1111
output "powervs_hana_instance_ips" {

0 commit comments

Comments
 (0)