Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sap_ha_pacemaker_cluster: fixes to the VIP address parameters #458

Merged
merged 3 commits into from
Sep 19, 2023
Merged
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
3 changes: 3 additions & 0 deletions roles/sap_ha_pacemaker_cluster/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ sap_ha_pacemaker_cluster_resource_defaults: {}
# nwas_abap_ascs_ers
# nwas_abap_pas_aas
# nwas_java_scs_ers (maybe)
#
# 'sap_ha_pacemaker_cluster_host_type' is converted from string to list type in
# 'tasks/ascertain_sap_landscape.yml'.
sap_ha_pacemaker_cluster_host_type: "{{ sap_host_type | default(['hana_scaleup_perf']) }}"
sap_ha_pacemaker_cluster_replication_type: none

Expand Down
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 }}"
- key: "{{ sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }}"
value: "{{ sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address }}"
- key: "{{ sap_ha_pacemaker_cluster_vip_netweaver_ascs_resource_name }}"
value: "{{ sap_ha_pacemaker_cluster_vip_netweaver_ascs_ip_address }}"
- key: "{{ sap_ha_pacemaker_cluster_vip_netweaver_ers_resource_name }}"
value: "{{ sap_ha_pacemaker_cluster_vip_netweaver_ers_ip_address }}"
- key: "{{ sap_ha_pacemaker_cluster_vip_netweaver_pas_resource_name }}"
value: "{{ sap_ha_pacemaker_cluster_vip_netweaver_pas_ip_address }}"
- key: "{{ sap_ha_pacemaker_cluster_vip_netweaver_aas_resource_name }}"
value: "{{ sap_ha_pacemaker_cluster_vip_netweaver_aas_ip_address }}"
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 != ''
Loading