Skip to content

Commit

Permalink
add susChkSrv HA/DR provider
Browse files Browse the repository at this point in the history
make providers configurable

Signed-off-by: Eike Waldt <[email protected]>
  • Loading branch information
yeoldegrove committed Nov 6, 2023
1 parent 4db963e commit 8e63a07
Showing 1 changed file with 38 additions and 6 deletions.
44 changes: 38 additions & 6 deletions hana/ha_cluster.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
{% if hana.scale_out %}
{% set hook_path = '/usr/share/SAPHanaSR-ScaleOut' %}
{% set sr_hook_multi_target = hook_path + '/SAPHanaSrMultiTarget.py' %}
{% set sr_hook = hook_path + '/SAPHanaSR.py' %}
{% set sustkover_hook = hook_path + '/susTkOver.py' %}
remove_SAPHanaSR:
pkg.removed:
Expand All @@ -21,9 +18,6 @@ install_SAPHanaSR:
{% else %}
{% set hook_path = '/usr/share/SAPHanaSR' %}
{% set sr_hook_multi_target = hook_path + '/SAPHanaSrMultiTarget.py' %}
{% set sr_hook = hook_path + '/SAPHanaSR.py' %}
{% set sustkover_hook = hook_path + '/susTkOver.py' %}
remove_SAPHanaSR:
pkg.removed:
Expand All @@ -38,6 +32,24 @@ install_SAPHanaSR:
- SAPHanaSR-doc
{% endif %}
{% set sr_hook_multi_target = hook_path + '/SAPHanaSrMultiTarget.py' %}
{% set sr_hook = hook_path + '/SAPHanaSR.py' %}
{% set sustkover_hook = hook_path + '/susTkOver.py' %}
{% set suschksrv_hook = hook_path + '/susChkSrv.py' %}
{% set sustkover_hook_enabled = True %}
{% set suschksrv_hook_enabled = True %}
{% set suschksrv_hook_action_on_lost = 'stop' %}
{% if hana.ha_dr_sustkover_enabled is defined %}
{% set sustkover_hook_enabled = hana.ha_dr_sustkover_enabled %}
{% endif %}
{% if hana.ha_dr_suschksrv_enabled is defined %}
{% set suschksrv_hook_enabled = hana.ha_dr_suschksrv_enabled %}
{% endif %}
{% if hana.ha_dr_suschksrv_action_on_lost is defined %}
{% set suschksrv_hook_action_on_lost = hana.ha_dr_suschksrv_action_on_lost %}
{% endif %}
# get HANA sites
{% set sites = {} %}
{% for node in hana.nodes %}
Expand Down Expand Up @@ -182,6 +194,26 @@ configure_susTkOver_hook_{{ sap_instance }}:
- pkg: install_SAPHanaSR
- onlyif:
- test -f {{ sustkover_hook }}
- test "True" == "{{ sustkover_hook_enabled }}"
configure_susChkSrv_hook_{{ sap_instance }}:
ini.options_present:
- name: /hana/shared/{{ node.sid.upper() }}/global/hdb/custom/config/global.ini
- separator: '='
- strict: False # do not touch rest of file
- sections:
ha_dr_provider_suschksrv:
provider: 'susChkSrv'
path: '{{ hook_path }}'
execution_order: '3'
action_on_lost: '{{ suschksrv_hook_action_on_lost }}'
trace:
ha_dr_suschksrv: 'info'
- require:
- pkg: install_SAPHanaSR
- onlyif:
- test -f {{ suschksrv_hook }}
- test "True" == "{{ suschksrv_hook_enabled }}"
# Configure system replication operation mode in the primary site
{% for secondary_node in hana.nodes if node.primary is defined and secondary_node.secondary is defined and secondary_node.secondary.remote_host == host %}
Expand Down

0 comments on commit 8e63a07

Please sign in to comment.