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: Variable changes for different os and platforms #642

Merged
merged 4 commits into from
Mar 13, 2024
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
5 changes: 0 additions & 5 deletions roles/sap_ha_pacemaker_cluster/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ sap_ha_pacemaker_cluster_create_config_dest: "review_resource_config.yml"
# Other options are needed in the separate HSR setup role.
sap_ha_pacemaker_cluster_cluster_nodes: "{{ sap_hana_cluster_nodes | default([]) }}"

# Make sure that there is always the minimal default fed into the included role.
# This is combined with the custom list 'sap_ha_pacemaker_cluster_fence_agent_packages'.
sap_ha_pacemaker_cluster_fence_agent_minimal_packages:
- fence-agents-all

# Resource defaults are defined differently by cluster type in different tasks, if not custom defined.
# TODO: migrate to 'ha_cluster' native parameter combination when moving the function to be included in the role
# (newer feature in the LSR)
Expand Down
2 changes: 1 addition & 1 deletion roles/sap_ha_pacemaker_cluster/tasks/configure_srhook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- name: "SAP HA Pacemaker srHook - Copy srHook to shared directory"
ansible.builtin.copy:
remote_src: true
src: /usr/share/SAPHanaSR/srHook/SAPHanaSR.py
src: "{{ __sap_ha_srhook_path }}"
dest: "{{ sap_ha_pacemaker_cluster_hadr_provider_path }}/{{ sap_ha_pacemaker_cluster_hadr_provider_name }}.py"
mode: "0755"
owner: "{{ sap_ha_pacemaker_cluster_hana_sid | lower }}adm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
vars:
__resource_hana_topology:
id: "{{ sap_ha_pacemaker_cluster_hana_topology_resource_name }}"
agent: "ocf:heartbeat:SAPHanaTopology"
agent: "ocf:{{ __sap_ha_resource_agent_namespace }}:SAPHanaTopology"
sean-freeman marked this conversation as resolved.
Show resolved Hide resolved
instance_attrs:
- attrs:
- name: SID
Expand Down Expand Up @@ -55,7 +55,7 @@
vars:
__resource_hana:
id: "{{ sap_ha_pacemaker_cluster_hana_resource_name }}"
agent: "ocf:heartbeat:{{ sap_ha_pacemaker_cluster_ra_hana }}"
agent: "ocf:{{ __sap_ha_resource_agent_namespace }}:{{ sap_ha_pacemaker_cluster_ra_hana }}"
instance_attrs:
- attrs:
- name: SID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@

# ha_cluster_hacluster_password
- name: "SAP HA Prepare Pacemaker - (ha_cluster) Register parameter 'ha_cluster_repos'"
when: ha_cluster_hacluster_password is defined
when:
- ha_cluster_hacluster_password is defined
- ha_cluster_hacluster_password | length > 0
ansible.builtin.set_fact:
__sap_ha_pacemaker_cluster_hacluster_user_password: "{{ ha_cluster_hacluster_password }}"
no_log: true # handle credentials with care
Expand Down
3 changes: 1 addition & 2 deletions roles/sap_ha_pacemaker_cluster/vars/hana_scaleout_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#
# TODO: make sure to first respect 'ha_cluster' native variables

__sap_ha_pacemaker_cluster_sap_extra_packages:
- resource-agents-sap-hana-scaleout
__sap_ha_pacemaker_cluster_sap_extra_packages: "{{ __sap_ha_pacemaker_cluster_sap_extra_packages_dict.hana_scaleout }}"

sap_ha_pacemaker_cluster_ra_hana: SAPHanaController
sap_ha_pacemaker_cluster_hadr_provider_name: SAPHanaSR
Expand Down
3 changes: 1 addition & 2 deletions roles/sap_ha_pacemaker_cluster/vars/hana_scaleup_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#
# TODO: make sure to first respect 'ha_cluster' native variables

__sap_ha_pacemaker_cluster_sap_extra_packages:
- resource-agents-sap-hana
__sap_ha_pacemaker_cluster_sap_extra_packages: "{{ __sap_ha_pacemaker_cluster_sap_extra_packages_dict.hana_scaleup }}"

