Skip to content

Commit a84c43a

Browse files
committed
Aws native fencing playbook using role
New cluster configuration playbook using role from community.sles-for-sap repo. Cluster is configured to use AWS native fencing.
1 parent 22ac510 commit a84c43a

3 files changed

Lines changed: 35 additions & 1 deletion

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
- name: Use the cluster role
3+
hosts: hana # ensure only two hosts!
4+
remote_user: cloudadmin
5+
become: true
6+
# become_user: root
7+
any_errors_fatal: true # any_errors_fatal strongly recommended!
8+
9+
pre_tasks:
10+
- name: Load SAP HANA variables
11+
ansible.builtin.include_vars: ./vars/hana_vars.yaml
12+
13+
- name: Ensure ClusterTools2 is installed
14+
community.general.zypper:
15+
name: ClusterTools2
16+
state: present
17+
18+
vars:
19+
platform: 'aws'
20+
stonith: 'native'
21+
primary: "{{ ansible_play_hosts[0] }}"
22+
virtual_ip: "{{ aws_cluster_ip }}" # the Virtual IP address that the cluster will use.
23+
hacluster_password: 'Example_poor_passwo0rd!'
24+
aws_access_key_id: '{{ lookup("env", "AWS_ACCESS_KEY_ID") }}' # access key id of the account to be used to perform stonith actions
25+
aws_secret_access_key: '{{ lookup("env", "AWS_SECRET_ACCESS_KEY") }}' # secret access key of the account to be used to perform stonith actions
26+
27+
hana_sid: "{{ sap_hana_install_sid }}"
28+
hana_instance_number: "{{ sap_hana_install_instance_number }}"
29+
#dual_corosync_rings: true
30+
#enable_hawk: true
31+
roles:
32+
- role: cluster

terraform/aws/inventory.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
all:
22
vars:
33
use_sbd: ${use_sbd}
4-
aws_route_table: ${routetable_id}
4+
aws_route_table_id: ${routetable_id}
55
aws_cluster_ip: ${virtual_ip}
66
aws_stonith_tag: ${stonith_tag}
7+
aws_region: ${region}
78
children:
89
hana:
910
hosts:

terraform/aws/outputs.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ resource "local_file" "ansible_inventory" {
109109
routetable_id = aws_route_table.route-table.id,
110110
virtual_ip = local.hana_cluster_vip,
111111
stonith_tag = module.hana_node.stonith_tag
112+
region = var.aws_region
112113
})
113114
filename = "inventory.yaml"
114115
}

0 commit comments

Comments
 (0)