Skip to content

Commit

Permalink
Aws native fencing playbook using role
Browse files Browse the repository at this point in the history
New cluster configuration playbook using role from
community.sles-for-sap repo.
Cluster is configured to use AWS native fencing.
  • Loading branch information
mpagot committed Jan 18, 2024
1 parent 22ac510 commit a84c43a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
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!

Check warning on line 3 in ansible/playbooks/sap-hana-cluster_role.yaml

View workflow job for this annotation

GitHub Actions / build

3:15 [comments] too few spaces before comment
remote_user: cloudadmin
become: true
# become_user: root
any_errors_fatal: true # any_errors_fatal strongly recommended!

Check warning on line 7 in ansible/playbooks/sap-hana-cluster_role.yaml

View workflow job for this annotation

GitHub Actions / build

7:26 [comments] too few spaces before comment

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.

Check warning on line 22 in ansible/playbooks/sap-hana-cluster_role.yaml

View workflow job for this annotation

GitHub Actions / build

22:40 [comments] too few spaces before comment
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

Check warning on line 24 in ansible/playbooks/sap-hana-cluster_role.yaml

View workflow job for this annotation

GitHub Actions / build

24:67 [comments] too few spaces before comment
aws_secret_access_key: '{{ lookup("env", "AWS_SECRET_ACCESS_KEY") }}' # secret access key of the account to be used to perform stonith actions

Check warning on line 25 in ansible/playbooks/sap-hana-cluster_role.yaml

View workflow job for this annotation

GitHub Actions / build

25:75 [comments] too few spaces before comment

hana_sid: "{{ sap_hana_install_sid }}"
hana_instance_number: "{{ sap_hana_install_instance_number }}"
#dual_corosync_rings: true

Check warning on line 29 in ansible/playbooks/sap-hana-cluster_role.yaml

View workflow job for this annotation

GitHub Actions / build

29:6 [comments] missing starting space in comment
#enable_hawk: true

Check warning on line 30 in ansible/playbooks/sap-hana-cluster_role.yaml

View workflow job for this annotation

GitHub Actions / build

30:6 [comments] missing starting space in comment
roles:
- role: cluster

Check failure on line 32 in ansible/playbooks/sap-hana-cluster_role.yaml

View workflow job for this annotation

GitHub Actions / build

ERROR

the role 'cluster' was not found in /home/runner/work/qe-sap-deployment/qe-sap-deployment/ansible/playbooks/roles:/home/runner/work/qe-sap-deployment/qe-sap-deployment/tools/dummy_roles:/home/runner/work/qe-sap-deployment/qe-sap-deployment/ansible/playbooks
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

0 comments on commit a84c43a

Please sign in to comment.