Skip to content

Commit

Permalink
default for package dictionaries to simplify vars
Browse files Browse the repository at this point in the history
marcelmamula committed Mar 11, 2024
1 parent 5f0f19d commit 6c9efad
Showing 8 changed files with 25 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -3,9 +3,11 @@
#
# TODO: make sure to first respect 'ha_cluster' native variables

sap_ha_pacemaker_cluster_fence_agent_packages: "{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_aws }}"
sap_ha_pacemaker_cluster_fence_agent_packages:
"{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_aws | default([]) }}"

__sap_ha_pacemaker_cluster_platform_extra_packages: "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_aws }}"
__sap_ha_pacemaker_cluster_platform_extra_packages:
"{{ __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"
Original file line number Diff line number Diff line change
@@ -3,9 +3,11 @@
#
# TODO: make sure to first respect 'ha_cluster' native variables

sap_ha_pacemaker_cluster_fence_agent_packages: "{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_gcp }}"
sap_ha_pacemaker_cluster_fence_agent_packages:
"{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_gcp | default([]) }}"

__sap_ha_pacemaker_cluster_platform_extra_packages: "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_gcp }}"
__sap_ha_pacemaker_cluster_platform_extra_packages:
"{{ __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"
Original file line number Diff line number Diff line change
@@ -3,9 +3,11 @@
#
# TODO: make sure to first respect 'ha_cluster' native variables

sap_ha_pacemaker_cluster_fence_agent_packages: "{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_ibmcloud_powervs }}"
sap_ha_pacemaker_cluster_fence_agent_packages:
"{{ 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_dict.cloud_ibmcloud_powervs }}"
__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"
Original file line number Diff line number Diff line change
@@ -3,9 +3,11 @@
#
# TODO: make sure to first respect 'ha_cluster' native variables

sap_ha_pacemaker_cluster_fence_agent_packages: "{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_ibmcloud_vs }}"
sap_ha_pacemaker_cluster_fence_agent_packages:
"{{ 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_dict.cloud_ibmcloud_vs }}"
__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"
Original file line number Diff line number Diff line change
@@ -6,9 +6,11 @@
# The packages of the following lists will be installed by the 'ha_cluster' Linux System Role.
# 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: "{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_msazure_vm }}"
sap_ha_pacemaker_cluster_fence_agent_packages:
"{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_msazure_vm | default([]) }}"

__sap_ha_pacemaker_cluster_platform_extra_packages: "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_msazure_vm }}"
__sap_ha_pacemaker_cluster_platform_extra_packages:
"{{ __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"
Original file line number Diff line number Diff line change
@@ -3,9 +3,11 @@
# TODO: rename this file to match the actual "chassis_asset_tag" output
# TODO: make sure to first respect 'ha_cluster' native variables

sap_ha_pacemaker_cluster_fence_agent_packages: "{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.hyp_ibmpower_vm }}"
sap_ha_pacemaker_cluster_fence_agent_packages:
"{{ 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_dict.hyp_ibmpower_vm }}"
__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"
3 changes: 0 additions & 3 deletions roles/sap_ha_pacemaker_cluster/vars/redhat.yml
Original file line number Diff line number Diff line change
@@ -46,11 +46,8 @@ __sap_ha_pacemaker_cluster_platform_extra_packages_dict:
- awscli
cloud_gcp:
- resource-agents-gcp
cloud_ibmcloud_powervs: []
cloud_ibmcloud_vs: []
cloud_msazure_vm:
- socat
hyp_ibmpower_vm: []

# Dictionary with additional cluster packages for specific scenarios
__sap_ha_pacemaker_cluster_sap_extra_packages_dict:
12 changes: 1 addition & 11 deletions roles/sap_ha_pacemaker_cluster/vars/suse.yml
Original file line number Diff line number Diff line change
@@ -21,24 +21,14 @@ sap_ha_pacemaker_cluster_fence_agent_minimal_packages:

# 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:
cloud_aws: []
cloud_gcp: []
cloud_ibmcloud_powervs: []
cloud_ibmcloud_vs: []
cloud_msazure_vm: []
hyp_ibmpower_vm: []
# 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_gcp: []
cloud_ibmcloud_powervs: []
cloud_ibmcloud_vs: []
cloud_msazure_vm:
- socat
hyp_ibmpower_vm: []

# Dictionary with additional cluster packages for specific scenarios
__sap_ha_pacemaker_cluster_sap_extra_packages_dict:

0 comments on commit 6c9efad

Please sign in to comment.