Skip to content

Commit 9eb4888

Browse files
refactor: fix catalog json, reorg vars, remove dns var, invalid count for ansible (#875)
* refactor: vars * chore: fix catalog json display name * fix: hana and nw name * fix: ansible null to empty string for default
1 parent 2a7d7e1 commit 9eb4888

File tree

11 files changed

+262
-203
lines changed

11 files changed

+262
-203
lines changed

.secrets.baseline

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -107,26 +107,6 @@
107107
"verified_result": null
108108
}
109109
],
110-
"solutions/sap-ready-to-go/README.md": [
111-
{
112-
"hashed_secret": "2254481e1661d8f017a712b0d1ad9a14fd9460a3",
113-
"is_secret": false,
114-
"is_verified": false,
115-
"line_number": 60,
116-
"type": "Secret Keyword",
117-
"verified_result": null
118-
}
119-
],
120-
"solutions/sap-ready-to-go/input.tfvars": [
121-
{
122-
"hashed_secret": "4d82fc4e8ef3a90cebdf3a1fc0e4abab79a41391",
123-
"is_secret": false,
124-
"is_verified": false,
125-
"line_number": 18,
126-
"type": "Secret Keyword",
127-
"verified_result": null
128-
}
129-
],
130110
"tests/pr_test.go": [
131111
{
132112
"hashed_secret": "c7c6508b19455e3e8040e60e9833fbede92e5d8e",

ibm_catalog.json

Lines changed: 139 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -49,40 +49,13 @@
4949
{
5050
"label": "SAP ready PowerVS",
5151
"name": "sap-ready-to-go",
52-
"install_type": "extension",
52+
"install_type": "fullstack",
5353
"working_directory": "solutions/ibm-catalog/sap-ready-to-go",
5454
"compliance": {
5555
"authority": "",
5656
"profiles": []
5757
},
58-
"dependencies": [
59-
{
60-
"flavors": [
61-
"standard",
62-
"standard-extend"
63-
],
64-
"id": "2dd486c7-b317-4aaa-907b-42671485ad96-global",
65-
"name": "deploy-arch-ibm-pvs-inf",
66-
"install_type": "fullstack",
67-
"optional": true,
68-
"version": ">=8.0.0"
69-
}
70-
],
7158
"configuration": [
72-
{
73-
"key": "prerequisite_workspace_id",
74-
"required": true,
75-
"custom_config": {
76-
"config_constraints": {
77-
"catalogID": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc",
78-
"offeringID": "2dd486c7-b317-4aaa-907b-42671485ad96-global",
79-
"versionConstraint": ">=8.0.0"
80-
},
81-
"grouping": "deployment",
82-
"original_grouping": "deployment",
83-
"type": "schematics_workspace"
84-
}
85-
},
8659
{
8760
"key": "powervs_zone",
8861
"type": "string",
@@ -164,6 +137,19 @@
164137
],
165138
"custom_config": {}
166139
},
140+
{
141+
"key": "powervs_resource_group_name",
142+
"required": true,
143+
"default_value": "",
144+
"custom_config": {
145+
"config_constraints": {
146+
"identifier": "rg_name"
147+
},
148+
"grouping": "deployment",
149+
"original_grouping": "deployment",
150+
"type": "resource_group"
151+
}
152+
},
167153
{
168154
"key": "prefix",
169155
"required": true,
@@ -202,6 +188,26 @@
202188
"key": "powervs_netweaver_memory_size",
203189
"required": true
204190
},
191+
{
192+
"key": "external_access_ip",
193+
"default_value": "__NULL__",
194+
"required": true
195+
},
196+
{
197+
"key": "powervs_sap_network_cidr",
198+
"required": true
199+
},
200+
{
201+
"key": "ssh_public_key",
202+
"type": "multiline_secure_value",
203+
"display_name": "ssh_public_key",
204+
"required": true,
205+
"custom_config": {
206+
"grouping": "deployment",
207+
"original_grouping": "deployment",
208+
"type": "multiline_secure_value"
209+
}
210+
},
205211
{
206212
"key": "ssh_private_key",
207213
"type": "multiline_secure_value",
@@ -225,20 +231,36 @@
225231
}
226232
},
227233
{
228-
"key": "sap_domain"
234+
"key": "client_to_site_vpn",
235+
"required": true
229236
},
230237
{
231-
"key": "nfs_directory",
232-
"hidden": true
238+
"key": "sap_domain",
239+
"required": true
233240
},
234241
{
235-
"key": "powervs_sap_network_cidr"
242+
"key": "enable_monitoring",
243+
"required": true
236244
},
237245
{
238-
"key": "powervs_hana_instance_name"
246+
"key": "enable_scc_wp",
247+
"required": true
239248
},
240249
{
241-
"key": "powervs_netweaver_instance_name"
250+
"key": "nfs_server_config",
251+
"required": true
252+
},
253+
{
254+
"key": "ansible_vault_password",
255+
"type": "multiline_secure_value",
256+
"required": true,
257+
"default_value": "__NULL__",
258+
"display_name": "ansible_vault_password",
259+
"custom_config": {
260+
"grouping": "deployment",
261+
"original_grouping": "deployment",
262+
"type": "multiline_secure_value"
263+
}
242264
},
243265
{
244266
"key": "powervs_hana_instance_custom_storage_config",
@@ -264,6 +286,14 @@
264286
"type": "code_editor"
265287
}
266288
},
289+
{
290+
"key": "vpc_intel_images",
291+
"custom_config": {
292+
"grouping": "deployment",
293+
"original_grouping": "deployment",
294+
"type": "code_editor"
295+
}
296+
},
267297
{
268298
"key": "powervs_default_sap_images",
269299
"custom_config": {
@@ -286,37 +316,100 @@
286316
}
287317
},
288318
{
289-
"key": "ansible_vault_password",
319+
"key": "powervs_custom_images",
320+
"custom_config": {
321+
"grouping": "deployment",
322+
"original_grouping": "deployment",
323+
"type": "code_editor"
324+
}
325+
},
326+
{
327+
"key": "powervs_custom_image_cos_configuration",
328+
"custom_config": {
329+
"grouping": "deployment",
330+
"original_grouping": "deployment",
331+
"type": "code_editor"
332+
}
333+
},
334+
{
335+
"key": "powervs_custom_image_cos_service_credentials",
290336
"type": "multiline_secure_value",
291-
"display_name": "ansible_vault_password",
292337
"custom_config": {
293338
"grouping": "deployment",
294339
"original_grouping": "deployment",
295340
"type": "multiline_secure_value"
296341
}
297-
}
298-
],
299-
"outputs": [
342+
},
300343
{
301-
"key": "infrastructure_data"
344+
"key": "tags",
345+
"custom_config": {
346+
"grouping": "deployment",
347+
"original_grouping": "deployment",
348+
"type": "code_editor"
349+
}
302350
},
303351
{
304-
"key": "access_host_or_ip"
352+
"key": "existing_monitoring_instance_crn"
305353
},
306354
{
307-
"key": "powervs_hana_instance_ips"
355+
"key": "sm_service_plan"
308356
},
309357
{
310-
"key": "powervs_hana_instance_management_ip"
358+
"key": "existing_sm_instance_guid"
311359
},
312360
{
313-
"key": "powervs_netweaver_instance_ips"
361+
"key": "existing_sm_instance_region",
362+
"type": "string",
363+
"default_value": "__NULL__",
364+
"options": [
365+
{
366+
"displayname": "Null",
367+
"value": "__NULL__"
368+
},
369+
{
370+
"displayname": "au-syd",
371+
"value": "au-syd"
372+
},
373+
{
374+
"displayname": "br-sao",
375+
"value": "br-sao"
376+
},
377+
{
378+
"displayname": "ca-tor",
379+
"value": "ca-tor"
380+
},
381+
{
382+
"displayname": "eu-de",
383+
"value": "eu-de"
384+
},
385+
{
386+
"displayname": "eu-gb",
387+
"value": "eu-gb"
388+
},
389+
{
390+
"displayname": "jp-osa",
391+
"value": "jp-osa"
392+
},
393+
{
394+
"displayname": "jp-tok",
395+
"value": "jp-tok"
396+
},
397+
{
398+
"displayname": "us-east",
399+
"value": "us-east"
400+
},
401+
{
402+
"displayname": "us-south",
403+
"value": "us-south"
404+
}
405+
],
406+
"custom_config": {}
314407
},
315408
{
316-
"key": "powervs_netweaver_instance_management_ips"
409+
"key": "powervs_management_network"
317410
},
318411
{
319-
"key": "powervs_lpars_data"
412+
"key": "powervs_backup_network"
320413
}
321414
],
322415
"iam_permissions": [

modules/ansible/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ resource "terraform_data" "trigger_ansible_vars" {
6767

6868
resource "terraform_data" "execute_playbooks" {
6969
depends_on = [terraform_data.setup_ansible_host]
70-
count = var.ansible_vault_password != null ? 0 : 1
70+
count = var.ansible_vault_password != "" ? 0 : 1
7171

7272
connection {
7373
type = "ssh"
@@ -138,7 +138,7 @@ resource "terraform_data" "execute_playbooks" {
138138

139139
resource "terraform_data" "execute_playbooks_with_vault" {
140140
depends_on = [terraform_data.setup_ansible_host]
141-
count = var.ansible_vault_password != null ? 1 : 0
141+
count = var.ansible_vault_password != "" ? 1 : 0
142142

143143
connection {
144144
type = "ssh"

modules/ansible/variables.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,29 +63,29 @@ variable "ansible_vault_password" {
6363
description = "Vault password to encrypt ansible variable file for SAP installation. Password requirements: 15-100 characters and at least one uppercase letter, one lowercase letter, one number, and one special character. Allowed characters: A-Z, a-z, 0-9, !#$%&()*+-.:;<=>?@[]_{|}~."
6464
type = string
6565
sensitive = true
66-
default = null
66+
default = ""
6767
validation {
68-
condition = var.ansible_vault_password == null ? true : (length(var.ansible_vault_password) >= 15 && length(var.ansible_vault_password) <= 100)
68+
condition = var.ansible_vault_password == "" ? true : (length(var.ansible_vault_password) >= 15 && length(var.ansible_vault_password) <= 100)
6969
error_message = "ansible_vault_password needs to be between 15 and 100 characters in length."
7070
}
7171
validation {
72-
condition = var.ansible_vault_password == null ? true : can(regex("[A-Z]", var.ansible_vault_password))
72+
condition = var.ansible_vault_password == "" ? true : can(regex("[A-Z]", var.ansible_vault_password))
7373
error_message = "ansible_vault_password needs to contain at least one uppercase character (A-Z)."
7474
}
7575
validation {
76-
condition = var.ansible_vault_password == null ? true : can(regex("[a-z]", var.ansible_vault_password))
76+
condition = var.ansible_vault_password == "" ? true : can(regex("[a-z]", var.ansible_vault_password))
7777
error_message = "ansible_vault_password needs to contain at least one lowercase character (a-z)."
7878
}
7979
validation {
80-
condition = var.ansible_vault_password == null ? true : can(regex("[0-9]", var.ansible_vault_password))
80+
condition = var.ansible_vault_password == "" ? true : can(regex("[0-9]", var.ansible_vault_password))
8181
error_message = "ansible_vault_password needs to contain at least one number (0-9)."
8282
}
8383
validation {
84-
condition = var.ansible_vault_password == null ? true : can(regex("[!#$%&()*+\\-.:;<=>?@[\\]_{|}~]", var.ansible_vault_password))
84+
condition = var.ansible_vault_password == "" ? true : can(regex("[!#$%&()*+\\-.:;<=>?@[\\]_{|}~]", var.ansible_vault_password))
8585
error_message = "ansible_vault_password needs to contain at least one of the following special characters: !#$%&()*+-.:;<=>?@[]_{|}~"
8686
}
8787
validation {
88-
condition = var.ansible_vault_password == null ? true : can(regex("^[A-Za-z0-9!#$%&()*+\\-.:;<=>?@[\\]_{|}~]+$", var.ansible_vault_password))
88+
condition = var.ansible_vault_password == "" ? true : can(regex("^[A-Za-z0-9!#$%&()*+\\-.:;<=>?@[\\]_{|}~]+$", var.ansible_vault_password))
8989
error_message = "ansible_vault_password contains illegal characters. Allowed characters: A-Z, a-z, 0-9, !#$%&()*+-.:;<=>?@[]_{|}~"
9090
}
9191
}

modules/pi-sap-system-type1/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ The Power Virtual Server for SAP module automates the following tasks:
3232
| <a name="module_ansible_pi_netweaver_secondary_instances_sapmnt_mount"></a> [ansible\_pi\_netweaver\_secondary\_instances\_sapmnt\_mount](#module\_ansible\_pi\_netweaver\_secondary\_instances\_sapmnt\_mount) | ../ansible | n/a |
3333
| <a name="module_ansible_sap_instance_init"></a> [ansible\_sap\_instance\_init](#module\_ansible\_sap\_instance\_init) | ../ansible | n/a |
3434
| <a name="module_configure_scc_wp_agent"></a> [configure\_scc\_wp\_agent](#module\_configure\_scc\_wp\_agent) | ../ansible | n/a |
35-
| <a name="module_pi_hana_instance"></a> [pi\_hana\_instance](#module\_pi\_hana\_instance) | terraform-ibm-modules/powervs-instance/ibm | 2.7.0 |
35+
| <a name="module_pi_hana_instance"></a> [pi\_hana\_instance](#module\_pi\_hana\_instance) | terraform-ibm-modules/powervs-instance/ibm | 2.8.0 |
3636
| <a name="module_pi_hana_storage_calculation"></a> [pi\_hana\_storage\_calculation](#module\_pi\_hana\_storage\_calculation) | ../pi-hana-storage-config | n/a |
37-
| <a name="module_pi_netweaver_primary_instance"></a> [pi\_netweaver\_primary\_instance](#module\_pi\_netweaver\_primary\_instance) | terraform-ibm-modules/powervs-instance/ibm | 2.7.0 |
38-
| <a name="module_pi_netweaver_secondary_instances"></a> [pi\_netweaver\_secondary\_instances](#module\_pi\_netweaver\_secondary\_instances) | terraform-ibm-modules/powervs-instance/ibm | 2.7.0 |
37+
| <a name="module_pi_netweaver_primary_instance"></a> [pi\_netweaver\_primary\_instance](#module\_pi\_netweaver\_primary\_instance) | terraform-ibm-modules/powervs-instance/ibm | 2.8.0 |
38+
| <a name="module_pi_netweaver_secondary_instances"></a> [pi\_netweaver\_secondary\_instances](#module\_pi\_netweaver\_secondary\_instances) | terraform-ibm-modules/powervs-instance/ibm | 2.8.0 |
3939

4040
### Resources
4141

@@ -48,7 +48,7 @@ The Power Virtual Server for SAP module automates the following tasks:
4848

4949
| Name | Description | Type | Default | Required |
5050
|------|-------------|------|---------|:--------:|
51-
| <a name="input_ansible_vault_password"></a> [ansible\_vault\_password](#input\_ansible\_vault\_password) | Vault password to encrypt OS registration parameters. Only required with customer provided linux subscription (pi\_os\_registration). Password requirements: 15-100 characters and at least one uppercase letter, one lowercase letter, one number, and one special character. Allowed characters: A-Z, a-z, 0-9, !#$%&()*+-.:;<=>?@[]\_{\|}~. | `string` | `null` | no |
51+
| <a name="input_ansible_vault_password"></a> [ansible\_vault\_password](#input\_ansible\_vault\_password) | Vault password to encrypt OS registration parameters. Only required with customer provided linux subscription (pi\_os\_registration). Password requirements: 15-100 characters and at least one uppercase letter, one lowercase letter, one number, and one special character. Allowed characters: A-Z, a-z, 0-9, !#$%&()*+-.:;<=>?@[]\_{\|}~. | `string` | `""` | no |
5252
| <a name="input_pi_hana_instance"></a> [pi\_hana\_instance](#input\_pi\_hana\_instance) | PowerVS SAP HANA instance hostname (non FQDN). Will get the form of <var.prefix>-<var.pi\_hana\_instance.name>. Max length of final hostname must be <= 13 characters.'sap\_profile\_id' Must be one of the supported profiles. See [here](https://cloud.ibm.com/docs/sap?topic=sap-hana-iaas-offerings-profiles-power-vs). File system sizes are automatically calculated. Override automatic calculation by setting values in optional 'pi\_hana\_instance\_custom\_storage\_config' parameter. 'additional\_storage\_config' additional File systems to be created and attached to PowerVS SAP HANA instance. 'size' is in GB. 'count' specify over how many storage volumes the file system will be striped. 'tier' specifies the storage tier in PowerVS workspace. 'mount' specifies the target mount point on OS. | <pre>object({<br/> name = string<br/> image_id = string<br/> sap_profile_id = string<br/> additional_storage_config = list(object({<br/> name = string<br/> size = string<br/> count = string<br/> tier = string<br/> mount = string<br/> }))<br/> })</pre> | <pre>{<br/> "additional_storage_config": [<br/> {<br/> "count": "1",<br/> "mount": "/usr/sap",<br/> "name": "usrsap",<br/> "size": "50",<br/> "tier": "tier3"<br/> }<br/> ],<br/> "image_id": "insert_value_here",<br/> "name": "hana",<br/> "sap_profile_id": "ush1-4x256"<br/>}</pre> | no |
5353
| <a name="input_pi_hana_instance_custom_storage_config"></a> [pi\_hana\_instance\_custom\_storage\_config](#input\_pi\_hana\_instance\_custom\_storage\_config) | Custom file systems to be created and attached to PowerVS SAP HANA instance. 'size' is in GB. 'count' specify over how many storage volumes the file system will be striped. 'tier' specifies the storage tier in PowerVS workspace. 'mount' specifies the target mount point on OS. | <pre>list(object({<br/> name = string<br/> size = string<br/> count = string<br/> tier = string<br/> mount = string<br/> }))</pre> | <pre>[<br/> {<br/> "count": "",<br/> "mount": "",<br/> "name": "",<br/> "size": "",<br/> "tier": ""<br/> }<br/>]</pre> | no |
5454
| <a name="input_pi_instance_init_linux"></a> [pi\_instance\_init\_linux](#input\_pi\_instance\_init\_linux) | Configures a PowerVS linux instance to have internet access by setting proxy on it, updates os and create filesystems using ansible collection [ibm.power\_linux\_sap collection](https://galaxy.ansible.com/ui/repo/published/ibm/power_linux_sap/) where 'bastion\_host\_ip' is public IP of bastion/jump host to access the 'ansible\_host\_or\_ip' private IP of ansible node. This ansible host must have access to the power virtual server instance and ansible host OS must be RHEL distribution. | <pre>object(<br/> {<br/> enable = bool<br/> bastion_host_ip = string<br/> ansible_host_or_ip = string<br/> ssh_private_key = string<br/> custom_os_registration = optional(object({<br/> username = string<br/> password = string<br/> }))<br/> }<br/> )</pre> | n/a | yes |

modules/pi-sap-system-type1/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ variable "ansible_vault_password" {
4444

4545
type = string
4646
sensitive = true
47-
default = null
47+
default = ""
4848
}
4949

5050

0 commit comments

Comments
 (0)