Skip to content

Commit

Permalink
sap_ha_pacemaker_cluster: fix: VIP addresses applied corresponding to…
Browse files Browse the repository at this point in the history
… host type
  • Loading branch information
ja9fuchs committed Sep 19, 2023
1 parent b957578 commit c6f6404
Showing 1 changed file with 26 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,31 @@
- name: "SAP HA Prepare Pacemaker - Make a list of potential VIP definitions"
ansible.builtin.set_fact:
__sap_ha_pacemaker_cluster_all_vip_fact:
- key: "{{ sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }}"
value: "{{ sap_ha_pacemaker_cluster_vip_hana_primary_ip_address | regex_replace('/*', '') }}"
- key: "{{ sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }}"
value: "{{ sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | regex_replace('/*', '') }}"
- key: "{{ sap_ha_pacemaker_cluster_vip_netweaver_ascs_resource_name }}"
value: "{{ sap_ha_pacemaker_cluster_vip_netweaver_ascs_ip_address | regex_replace('/*', '') }}"
- key: "{{ sap_ha_pacemaker_cluster_vip_netweaver_ers_resource_name }}"
value: "{{ sap_ha_pacemaker_cluster_vip_netweaver_ers_ip_address | regex_replace('/*', '') }}"
- key: "{{ sap_ha_pacemaker_cluster_vip_netweaver_pas_resource_name }}"
value: "{{ sap_ha_pacemaker_cluster_vip_netweaver_pas_ip_address | regex_replace('/*', '') }}"
- key: "{{ sap_ha_pacemaker_cluster_vip_netweaver_aas_resource_name }}"
value: "{{ sap_ha_pacemaker_cluster_vip_netweaver_aas_ip_address | regex_replace('/*', '') }}"
hana_scaleup_perf: "{{
{
sap_ha_pacemaker_cluster_vip_hana_primary_resource_name: sap_ha_pacemaker_cluster_vip_hana_primary_ip_address | regex_replace('/.*', ''),
sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name: sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | regex_replace('/.*', '')
} }}"
nwas_abap_ascs_ers: "{{
{
sap_ha_pacemaker_cluster_vip_netweaver_ascs_resource_name: sap_ha_pacemaker_cluster_vip_netweaver_ascs_ip_address | regex_replace('/.*', ''),
sap_ha_pacemaker_cluster_vip_netweaver_ers_resource_name: sap_ha_pacemaker_cluster_vip_netweaver_ers_ip_address | regex_replace('/.*', '')
} }}"
nwas_abap_pas_aas: "{{
{
sap_ha_pacemaker_cluster_vip_netweaver_pas_resource_name: sap_ha_pacemaker_cluster_vip_netweaver_pas_ip_address | regex_replace('/.*', ''),
sap_ha_pacemaker_cluster_vip_netweaver_aas_resource_name: sap_ha_pacemaker_cluster_vip_netweaver_aas_ip_address | regex_replace('/.*', '')
} }}"

- name: "SAP HA Prepare Pacemaker - Combine VIP parameters"
ansible.builtin.set_fact:
__sap_ha_pacemaker_cluster_vip_resource_definition:
"{{ __sap_ha_pacemaker_cluster_vip_resource_definition | default({})
| combine ({ vip_item.key : vip_item.value }) }}"
loop: "{{ __sap_ha_pacemaker_cluster_all_vip_fact }}"
| combine(__sap_ha_pacemaker_cluster_all_vip_fact[vip_item]) }}"
loop: "{{ sap_ha_pacemaker_cluster_host_type }}"
loop_control:
loop_var: vip_item
label: "{{ vip_item.key }}: {{ vip_item.value }}"
when:
- vip_item.key is defined
- vip_item.key != ''
- vip_item.value is defined
- vip_item.value != ''


# Repeat the VIP resource definition in a loop over the above combined possible parameters.
- name: "SAP HA Prepare Pacemaker - Include variable construction for standard VIP resources"
Expand All @@ -40,17 +38,23 @@
loop_control:
index_var: loop_index
loop_var: vip_list_item
label: "{{ vip_list_item.key }} - {{ vip_list_item.value }}"
when:
- __sap_ha_pacemaker_cluster_platform not in __sap_ha_pacemaker_cluster_supported_platforms
- vip_list_item.value != ''


- name: "SAP HA Prepare Pacemaker - Include variable construction for platform VIP resources"
ansible.builtin.include_tasks: "platform/construct_vars_vip_resources_{{ __sap_ha_pacemaker_cluster_platform }}.yml"
loop: "{{ query('dict', __sap_ha_pacemaker_cluster_vip_resource_definition) }}"
loop_control:
index_var: loop_index
loop_var: vip_list_item
label: "{{ vip_list_item.key }} - {{ vip_list_item.value }}"
when:
- __sap_ha_pacemaker_cluster_platform in __sap_ha_pacemaker_cluster_supported_platforms
- vip_list_item.value != ''


- name: "SAP HA Prepare Pacemaker - Include variable construction for SAP Hana VIP constraints"
ansible.builtin.include_tasks:
Expand All @@ -59,7 +63,7 @@
loop_control:
index_var: loop_index
loop_var: vip_list_item
label: "{{ vip_list_item.key }} - {{ vip_list_item.value }}"
when:
- sap_ha_pacemaker_cluster_vip_hana_primary_ip_address is defined
- sap_ha_pacemaker_cluster_vip_hana_primary_ip_address != ''
- sap_ha_pacemaker_cluster_host_type | select('search', 'hana') | length > 0
- vip_list_item.value != ''

0 comments on commit c6f6404

Please sign in to comment.