diff --git a/ansible/playbooks/sap-hana-cluster.yaml b/ansible/playbooks/sap-hana-cluster.yaml index 7db91116..452fb8b7 100644 --- a/ansible/playbooks/sap-hana-cluster.yaml +++ b/ansible/playbooks/sap-hana-cluster.yaml @@ -39,10 +39,6 @@ tasks: - - name: Include AWS variables - ansible.builtin.include_vars: ../../terraform/aws/aws_cluster_data.yaml - when: cloud_platform_is_aws - - name: Base Cluster Configuration [azure] ansible.builtin.include_tasks: ./tasks/azure-cluster-bootstrap.yaml when: cloud_platform_is_azure diff --git a/terraform/aws/aws_cluster_data.tftpl b/terraform/aws/aws_cluster_data.tftpl deleted file mode 100644 index 866132ad..00000000 --- a/terraform/aws/aws_cluster_data.tftpl +++ /dev/null @@ -1,3 +0,0 @@ -aws_route_table: ${routetable_id} -aws_cluster_ip: ${virtual_ip} - diff --git a/terraform/aws/inventory.tmpl b/terraform/aws/inventory.tmpl index 22d24042..e79bff76 100644 --- a/terraform/aws/inventory.tmpl +++ b/terraform/aws/inventory.tmpl @@ -1,6 +1,9 @@ all: vars: use_sbd: ${use_sbd} + aws_route_table: ${routetable_id} + aws_cluster_ip: ${virtual_ip} + aws_stonith_tag: ${stonith_tag} children: hana: hosts: diff --git a/terraform/aws/modules/hana_node/main.tf b/terraform/aws/modules/hana_node/main.tf index 77faea45..663b4049 100644 --- a/terraform/aws/modules/hana_node/main.tf +++ b/terraform/aws/modules/hana_node/main.tf @@ -3,6 +3,7 @@ locals { create_scale_out = var.hana_count > 1 && var.common_variables["hana"]["scale_out_enabled"] ? 1 : 0 create_ha_infra = var.hana_count > 1 && var.common_variables["hana"]["ha_enabled"] ? 1 : 0 hostname = var.common_variables["deployment_name_in_hostname"] ? format("%s-%s", var.common_variables["deployment_name"], var.name) : var.name + hana_stonith_tag = "${var.common_variables["deployment_name"]}-cluster" } # Network resources: subnets, routes, etc @@ -84,8 +85,8 @@ resource "aws_instance" "hana" { #} tags = { - Name = "${var.common_variables["deployment_name"]}-${var.name}${format("%02d", count.index + 1)}" - Workspace = var.common_variables["deployment_name"] - "${var.common_variables["deployment_name"]}-cluster" = "${var.name}${format("%02d", count.index + 1)}" + Name = "${var.common_variables["deployment_name"]}-${var.name}${format("%02d", count.index + 1)}" + Workspace = var.common_variables["deployment_name"] + "${local.hana_stonith_tag}" = "${var.name}${format("%02d", count.index + 1)}" } } diff --git a/terraform/aws/modules/hana_node/outputs.tf b/terraform/aws/modules/hana_node/outputs.tf index 9968f38d..cd890e33 100644 --- a/terraform/aws/modules/hana_node/outputs.tf +++ b/terraform/aws/modules/hana_node/outputs.tf @@ -19,3 +19,7 @@ output "hana_public_name" { value = data.aws_instance.hana.*.public_dns } +output "stonith_tag" { + value = local.hana_stonith_tag +} + diff --git a/terraform/aws/outputs.tf b/terraform/aws/outputs.tf index fc4f2d40..51310a20 100644 --- a/terraform/aws/outputs.tf +++ b/terraform/aws/outputs.tf @@ -105,17 +105,11 @@ resource "local_file" "ansible_inventory" { iscsi_pip = module.iscsi_server.iscsisrv_public_ip, iscsi_enabled = local.iscsi_enabled, iscsi_remote_python = var.iscsi_remote_python, - use_sbd = local.use_sbd + use_sbd = local.use_sbd, + routetable_id = aws_route_table.route-table.id, + virtual_ip = local.hana_cluster_vip, + stonith_tag = module.hana_node.stonith_tag }) filename = "inventory.yaml" } -# Additional cluster information -resource "local_file" "cluster_data" { - content = templatefile("aws_cluster_data.tftpl", - { - routetable_id = aws_route_table.route-table.id, - virtual_ip = local.hana_cluster_vip - }) - filename = "aws_cluster_data.yaml" -}