Skip to content

Commit 5dd6cb5

Browse files
feat: enable support for Chennai DCs che02 and che03 (#1248)
1 parent 0744623 commit 5dd6cb5

37 files changed

+197
-114
lines changed

.secrets.baseline

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.sum|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2026-01-12T16:23:47Z",
6+
"generated_at": "2026-03-18T11:23:38Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -116,15 +116,15 @@
116116
"hashed_secret": "6f803b24314c39062efe38d0c1da8c472f47eab3",
117117
"is_secret": false,
118118
"is_verified": false,
119-
"line_number": 174,
119+
"line_number": 175,
120120
"type": "Secret Keyword",
121121
"verified_result": null
122122
},
123123
{
124124
"hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5",
125125
"is_secret": false,
126126
"is_verified": false,
127-
"line_number": 190,
127+
"line_number": 191,
128128
"type": "Secret Keyword",
129129
"verified_result": null
130130
}
@@ -134,7 +134,7 @@
134134
"hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5",
135135
"is_secret": false,
136136
"is_verified": false,
137-
"line_number": 61,
137+
"line_number": 62,
138138
"type": "Secret Keyword",
139139
"verified_result": null
140140
}
@@ -144,7 +144,7 @@
144144
"hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5",
145145
"is_secret": false,
146146
"is_verified": false,
147-
"line_number": 53,
147+
"line_number": 54,
148148
"type": "Secret Keyword",
149149
"verified_result": null
150150
}
@@ -154,7 +154,7 @@
154154
"hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5",
155155
"is_secret": false,
156156
"is_verified": false,
157-
"line_number": 32,
157+
"line_number": 33,
158158
"type": "Secret Keyword",
159159
"verified_result": null
160160
}