sap_ha_pacemaker_cluster_ra_hana: SAPHana
sap_ha_pacemaker_cluster_hadr_provider_name: SAPHanaSR
Expand Down
5 changes: 3 additions & 2 deletions roles/sap_ha_pacemaker_cluster/vars/nwas_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
# TODO: make sure to first respect 'ha_cluster' native variables

__sap_ha_pacemaker_cluster_sap_extra_packages:
- resource-agents-sap
- "{% if sap_ha_pacemaker_cluster_enable_cluster_connector %}{{ __sap_ha_pacemaker_cluster_halib_package }}{% endif %}"
"{{ ( __sap_ha_pacemaker_cluster_sap_extra_packages_dict.nwas +
[ __sap_ha_pacemaker_cluster_halib_package ] if sap_ha_pacemaker_cluster_enable_cluster_connector
else __sap_ha_pacemaker_cluster_sap_extra_packages_dict.nwas ) | unique }}"
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# TODO: make sure to first respect 'ha_cluster' native variables

sap_ha_pacemaker_cluster_fence_agent_packages:
- fence-agents-aws
"{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_aws | default([]) }}"

__sap_ha_pacemaker_cluster_platform_extra_packages:
- awscli
"{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_aws | default([]) }}"

__sap_ha_pacemaker_cluster_repos:
- id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rhui-rpms"
sean-freeman marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -21,7 +21,7 @@ __sap_ha_pacemaker_cluster_aws_instances: []
# The aws cli is currently configured anyway for the standard AWS VIP resource.
sap_ha_pacemaker_cluster_stonith_default:
id: "res_fence_aws"
agent: "stonith:fence_aws"
agent: "{{ sap_ha_pacemaker_cluster_stonith_agent_dict.cloud_aws }}"
sean-freeman marked this conversation as resolved.
Show resolved Hide resolved
# options:
# access_key: "{{ sap_ha_pacemaker_cluster_aws_access_key_id }}"
# secret_key: "{{ sap_ha_pacemaker_cluster_aws_secret_access_key }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# TODO: make sure to first respect 'ha_cluster' native variables

sap_ha_pacemaker_cluster_fence_agent_packages:
- fence-agents-gce
"{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_gcp | default([]) }}"

__sap_ha_pacemaker_cluster_platform_extra_packages:
- resource-agents-gcp
"{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_gcp | default([]) }}"

__sap_ha_pacemaker_cluster_repos:
- id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rhui-rpms"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# TODO: make sure to first respect 'ha_cluster' native variables

sap_ha_pacemaker_cluster_fence_agent_packages:
- fence-agents-ibm-powervs
"{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_ibmcloud_powervs | default([]) }}"

# __sap_ha_pacemaker_cluster_platform_extra_packages:
# -
__sap_ha_pacemaker_cluster_platform_extra_packages:
"{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_ibmcloud_powervs | default([]) }}"

__sap_ha_pacemaker_cluster_repos:
- id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rpms"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# TODO: make sure to first respect 'ha_cluster' native variables

sap_ha_pacemaker_cluster_fence_agent_packages:
- fence-agents-ibm-vpc
"{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_ibmcloud_vs | default([]) }}"

# __sap_ha_pacemaker_cluster_platform_extra_packages:
# -
__sap_ha_pacemaker_cluster_platform_extra_packages:
"{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_ibmcloud_vs | default([]) }}"

__sap_ha_pacemaker_cluster_repos:
- id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rpms"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
# Any packages that are pre-requisites for variable construction must be installed before, e.g.
# in the preconfigure-* tasks.
sap_ha_pacemaker_cluster_fence_agent_packages:
- fence-agents-azure-arm
"{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_msazure_vm | default([]) }}"

__sap_ha_pacemaker_cluster_platform_extra_packages:
- socat
"{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_msazure_vm | default([]) }}"

__sap_ha_pacemaker_cluster_repos:
- id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rhui-rpms"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# TODO: make sure to first respect 'ha_cluster' native variables

sap_ha_pacemaker_cluster_fence_agent_packages:
- fence-agents-lpar
"{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.hyp_ibmpower_vm | default([]) }}"

