-
Notifications
You must be signed in to change notification settings - Fork 2
/
integration.tf
92 lines (83 loc) · 3.16 KB
/
integration.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#### Ansible inventory.
resource "local_file" "ansible_inventory" {
depends_on = [ module.app-vsi ]
content = <<-DOC
all:
hosts:
db_host:
ansible_host: "${data.ibm_is_instance.db-vsi.primary_network_interface[0].primary_ip[0].address}"
app_host:
ansible_host: "${data.ibm_is_instance.app-vsi.primary_network_interface[0].primary_ip[0].address}"
DOC
filename = "ansible/inventory.yml"
}
# Export Terraform variable values to an Ansible var_file
resource "local_file" "app_ansible_javaci-vars" {
depends_on = [ module.db-vsi ]
content = <<-DOC
---
# Ansible vars_file containing variable values passed from Terraform.
# Generated by "terraform plan&apply" command.
# SAP system configuration
swap_disk_size: "${module.app-vsi.SWAP_DISK_SIZE}"
sap_sid: "${var.SAP_SID}"
app_profile: "${var.APP_PROFILE}"
sap_scs_instance_number: "${var.SAP_SCS_INSTANCE_NUMBER}"
sap_ci_instance_number: "${var.SAP_CI_INSTANCE_NUMBER}"
java_nodes: "${var.JAVA_NODES}"
java_product_instances: "${length(local.java_product_instances_lower) > 0 ? join(",", [for s in local.java_product_instances_lower : s]) : "" }"
sap_main_password: ${base64encode(var.SAP_MAIN_PASSWORD)}
# HANA config
hdb_host: "${module.db-vsi.PRIVATE-IP}"
hdb_sid: "${var.HANA_SID}"
hdb_instance_number: "${var.HANA_SYSNO}"
hana_tenant: "${var.HANA_TENANT}"
# SAP JAVA CI Installation kit path
kit_sapcar_file: "${var.KIT_SAPCAR_FILE}"
kit_swpm_file: "${var.KIT_SWPM_FILE}"
kit_sapexe_file: "${var.KIT_SAPEXE_FILE}"
kit_sapexedb_file: "${var.KIT_SAPEXEDB_FILE}"
kit_igsexe_file: "${var.KIT_IGSEXE_FILE}"
kit_igshelper_file: "${var.KIT_IGSHELPER_FILE}"
kit_saphostagent_file: "${var.KIT_SAPHOSTAGENT_FILE}"
kit_hdbclient_file: "${var.KIT_HDBCLIENT_FILE}"
kit_sapjvm_file: "${var.KIT_SAPJVM_FILE}"
kit_java_export_file: "${var.KIT_JAVA_EXPORT_FILE}"
...
DOC
filename = "ansible/javaci-vars.yml"
}
# Export Terraform variable values to an Ansible var_file
resource "local_file" "db_ansible_saphana-vars" {
depends_on = [ module.db-vsi ]
content = <<-DOC
---
# Ansible vars_file containing variable values passed from Terraform.
# Generated by "terraform plan&apply" command.
hana_profile: "${var.DB_PROFILE}"
# HANA DB configuration
hana_sid: "${var.HANA_SID}"
hana_sysno: "${var.HANA_SYSNO}"
hana_tenant: "${var.HANA_TENANT}"
sap_main_password: ${base64encode(var.SAP_MAIN_PASSWORD)}
hana_system_usage: "${var.HANA_SYSTEM_USAGE}"
hana_components: "${var.HANA_COMPONENTS}"
# SAP HANA Installation kit path
kit_saphana_file: "${var.KIT_SAPHANA_FILE}"
kit_sapcar_file: "${var.KIT_SAPCAR_FILE}"
...
DOC
filename = "ansible/saphana-vars.yml"
}
# Export Terraform variable values to an Ansible var_file for HANA server
resource "local_file" "tf_ansible_vars_generated_file_db" {
depends_on = [ module.db-vsi ]
source = "${path.root}/modules/db-vsi/files/hana_vm_volume_layout.json"
filename = "ansible/hana_vm_volume_layout.json"
}
# Export Terraform variable values to an Ansible var_file for APP Server
resource "local_file" "tf_ansible_vars_generated_file_app" {
depends_on = [ module.app-vsi ]
source = "${path.root}/modules/app-vsi/files/sapapp_vm_volume_layout.json"
filename = "ansible/sapapp_vm_volume_layout.json"
}