ibm_catalog.json

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,14 @@
103103
"required": true,
104104
"default_value": "",
105105
"options": [
106+
{
107+
"displayname": "Chennai 02 (che02)",
108+
"value": "che02"
109+
},
110+
{
111+
"displayname": "Chennai 03 (che03)",
112+
"value": "che03"
113+
},
106114
{
107115
"displayname": "Dallas (dallas)",
108116
"value": "us-south"
@@ -567,7 +575,7 @@
567575
{
568576
"diagram": {
569577
"caption": "Power Virtual Server with VPC landing zone 'Standard Landscape' variation",
570-
"url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-powervs-infrastructure/refs/tags/v11.0.0/reference-architectures/standard/deploy-arch-ibm-pvs-inf-standard.svg",
578+
"url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-powervs-infrastructure/refs/tags/v11.1.0/reference-architectures/standard/deploy-arch-ibm-pvs-inf-standard.svg",
571579
"type": "image/svg+xml"
572580
},
573581
"description": "The Power Virtual Server with VPC landing zone as variation 'Standard Landscape' deploys VPC services and a Power Virtual Server workspace and interconnects them.\n \nRequired and optional management components are configured."
@@ -618,6 +626,14 @@
618626
"default_value": "",
619627
"required": true,
620628
"options": [
629+
{
630+
"displayname": "Chennai 02 (che02)",
631+
"value": "che02"
632+
},
633+
{
634+
"displayname": "Chennai 03 (che03)",
635+
"value": "che03"
636+
},
621637
{
622638
"displayname": "Dallas (dallas)",
623639
"value": "us-south"
@@ -1306,7 +1322,7 @@
13061322
{
13071323
"diagram": {
13081324
"caption": "Power Virtual Server with VPC landing zone 'Quickstart' variation",
1309-
"url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-powervs-infrastructure/refs/tags/v11.0.0/reference-architectures/standard-plus-vsi/deploy-arch-ibm-pvs-inf-standard-plus-vsi.svg",
1325+
"url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-powervs-infrastructure/refs/tags/v11.1.0/reference-architectures/standard-plus-vsi/deploy-arch-ibm-pvs-inf-standard-plus-vsi.svg",
13101326
"type": "image/svg+xml"
13111327
},
13121328
"description": "The Power Virtual Server with VPC landing zone as 'Quickstart' variation deploys VPC services and a Power Virtual Server workspace and interconnects them. It also creates one Power virtual server instance of chosen t-shirt size or custom configuration.\n \nRequired and optional management components are configured."
@@ -1883,7 +1899,7 @@
18831899
{
18841900
"diagram": {
18851901
"caption": "Power Virtual Server with VPC landing zone 'Quickstart OpenShift' variation",
1886-
"url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-powervs-infrastructure/refs/tags/v11.0.0/reference-architectures/standard-openshift/deploy-arch-ibm-pvs-inf-standard-openshift.svg",
1902+
"url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-powervs-infrastructure/refs/tags/v11.1.0/reference-architectures/standard-openshift/deploy-arch-ibm-pvs-inf-standard-openshift.svg",
18871903
"type": "image/svg+xml"
18881904
},
18891905
"description": "The Power Virtual Server with VPC landing zone as variation 'Quickstart OpenShift' deploys VPC services and an Openshift Cluster on PowerVS and interconnects them.\n \nRequired and optional management components are configured."

modules/powervs-vpc-landing-zone/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Creates VPC Landing Zone | Performs VPC VSI OS Config | Creates PowerVS Infrastr
157157
| <a name="input_existing_sm_instance_region"></a> [existing\_sm\_instance\_region](#input\_existing\_sm\_instance\_region) | Required if value is passed into `var.existing_sm_instance_guid`. | `string` | `null` | no |
158158
| <a name="input_external_access_ip"></a> [external\_access\_ip](#input\_external\_access\_ip) | Specify the source IP address or CIDR for login through SSH to the environment after deployment. Access to the environment will be allowed only from this IP address. Can be set to 'null' if you choose to use client to site vpn. | `string` | n/a | yes |
159159
| <a name="input_ibm_dns_service"></a> [ibm\_dns\_service](#input\_ibm\_dns\_service) | Create IBM DNS service instance, DNS zone, and custom resolver. If set to false, then the DNS service and zone will not be created. Conflicts with 'configure\_dns\_forwarder'. | <pre>object({<br/> enable = bool<br/> name = optional(string)<br/> base_domain = optional(string)<br/> label = optional(string)<br/> })</pre> | <pre>{<br/> "enable": false<br/>}</pre> | no |
160-
| <a name="input_network_services_vsi_profile"></a> [network\_services\_vsi\_profile](#input\_network\_services\_vsi\_profile) | Compute profile configuration of the network services vsi (cpu and memory configuration). Must be one of the supported profiles. See [here](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui). | `string` | `"cx2-2x4"` | no |
160+
| <a name="input_network_services_vsi_profile"></a> [network\_services\_vsi\_profile](#input\_network\_services\_vsi\_profile) | Compute profile configuration of the network services vsi (cpu and memory configuration). Must be one of the supported profiles. See [here](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui). | `string` | `"cxf-2x4"` | no |
161161
| <a name="input_nfs_server_config"></a> [nfs\_server\_config](#input\_nfs\_server\_config) | Configuration for the NFS server. 'size' is in GB, 'iops' is maximum input/output operation performance bandwidth per second, 'mount\_path' defines the target mount point on os. Set 'configure\_nfs\_server' to false to ignore creating file storage share. | <pre>object({<br/> size = number<br/> iops = number<br/> mount_path = string<br/> })</pre> | <pre>{<br/> "iops": 600,<br/> "mount_path": "/nfs",<br/> "size": 200<br/>}</pre> | no |
162162
| <a name="input_powervs_backup_network"></a> [powervs\_backup\_network](#input\_powervs\_backup\_network) | Name of the IBM Cloud PowerVS backup network and CIDR to create. | <pre>object({<br/> name = string<br/> cidr = string<br/> })</pre> | <pre>{<br/> "cidr": "10.52.0.0/24",<br/> "name": "bkp_net"<br/>}</pre> | no |
163163
| <a name="input_powervs_custom_image_cos_configuration"></a> [powervs\_custom\_image\_cos\_configuration](#input\_powervs\_custom\_image\_cos\_configuration) | Cloud Object Storage bucket containing custom PowerVS images. bucket\_name: string, name of the COS bucket. bucket\_access: string, possible values: public, private (private requires powervs\_custom\_image\_cos\_service\_credentials). bucket\_region: string, COS bucket region | <pre>object({<br/> bucket_name = string<br/> bucket_access = string<br/> bucket_region = string<br/> })</pre> | <pre>{<br/> "bucket_access": "",<br/> "bucket_name": "",<br/> "bucket_region": ""<br/>}</pre> | no |

modules/powervs-vpc-landing-zone/locals.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ locals {
2626
"us-east" = "us-east"
2727
"wdc06" = "us-east"
2828
"wdc07" = "us-east"
29+
"che02" = "in-che"
30+
"che03" = "in-che"
2931
}
3032

3133
ibm_powervs_availability_zone_map = {
@@ -51,6 +53,8 @@ locals {
5153
"us-east" = "zone-1"
5254
"wdc06" = "zone-2"
5355
"wdc07" = "zone-3"
56+
"che02" = "zone-2"
57+
"che03" = "zone-3"
5458
}
5559
availability_zone = lookup(local.ibm_powervs_availability_zone_map, var.powervs_zone, null) # "zone-n"
5660
availability_zone_number = substr(local.availability_zone, -1, 1) # "n"

modules/powervs-vpc-landing-zone/presets/slz-preset.json.tftpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@
804804
{
805805
"name": "jump-box",
806806
"image_name": "${rhel_image}",
807-
"machine_type": "cx2-2x4",
807+
"machine_type": "cxf-2x4",
808808
"vpc_name": "edge",
809809
"resource_group": "${second_rg_name}",
810810
"enable_floating_ip": true,
@@ -842,7 +842,7 @@
842842
{
843843
"name": "monitoring",
844844
"image_name": "${sles_image}",
845-
"machine_type": "bx2-2x8",
845+
"machine_type": "cxf-2x4",
846846
"vpc_name": "edge",
847847
"resource_group": "${second_rg_name}",
848848
"enable_floating_ip": false,

modules/powervs-vpc-landing-zone/scc-wp.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ module "configure_scc_wp_agent" {
6767
playbook_template_vars = {
6868
COLLECTOR_ENDPOINT : local.scc_wp_instance.ingestion_endpoint,
6969
API_ENDPOINT : local.scc_wp_instance.api_endpoint,
70-
ACCESS_KEY : local.scc_wp_instance.access_key
70+
ACCESS_KEY : local.scc_wp_instance.access_key,
71+
PROXY_SERVER : "${local.network_services_vsi_ip}:${local.network_services_config.squid.squid_port}"
7172
}
7273
src_inventory_template_name = "inventory.tftpl"
7374
dst_inventory_file_name = "${var.prefix}-scc-wp-inventory"

modules/powervs-vpc-landing-zone/submodules/ansible/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ No modules.
3939
| <a name="input_src_playbook_template_name"></a> [src\_playbook\_template\_name](#input\_src\_playbook\_template\_name) | Name of the playbook template file located within the 'templates-ansible' directory. | `string` | n/a | yes |
4040
| <a name="input_src_script_template_name"></a> [src\_script\_template\_name](#input\_src\_script\_template\_name) | Name of the bash script template file located within the 'templates-ansible' directory. | `string` | n/a | yes |
4141
| <a name="input_ssh_private_key"></a> [ssh\_private\_key](#input\_ssh\_private\_key) | Private SSH key used to login to jump/bastion server, also the ansible host and all the hosts on which tasks will be executed. This key will be written temporarily on ansible host and deleted after execution. | `string` | n/a | yes |
42+
| <a name="input_target_type"></a> [target\_type](#input\_target\_type) | Type of target hosts: 'vpc' for VPC VSIs (use vpcuser), 'powervs' for PowerVS instances (use root) | `string` | `"vpc"` | no |
4243

4344
### Outputs
4445

modules/powervs-vpc-landing-zone/submodules/ansible/ansible_node_packages.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# This bash script performs #
55
# - installation of packages #
66
# - ansible galaxy collections. #
7+
# Note: This script is executed with sudo privileges #
78
# #
89
############################################################
910

@@ -101,7 +102,13 @@ main::install_packages() {
101102
done
102103
done
103104

104-
ansible-galaxy collection install -r '/root/.ansible/collections/ansible_collections/ibm/power_linux_sap/requirements.yml' --upgrade
105+
# Use the actual user's home directory for ansible collections
106+
ANSIBLE_USER_HOME=$(getent passwd "${SUDO_USER:-$USER}" | cut -d: -f6)
107+
if [ -f "${ANSIBLE_USER_HOME}/.ansible/collections/ansible_collections/ibm/power_linux_sap/requirements.yml" ]; then
108+
ansible-galaxy collection install -r "${ANSIBLE_USER_HOME}/.ansible/collections/ansible_collections/ibm/power_linux_sap/requirements.yml" --upgrade
109+
elif [ -f '/root/.ansible/collections/ansible_collections/ibm/power_linux_sap/requirements.yml' ]; then
110+
ansible-galaxy collection install -r '/root/.ansible/collections/ansible_collections/ibm/power_linux_sap/requirements.yml' --upgrade
111+
fi
105112
main::log_info "All packages installed successfully"
106113
fi
107114

modules/powervs-vpc-landing-zone/submodules/ansible/main.tf

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
locals {
22
src_ansible_templates_dir = "${path.module}/templates-ansible"
33
ansible_node_config_script = "${path.module}/ansible_node_packages.sh"
4-
dst_files_dir = "/root/terraform_files"
4+
dst_files_dir = "/home/vpcuser/terraform_files"
55

66
src_script_tftpl_path = "${local.src_ansible_templates_dir}/${var.src_script_template_name}"
77
dst_script_file_path = "${local.dst_files_dir}/${var.dst_script_file_name}"
@@ -17,7 +17,7 @@ resource "random_id" "filename" {
1717
}
1818

1919
locals {
20-
private_key_file = "/root/.ssh/id_rsa_${substr(random_id.filename.b64_url, 0, 4)}"
20+
private_key_file = "/home/vpcuser/.ssh/id_rsa_${substr(random_id.filename.b64_url, 0, 4)}"
2121
}
2222
##############################################################
2323
# 1. Execute shell script to install ansible roles/collections
@@ -28,7 +28,7 @@ resource "terraform_data" "setup_ansible_host" {
2828

2929
connection {
3030
type = "ssh"
31-
user = "root"
31+
user = "vpcuser"
3232
bastion_host = var.bastion_host_ip
3333
host = var.ansible_host_or_ip
3434
private_key = var.ssh_private_key
@@ -38,7 +38,7 @@ resource "terraform_data" "setup_ansible_host" {
3838

3939
# Create terraform scripts directory
4040
provisioner "remote-exec" {
41-
inline = ["mkdir -p ${local.dst_files_dir}", "chmod 777 ${local.dst_files_dir}", ]
41+
inline = ["sudo mkdir -p ${local.dst_files_dir}", "sudo chmod 777 ${local.dst_files_dir}", ]
4242
}
4343

4444
# Copy ansible_node_packages.sh shell file to ansible host
@@ -50,8 +50,8 @@ resource "terraform_data" "setup_ansible_host" {
5050
# Execute ansible_node_packages.sh shell script to configure ansible host
5151
provisioner "remote-exec" {
5252
inline = [
53-
"chmod +x ${local.dst_files_dir}/ansible_node_packages.sh",
54-
"${local.dst_files_dir}/ansible_node_packages.sh",
53+
"sudo chmod +x ${local.dst_files_dir}/ansible_node_packages.sh",
54+
"sudo ${local.dst_files_dir}/ansible_node_packages.sh",
5555
]
5656
}
5757
}
@@ -70,7 +70,7 @@ resource "terraform_data" "execute_playbooks" {
7070

7171
connection {
7272
type = "ssh"
73-
user = "root"
73+
user = "vpcuser"
7474
bastion_host = var.bastion_host_ip
7575
host = var.ansible_host_or_ip
7676
private_key = var.ssh_private_key
@@ -82,7 +82,7 @@ resource "terraform_data" "execute_playbooks" {
8282

8383
# Create terraform scripts directory
8484
provisioner "remote-exec" {
85-
inline = ["mkdir -p ${local.dst_files_dir}", "chmod 777 ${local.dst_files_dir}", ]
85+
inline = ["sudo mkdir -p ${local.dst_files_dir}", "sudo chmod 777 ${local.dst_files_dir}", ]
8686
}
8787

8888
# Copy and create ansible playbook template file on ansible host
@@ -93,7 +93,7 @@ resource "terraform_data" "execute_playbooks" {
9393

9494
# Copy and create ansible inventory template file on ansible host
9595
provisioner "file" {
96-
content = templatefile(local.src_inventory_tftpl_path, var.inventory_template_vars)
96+
content = templatefile(local.src_inventory_tftpl_path, merge(var.inventory_template_vars, { target_type = var.target_type }))
9797
destination = local.dst_inventory_file_path
9898
}
9999

@@ -112,8 +112,8 @@ resource "terraform_data" "execute_playbooks" {
112112
# Write ssh user's ssh private key
113113
provisioner "remote-exec" {
114114
inline = [
115-
"mkdir -p /root/.ssh/",
116-
"chmod 700 /root/.ssh",
115+
"mkdir -p /home/vpcuser/.ssh/",
116+
"chmod 700 /home/vpcuser/.ssh",
117117
"echo '${var.ssh_private_key}' > ${local.private_key_file}",
118118
"chmod 600 ${local.private_key_file}",
119119
]
@@ -122,15 +122,15 @@ resource "terraform_data" "execute_playbooks" {
122122
# Execute bash shell script to run ansible playbooks
123123
provisioner "remote-exec" {
124124
inline = [
125-
"chmod +x ${local.dst_script_file_path}",
126-
local.dst_script_file_path,
125+
"sudo chmod +x ${local.dst_script_file_path}",
126+
"sudo ${local.dst_script_file_path}",
127127
]
128128
}
129129

130130
# Again delete private ssh key
131131
provisioner "remote-exec" {
132132
inline = [
133-
"rm -rf ${local.private_key_file}"
133+
"sudo rm -rf ${local.private_key_file}"
134134
]
135135
}
136136
}
@@ -141,7 +141,7 @@ resource "terraform_data" "execute_playbooks_with_vault" {
141141

142142
connection {
143143
type = "ssh"
144-
user = "root"
144+
user = "vpcuser"
145145
bastion_host = var.bastion_host_ip
146146
host = var.ansible_host_or_ip
147147
private_key = var.ssh_private_key
@@ -153,13 +153,14 @@ resource "terraform_data" "execute_playbooks_with_vault" {
153153

154154
# Create terraform scripts directory
155155
provisioner "remote-exec" {
156-
inline = ["mkdir -p ${local.dst_files_dir}", "chmod 777 ${local.dst_files_dir}", ]
156+
inline = ["sudo mkdir -p ${local.dst_files_dir}", "sudo chmod 777 ${local.dst_files_dir}", ]
157157
}
158158

159159
# Copy and create ansible playbook template file on ansible host
160160
provisioner "file" {
161161
content = templatefile(local.src_playbook_tftpl_path, var.playbook_template_vars)
162162
destination = local.dst_playbook_file_path
163+
163164
}
164165

165166
######### Encrypting the ansible playbook file with sensitive information using ansible vault #########
@@ -172,7 +173,7 @@ resource "terraform_data" "execute_playbooks_with_vault" {
172173

173174
# Copy and create ansible inventory template file on ansible host
174175
provisioner "file" {
175-
content = templatefile(local.src_inventory_tftpl_path, var.inventory_template_vars)
176+
content = templatefile(local.src_inventory_tftpl_path, merge(var.inventory_template_vars, { target_type = var.target_type }))
176177
destination = local.dst_inventory_file_path
177178
}
178179

@@ -191,8 +192,8 @@ resource "terraform_data" "execute_playbooks_with_vault" {
191192
# Write ssh user's ssh private key
192193
provisioner "remote-exec" {
193194
inline = [
194-
"mkdir -p /root/.ssh/",
195-
"chmod 700 /root/.ssh",
195+
"mkdir -p /home/vpcuser/.ssh/",
196+
"chmod 700 /home/vpcuser/.ssh",
196197
"echo '${var.ssh_private_key}' > ${local.private_key_file}",
197198
"chmod 600 ${local.private_key_file}",
198199
]
@@ -201,8 +202,8 @@ resource "terraform_data" "execute_playbooks_with_vault" {
201202
# Execute bash shell script to run ansible playbooks
202203
provisioner "remote-exec" {
203204
inline = [
204-
"chmod +x ${local.dst_script_file_path}",
205-
local.dst_script_file_path,
205+
"sudo chmod +x ${local.dst_script_file_path}",
206+
"sudo ${local.dst_script_file_path}",
206207
]
207208
}
208209

@@ -215,9 +216,3 @@ resource "terraform_data" "execute_playbooks_with_vault" {
215216
]
216217
}
217218
}
218-
219-
220-
moved {
221-
from = terraform_data.setup_ansible_host
222-
to = terraform_data.setup_ansible_host[0]
223-
}

0 commit comments

Comments
 (0)