# __sap_ha_pacemaker_cluster_platform_extra_packages:
# -
__sap_ha_pacemaker_cluster_platform_extra_packages:
"{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.hyp_ibmpower_vm | default([]) }}"

__sap_ha_pacemaker_cluster_repos:
- id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rpms"
Expand Down
49 changes: 49 additions & 0 deletions roles/sap_ha_pacemaker_cluster/vars/redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,52 @@ __sap_ha_pacemaker_cluster_command:
resource_start: "pcs resource enable"
resource_defaults_show: "pcs resource defaults config"
resource_defaults_update: "pcs resource defaults update"

# Make sure that there is always the minimal default fed into the included role.
# This is combined with the custom list 'sap_ha_pacemaker_cluster_fence_agent_packages'.
sap_ha_pacemaker_cluster_fence_agent_minimal_packages:
- fence-agents-all

# Dictionary with fence packages for each platform
sap_ha_pacemaker_cluster_fence_agent_packages_dict:
cloud_aws:
- fence-agents-aws
cloud_gcp:
- fence-agents-gce
cloud_ibmcloud_powervs:
- fence-agents-ibm-powervs
cloud_ibmcloud_vs:
- fence-agents-ibm-vpc
cloud_msazure_vm:
- fence-agents-azure-arm
hyp_ibmpower_vm:
- fence-agents-lpar

# Dictionary with extra platform specific packages
__sap_ha_pacemaker_cluster_platform_extra_packages_dict:
cloud_aws:
- awscli
cloud_gcp:
- resource-agents-gcp
cloud_msazure_vm:
- socat

# Dictionary with additional cluster packages for specific scenarios
__sap_ha_pacemaker_cluster_sap_extra_packages_dict:
hana_scaleout:
- resource-agents-sap-hana-scaleout
hana_scaleup:
- resource-agents-sap-hana
nwas:
- resource-agents-sap

sean-freeman marked this conversation as resolved.
Show resolved Hide resolved
# Dictionary for platform specific Stonith agents
# This is required only if there are differences between os_family
sap_ha_pacemaker_cluster_stonith_agent_dict:
cloud_aws: 'stonith:fence_aws'

# SAP HANA Resource agent namespace
__sap_ha_resource_agent_namespace: heartbeat

# Location of HANA SRHook binaries
__sap_ha_srhook_path: '/usr/share/SAPHanaSR/srHook/SAPHanaSR.py'
43 changes: 43 additions & 0 deletions roles/sap_ha_pacemaker_cluster/vars/suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,46 @@ __sap_ha_pacemaker_cluster_command:
resource_start: "crm resource start"
resource_defaults_show: "crm configure show type:rsc_defaults"
resource_defaults_update: "crm configure rsc_defaults"

# Make sure that there is always the minimal default fed into the included role.
# This is combined with the custom list 'sap_ha_pacemaker_cluster_fence_agent_packages'.
sap_ha_pacemaker_cluster_fence_agent_minimal_packages:
- fence-agents

# Dictionary with fence packages for each platform
# SUSE does not use platform specific fence agents, just fence-agents
# sap_ha_pacemaker_cluster_fence_agent_packages_dict:

# Dictionary with extra platform specific packages
__sap_ha_pacemaker_cluster_platform_extra_packages_dict:
cloud_aws:
- awscli
cloud_msazure_vm:
- socat

# Dictionary with additional cluster packages for specific scenarios
__sap_ha_pacemaker_cluster_sap_extra_packages_dict:
hana_scaleout:
- resource-agents
- SAPHanaSR-ScaleOut
- ClusterTools2
hana_scaleup:
- resource-agents
- SAPHanaSR
- ClusterTools2
nwas:
- resource-agents
- ClusterTools2
- sap-suse-cluster-connector
- sapstartsrv-resource-agents

# Dictionary for platform specific Stonith agents
# This is required only if there are differences between os_family
sap_ha_pacemaker_cluster_stonith_agent_dict:
cloud_aws: 'stonith:external/ec2'

# SAP HANA Resource agent namespace
__sap_ha_resource_agent_namespace: suse

# Location of HANA SRHook binaries
__sap_ha_srhook_path: '/usr/share/SAPHanaSR/SAPHanaSR.py'
Loading