Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions ansible/playbooks/sap-hana-cluster_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
- name: Use the cluster role
hosts: hana # ensure only two hosts!
remote_user: cloudadmin
become: true
# become_user: root
any_errors_fatal: true # any_errors_fatal strongly recommended!

pre_tasks:
- name: Load SAP HANA variables
ansible.builtin.include_vars: ./vars/hana_vars.yaml

- name: Ensure ClusterTools2 is installed
community.general.zypper:
name: ClusterTools2
state: present

vars:
platform: 'aws'
stonith: 'native'
primary: "{{ ansible_play_hosts[0] }}"
virtual_ip: "{{ aws_cluster_ip }}" # the Virtual IP address that the cluster will use.
hacluster_password: 'Example_poor_passwo0rd!'
aws_access_key_id: '{{ lookup("env", "AWS_ACCESS_KEY_ID") }}' # access key id of the account to be used to perform stonith actions
aws_secret_access_key: '{{ lookup("env", "AWS_SECRET_ACCESS_KEY") }}' # secret access key of the account to be used to perform stonith actions

hana_sid: "{{ sap_hana_install_sid }}"
hana_instance_number: "{{ sap_hana_install_instance_number }}"
#dual_corosync_rings: true
#enable_hawk: true
roles:
- role: cluster
3 changes: 2 additions & 1 deletion terraform/aws/inventory.tmpl
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
all:
vars:
use_sbd: ${use_sbd}
aws_route_table: ${routetable_id}
aws_route_table_id: ${routetable_id}
aws_cluster_ip: ${virtual_ip}
aws_stonith_tag: ${stonith_tag}
aws_region: ${region}
children:
hana:
hosts:
Expand Down
1 change: 1 addition & 0 deletions terraform/aws/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ resource "local_file" "ansible_inventory" {
routetable_id = aws_route_table.route-table.id,
virtual_ip = local.hana_cluster_vip,
stonith_tag = module.hana_node.stonith_tag
region = var.aws_region
})
filename = "inventory.yaml"
}
Expand Down