Skip to content

Commit f9aa597

Browse files
authored
Merge pull request #48 from sap-linuxlab/dev
prepare for 1.1.0
2 parents 4c5049b + 4d54b6b commit f9aa597

File tree

49 files changed

+1423
-481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1423
-481
lines changed

.github/workflows/terraform_ansible_software_availability.yml

Lines changed: 254 additions & 254 deletions
Large diffs are not rendered by default.

.github/workflows/terraform_validate.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ jobs:
1818
fail-fast: false
1919
max-parallel: 10
2020
matrix:
21-
terraform_ver: [~1.0.0, ~1.1.0, ~1.2.0, ~1.3.0, ~1.4.0, =1.5.5]
21+
# terraform_ver: [~1.0.0, ~1.1.0, ~1.2.0, ~1.3.0, ~1.4.0, =1.5.5]
22+
terraform_ver: [=1.5.5]
2223
terraform_module_parent: [all, aws_ec2_instance, gcp_ce_vm, ibmcloud_vs, ibmcloud_powervs, ibmpowervc, msazure_vm, vmware_vm]
2324
steps:
2425
- name: Checkout
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
# Use path object to store key files temporarily in module of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info
3+
resource "local_file" "ansible_extravars" {
4+
filename = "${path.root}/tmp/ansible_extravars_generated.yml"
5+
file_permission = "0755"
6+
content = <<EOF
7+
8+
#### Instructions for using existing_hosts ####
9+
10+
# When existing_hosts are used, execution of provisioning role sap_vm_provision will be skipped.
11+
# This results in the need to define additional variables below, e.g. sap_general_preconfigure_domain.
12+
13+
# Ansible Role sap_storage_setup will be searching for block devices based on their definition in storage_definition
14+
# under sap_vm_provision_existing_hosts_host_specifications_dictionary. These devices must not be partitioned!
15+
16+
####
17+
18+
# Existing Hosts - ensure Domain is set
19+
sap_general_preconfigure_modify_etc_hosts: true
20+
sap_general_preconfigure_domain: "${var.module_var_dns_root_domain}"
21+
22+
# Import host specification dictionary from Terraform Template
23+
# Convert 'disk_count' key (logical name for provisioning X disks) to 'lvm_lv_stripes' expected by sap_storage_setup Ansible Role
24+
# Remove 'disk_type' key (for provisioning disks) which is not expected by sap_storage_setup Ansible Role
25+
# Then convert JSON payload from Terraform to Python Dictionary type using from_json built-in function
26+
sap_vm_provision_existing_hosts_host_specifications_dictionary: "{{ '${ local.generate_host_specifications }' | from_json }}"
27+
28+
# Ansible Role sap_storage_setup variable assignment per host
29+
sap_storage_setup_definition:
30+
"{{ sap_vm_provision_existing_hosts_host_specifications_dictionary[sap_vm_provision_host_specification_plan]
31+
[inventory_hostname_short].storage_definition }}"
32+
${ strcontains(var.module_var_ansible_sap_scenario_selection, "sandbox") ? "# Ansible Role sap_storage_setup variable assignment if Sandbox. Override any System ID (SID) value stored in the host specifications dictionary" : "" }
33+
${ strcontains(var.module_var_ansible_sap_scenario_selection, "sandbox") ? format("sap_storage_setup_sid: \"%s\"",var.module_var_ansible_sap_system_sid) : "" }
34+
35+
# Ansible Playbooks for SAP - multiple hosts
36+
sap_vm_provision_ssh_host_private_key_file_path: "${abspath(path.root)}/tmp/hosts_rsa"
37+
38+
${ strcontains(var.module_var_ansible_sap_scenario_selection, "hana") ? "# Ansible Playbooks for SAP - SAP HANA variables when multiple hosts (HA or Scale-Out)" : "" }
39+
${ strcontains(var.module_var_ansible_sap_scenario_selection, "hana") ? "sap_hana_install_update_firewall: true" : "" }
40+
41+
EOF
42+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
# Use path object to store key files temporarily in module of execution - https://www.terraform.io/docs/language/expressions/references.html#filesystem-and-workspace-info
3+
resource "local_file" "ansible_inventory" {
4+
filename = "${path.root}/tmp/ansible_inventory.ini"
5+
file_permission = "0755"
6+
content = <<EOF
7+
# Ansible Inventory Group names must match Ansible Playbooks for SAP - hana_primary, hana_secondary, anydb_primary, anydb_secondary, nwas_ascs, nwas_ers, nwas_pas, nwas_aas
8+
9+
[hana_primary]
10+
${ join(", ", [ for k1 in [for k2,v2 in var.module_var_host_specifications[var.module_var_host_specification_plan] : k2 if v2.sap_host_type == "hana_primary"] : format("%s ansible_host=%s ansible_connection=ssh ansible_user=root",k1,var.module_var_host_provision_outputs[k1].output_host_private_ip) ] ) }
11+
12+
[hana_secondary]
13+
${ join(", ", [ for k1 in [for k2,v2 in var.module_var_host_specifications[var.module_var_host_specification_plan] : k2 if v2.sap_host_type == "hana_secondary"] : format("%s ansible_host=%s ansible_connection=ssh ansible_user=root",k1,var.module_var_host_provision_outputs[k1].output_host_private_ip) ] ) }
14+
15+
[nwas_ascs]
16+
${ join(", ", [ for k1 in [for k2,v2 in var.module_var_host_specifications[var.module_var_host_specification_plan] : k2 if v2.sap_host_type == "nwas_ascs"] : format("%s ansible_host=%s ansible_connection=ssh ansible_user=root",k1,var.module_var_host_provision_outputs[k1].output_host_private_ip) ] ) }
17+
18+
[nwas_ers]
19+
${ join(", ", [ for k1 in [for k2,v2 in var.module_var_host_specifications[var.module_var_host_specification_plan] : k2 if v2.sap_host_type == "nwas_ers"] : format("%s ansible_host=%s ansible_connection=ssh ansible_user=root",k1,var.module_var_host_provision_outputs[k1].output_host_private_ip) ] ) }
20+
21+
[nwas_pas]
22+
${ join(", ", [ for k1 in [for k2,v2 in var.module_var_host_specifications[var.module_var_host_specification_plan] : k2 if v2.sap_host_type == "nwas_pas"] : format("%s ansible_host=%s ansible_connection=ssh ansible_user=root",k1,var.module_var_host_provision_outputs[k1].output_host_private_ip) ] ) }
23+
24+
[nwas_aas]
25+
${ join(", ", [ for k1 in [for k2,v2 in var.module_var_host_specifications[var.module_var_host_specification_plan] : k2 if v2.sap_host_type == "nwas_aas"] : format("%s ansible_host=%s ansible_connection=ssh ansible_user=root",k1,var.module_var_host_provision_outputs[k1].output_host_private_ip) ] ) }
26+
27+
[anydb_primary]
28+
${ join(", ", [ for k1 in [for k2,v2 in var.module_var_host_specifications[var.module_var_host_specification_plan] : k2 if v2.sap_host_type == "anydb_primary"] : format("%s ansible_host=%s ansible_connection=ssh ansible_user=root",k1,var.module_var_host_provision_outputs[k1].output_host_private_ip) ] ) }
29+
30+
[anydb_secondary]
31+
${ join(", ", [ for k1 in [for k2,v2 in var.module_var_host_specifications[var.module_var_host_specification_plan] : k2 if v2.sap_host_type == "anydb_secondary"] : format("%s ansible_host=%s ansible_connection=ssh ansible_user=root",k1,var.module_var_host_provision_outputs[k1].output_host_private_ip) ] ) }
32+
33+
EOF
34+
}

0 commit comments

Comments
 (0)