diff --git a/roles/sap_ha_pacemaker_cluster/README.md b/roles/sap_ha_pacemaker_cluster/README.md index eb5a60660..3e212c297 100644 --- a/roles/sap_ha_pacemaker_cluster/README.md +++ b/roles/sap_ha_pacemaker_cluster/README.md @@ -73,7 +73,7 @@ The Ansible Control System (where Ansible is executed from) must have: - Ansible Collection [`redhat.sap_install` from Red Hat Ansible Automation Platform Hub](https://console.redhat.com/ansible/automation-hub/repo/published/redhat/sap_install) version `1.3.0` or later - Ansible Collection [`redhat.rhel_system_roles` from Red Hat Ansible Automation Platform Hub](https://console.redhat.com/ansible/automation-hub/repo/published/redhat/rhel_system_roles) version `1.20.0` or later - **Supported (Downstream)** via RHEL4SAP license: - - RHEL System Roles for SAP RPM Package `rhel-system-roles-3.6.0` or later + - RHEL System Roles for SAP RPM Package `rhel-system-roles-sap-3.6.0` or later - RHEL System Roles RPM Package `rhel-system-roles-1.20.0` or later ## Prerequisites @@ -131,71 +131,84 @@ Red Hat for SAP Community of Practice, Janine Fuchs, IBM Lab for SAP Solutions ## Role Input Parameters -Minimum required parameters: +Minimum required parameters for all clusters: - [sap_ha_pacemaker_cluster_hacluster_password](#sap_ha_pacemaker_cluster_hacluster_password) - -### ha_cluster - -- _Type:_ `dict` - -Optional _**host_vars**_ parameter - if defined it must be set for each node.
-Dictionary that can contain various node options for the pacemaker cluster configuration.
-Supported options can be reviewed in the `ha_cluster` Linux System Role [https://github.com/linux-system-roles/ha_cluster/blob/master/README.md].
- -Example: - -```yaml -ha_cluster: - corosync_addresses: - - 192.168.1.10 - - 192.168.2.10 - node_name: nodeA -``` +Additional minimum requirements depend on the type of cluster setup and on the target platform. ### sap_ha_pacemaker_cluster_aws_access_key_id -- _Type:_ `str` +- _Type:_ `string` AWS access key to allow control of instances (for example for fencing operations).
-Required for cluster nodes setup on Amazon cloud.
+Mandatory for the cluster nodes setup on AWS EC2 instances.
### sap_ha_pacemaker_cluster_aws_region -- _Type:_ `str` +- _Type:_ `string` The AWS region in which the instances to be used for the cluster setup are located.
-Required for cluster nodes setup on Amazon cloud.
+Mandatory for cluster nodes setup on AWS EC2 instances.
### sap_ha_pacemaker_cluster_aws_secret_access_key -- _Type:_ `str` +- _Type:_ `string` AWS secret key, paired with the access key for instance control.
-Required for cluster nodes setup on Amazon cloud.
+Mandatory for the cluster setup on AWS EC2 instances.
### sap_ha_pacemaker_cluster_aws_vip_update_rt - _Type:_ `list` List one more routing table IDs for managing Virtual IP failover through routing table changes.
-Required for VIP configuration in AWS EC2 environments.
+Mandatory for the VIP resource configuration in AWS EC2 environments.
### sap_ha_pacemaker_cluster_cluster_name -- _Type:_ `str` -- _Default:_ `my-cluster` +- _Type:_ `string` The name of the pacemaker cluster.
Inherits the `ha_cluster` LSR native parameter `ha_cluster_cluster_name` if not defined.
+If not defined, the `ha_cluster` Linux System Role default will be used.
+ +### sap_ha_pacemaker_cluster_cluster_nodes + +- _Type:_ `list` + +List of cluster nodes and associated attributes to describe the target SAP HA environment.
+This is required for the HANA System Replication configuration.
+Synonym for this parameter is `sap_hana_cluster_nodes`.
+Mandatory to be defined for HANA clusters.
+ +- **hana_site**
+ Site of the cluster and/or SAP HANA System Replication node (for example 'DC01').
Mandatory for HANA clusters (sudo config for system replication). +- **node_ip**
+ IP address of the node used for HANA System Replication.
_Optional. Currently not needed/used in cluster configuration._ +- **node_name**
+ Name of the cluster node, should match the remote systems' hostnames.
_Optional. Currently not needed/used in cluster configuration._ +- **node_role**
+ Role of the defined `node_name` in the SAP HANA cluster setup.
There must be only **one** primary, but there can be multiple secondary nodes.
_Optional. Currently not needed/used in cluster configuration._ + +Example: + +```yaml +sap_ha_pacemaker_cluster_cluster_nodes: +- hana_site: DC01 + node_ip: 192.168.5.1 + node_name: nodeA + node_role: primary +- hana_site: DC02 +``` ### sap_ha_pacemaker_cluster_cluster_properties - _Type:_ `dict` -- _Default:_ `See example` +- _Default:_ `{'concurrent-fencing': True, 'stonith-enabled': True, 'stonith-timeout': 900}` Standard pacemaker cluster properties are configured with recommended settings for cluster node fencing.
+When no STONITH resource is defined, STONITH will be disabled and a warning displayed.
Example: @@ -208,7 +221,7 @@ sap_ha_pacemaker_cluster_cluster_properties: ### sap_ha_pacemaker_cluster_create_config_dest -- _Type:_ `str` +- _Type:_ `string` - _Default:_ `_resource_config.yml` The pacemaker cluster resource configuration optionally created by this role will be saved in a Yaml file in the current working directory.
@@ -226,9 +239,31 @@ This allows using the output file later as input file for additional custom step When enabled this parameters file is also created when the playbook is run in check_mode (`--check`) and can be used to review the configuration parameters without executing actual changes on the target nodes.
WARNING! This report may include sensitive details like secrets required for certain cluster resources!
+### sap_ha_pacemaker_cluster_extra_packages + +- _Type:_ `list` + +Additional extra packages to be installed, for instance specific resource packages.
+For SAP clusters configured by this role, the relevant standard packages for the target scenario are automatically included.
+ +### sap_ha_pacemaker_cluster_fence_agent_minimal_packages + +- _Type:_ `list` +- _Default:_ `['fence-agents-all']` + +The minimal set of fence agent packages that will be installed.
+ +### sap_ha_pacemaker_cluster_fence_agent_packages + +- _Type:_ `list` + +Additional fence agent packages to be installed.
+This is automatically combined with `sap_ha_pacemaker_cluster_fence_agent_minimal_packages`.
+ ### sap_ha_pacemaker_cluster_fence_options - _Type:_ `dict` +- _Default:_ `{'pcmk_reboot_retries': 4, 'pcmk_reboot_timeout': 400, 'power_timeout': 240}` STONITH resource common parameters that apply to most fencing agents.
These options are applied to fencing resources this role uses automatically for pre-defined platforms (like AWS EC2 VS, IBM Cloud VS).
@@ -244,11 +279,46 @@ sap_ha_pacemaker_cluster_fence_options: power_timeout: 240 ``` +### sap_ha_pacemaker_cluster_gcp_project + +- _Type:_ `string` + +Google Cloud project name in which the target instances are installed.
+Mandatory for the cluster setup on GCP instances.
+ +### sap_ha_pacemaker_cluster_gcp_region_zone + +- _Type:_ `string` + +Google Cloud Platform region zone ID.
+Mandatory for the cluster setup on GCP instances.
+ +### sap_ha_pacemaker_cluster_ha_cluster + +- _Type:_ `dict` + +The `ha_cluster` LSR native parameter `ha_cluster` can be used as a synonym.
+Optional _**host_vars**_ parameter - if defined it must be set for each node.
+Dictionary that can contain various node options for the pacemaker cluster configuration.
+Supported options can be reviewed in the `ha_cluster` Linux System Role [https://github.com/linux-system-roles/ha_cluster/blob/master/README.md].
+If not defined, the `ha_cluster` Linux System Role default will be used.
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_ha_cluster: + corosync_addresses: + - 192.168.1.10 + - 192.168.2.10 + node_name: nodeA +``` + ### sap_ha_pacemaker_cluster_hacluster_password required -- _Type:_ `str` +- _Type:_ `string` The password of the `hacluster` user which is created during pacemaker installation.
+Inherits the value of `ha_cluster_hacluster_password`, when defined.
### sap_ha_pacemaker_cluster_hana_automated_register @@ -268,6 +338,14 @@ Time difference needed between to primary time stamps, if a dual-primary situati If the time difference is less than the time gap, then the cluster holds one or both instances in a "WAITING" status.
This is to give an admin a chance to react on a failover. A failed former primary will be registered after the time difference is passed.
+### sap_ha_pacemaker_cluster_hana_instance_number + +- _Type:_ `string` + +The instance number of the SAP HANA database which this role will configure in the cluster.
+Inherits the value of `sap_hana_instance_number`, when defined.
+Mandatory for SAP HANA cluster setups.
+ ### sap_ha_pacemaker_cluster_hana_prefer_site_takeover - _Type:_ `bool` @@ -277,47 +355,136 @@ Parameter for the 'SAPHana' cluster resource.
Set to "false" if the cluster should first attempt to restart the instance on the same node.
When set to "true" (default) a failover to secondary will be initiated on resource failure.
+### sap_ha_pacemaker_cluster_hana_resource_clone_name + +- _Type:_ `string` +- _Default:_ `SAPHana__-clone` + +Customize the cluster resource name of the SAP HANA DB resource clone.
+ ### sap_ha_pacemaker_cluster_hana_resource_name -- _Type:_ `str` +- _Type:_ `string` - _Default:_ `SAPHana__` Customize the cluster resource name of the SAP HANA DB resource.
+### sap_ha_pacemaker_cluster_hana_sid + +- _Type:_ `string` + +The SAP HANA SID of the instance that will be configured in the cluster.
+The SID must follow SAP specifications - see SAP Note 1979280.
+Inherits the value of `sap_hana_sid`, when defined.
+Mandatory for SAP HANA cluster setups.
+ +### sap_ha_pacemaker_cluster_hana_topology_resource_clone_name + +- _Type:_ `string` +- _Default:_ `SAPHanaTopology__-clone` + +Customize the cluster resource name of the SAP HANA Topology resource clone.
+ ### sap_ha_pacemaker_cluster_hana_topology_resource_name -- _Type:_ `str` +- _Type:_ `string` - _Default:_ `SAPHanaTopology__` Customize the cluster resource name of the SAP HANA Topology resource.
+### sap_ha_pacemaker_cluster_host_type + +- _Type:_ `list` +- _Default:_ `hana_scaleup_perf` + +The SAP landscape to for which the cluster is to be configured.
+The default is a 2-node SAP HANA scale-up cluster.
+ ### sap_ha_pacemaker_cluster_ibmcloud_api_key -- _Type:_ `str` +- _Type:_ `string` + +The API key which is required to allow the control of instances (for example for fencing operations).
+Mandatory for the cluster setup on IBM Cloud Virtual Server instances or IBM Power Virtual Server on IBM Cloud.
+ +### sap_ha_pacemaker_cluster_ibmcloud_powervs_api_type + +- _Type:_ `string` + +IBM Power Virtual Server API Endpoint type (public or private) dependent on network interface attachments for the target instances.
+['Mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud.']
-The API key is required to allow control of instances (for example for fencing operations).
-Required for cluster nodes setup in IBM Cloud.
+### sap_ha_pacemaker_cluster_ibmcloud_powervs_forward_proxy_url + +- _Type:_ `string` + +IBM Power Virtual Server forward proxy url when IBM Power Virtual Server API Endpoint type is set to private.
+When public network interface, can be ignored.
+When private network interface, mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud.
+ +### sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_crn + +- _Type:_ `string` + +IBM Power Virtual Server Workspace service cloud resource name (CRN) identifier which contains the target instances
+Mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud.
### sap_ha_pacemaker_cluster_ibmcloud_region -- _Type:_ `str` +- _Type:_ `string` + +The IBM Cloud VS region name in which the instances are running.
+Mandatory for the cluster setup on IBM Cloud Virtual Server instances or IBM Power Virtual Server on IBM Cloud.
+ +### sap_ha_pacemaker_cluster_msazure_resource_group + +- _Type:_ `string` + +Resource group name/ID in which the target instances are defined.
+Mandatory for the cluster setup on MS Azure instances.
+ +### sap_ha_pacemaker_cluster_msazure_subscription_id + +- _Type:_ `string` + +Subscription ID of the MS Azure environment containing the target instances.
+Mandatory for the cluster setup on MS Azure instances.
+ +### sap_ha_pacemaker_cluster_netweaver_abap_aas_instance_number -The cloud region key in which the instances are running.
-Required for cluster nodes setup in IBM Cloud.
+- _Type:_ `string` + +Instance number of the NetWeaver ABAP AAS instance.
+Mandatory for NetWeaver AAS cluster configuration.
+ +### sap_ha_pacemaker_cluster_netweaver_abap_ascs_ers_filesystems + +- _Type:_ `list` +- _Default:_ `['/ASCS', '/ERS']` + +Standard NetWeaver paths in "/usr/sap" and automatically appended to the configuration, when "/usr/sap" is in the list of `sap_ha_pacemaker_cluster_storage_definition`.
### sap_ha_pacemaker_cluster_netweaver_abap_ascs_filesystem_resource_name -- _Type:_ `str` +- _Type:_ `string` +- _Default:_ `Filesystem_NWAS_ABAP_ASCS__` Name of the filesystem resource for the ASCS instance.
### sap_ha_pacemaker_cluster_netweaver_abap_ascs_group_stickiness -- _Type:_ `str` +- _Type:_ `string` - _Default:_ `3000` NetWeaver ASCS resource group stickiness to prefer the ASCS group to stay on the node it was started on.
+### sap_ha_pacemaker_cluster_netweaver_abap_ascs_instance_number + +- _Type:_ `string` + +Instance number of the NetWeaver ABAP ASCS instance.
+Mandatory for NetWeaver ASCS/ERS cluster configuration.
+ ### sap_ha_pacemaker_cluster_netweaver_abap_ascs_sapinstance_automatic_recover_bool - _Type:_ `bool` @@ -327,53 +494,62 @@ NetWeaver ASCS instance resource option "AUTOMATIC_RECOVER".
### sap_ha_pacemaker_cluster_netweaver_abap_ascs_sapinstance_ensa1_failure_timeout -- _Type:_ `str` +- _Type:_ `string` - _Default:_ `60` NetWeaver ASCS instance failure-timeout attribute.
-Only used for ENSA1 setups. Default is ENSA2.
+Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_netweaver_ascs_ers_ensa1`). Default setup is ENSA2.
### sap_ha_pacemaker_cluster_netweaver_abap_ascs_sapinstance_ensa1_migration_threshold -- _Type:_ `str` +- _Type:_ `string` - _Default:_ `1` NetWeaver ASCS instance migration-threshold setting attribute.
-Only used for ENSA1 setups. Default is ENSA2.
+Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_netweaver_ascs_ers_ensa1`). Default setup is ENSA2.
### sap_ha_pacemaker_cluster_netweaver_abap_ascs_sapinstance_instance_name -- _Type:_ `str` +- _Type:_ `string` The name of the ASCS instance, typically the profile name.
-Required for the NetWeaver ASCS resource.
+Mandatory for the NetWeaver ASCS/ERS cluster setup
### sap_ha_pacemaker_cluster_netweaver_abap_ascs_sapinstance_resource_name -- _Type:_ `str` +- _Type:_ `string` +- _Default:_ `SAPInstance_NWAS_ABAP_ASCS__` Name of the ASCS instance resource.
### sap_ha_pacemaker_cluster_netweaver_abap_ascs_sapinstance_resource_stickiness -- _Type:_ `str` +- _Type:_ `string` - _Default:_ `5000` NetWeaver ASCS instance resource stickiness attribute.
### sap_ha_pacemaker_cluster_netweaver_abap_ascs_sapinstance_start_profile_string -- _Type:_ `str` +- _Type:_ `string` The full path and name of the ASCS instance profile.
-Required for the NetWeaver ASCS resource.
+Mandatory for the NetWeaver ASCS/ERS cluster setup.
### sap_ha_pacemaker_cluster_netweaver_abap_ers_filesystem_resource_name -- _Type:_ `str` +- _Type:_ `string` +- _Default:_ `Filesystem_NWAS_ABAP_ERS__` Name of the filesystem resource for the ERS instance.
+### sap_ha_pacemaker_cluster_netweaver_abap_ers_instance_number + +- _Type:_ `string` + +Instance number of the NetWeaver ABAP ERS instance.
+Mandatory for NetWeaver ASCS/ERS cluster configuration.
+ ### sap_ha_pacemaker_cluster_netweaver_abap_ers_sapinstance_automatic_recover_bool - _Type:_ `bool` @@ -383,36 +559,87 @@ NetWeaver ERS instance resource option "AUTOMATIC_RECOVER".
### sap_ha_pacemaker_cluster_netweaver_abap_ers_sapinstance_instance_name -- _Type:_ `str` +- _Type:_ `string` The name of the ERS instance, typically the profile name.
-Required for the NetWeaver ERS resource.
+Mandatory for the NetWeaver ASCS/ERS cluster setup.
### sap_ha_pacemaker_cluster_netweaver_abap_ers_sapinstance_resource_name -- _Type:_ `str` +- _Type:_ `string` +- _Default:_ `SAPInstance_NWAS_ABAP_ERS__` Name of the ERS instance resource.
### sap_ha_pacemaker_cluster_netweaver_abap_ers_sapinstance_start_profile_string -- _Type:_ `str` +- _Type:_ `string` The full path and name of the ERS instance profile.
-Required for the NetWeaver ERS resource.
+Mandatory for the NetWeaver ASCS/ERS cluster.
+ +### sap_ha_pacemaker_cluster_netweaver_abap_pas_instance_number + +- _Type:_ `string` + +Instance number of the NetWeaver ABAP PAS instance.
+Mandatory for NetWeaver PAS cluster configuration.
+ +### sap_ha_pacemaker_cluster_netweaver_ascs_ers_ensa1 + +- _Type:_ `bool` +- _Default:_ `False` + +The standard NetWeaver ASCS/ERS cluster will be set up as ENSA2.
+Set this parameter to 'true' to configure it as ENSA1.
+ +### sap_ha_pacemaker_cluster_netweaver_sapmnt_filesystem_resource_name + +- _Type:_ `string` +- _Default:_ `Filesystem_NWAS_SAPMNT_` + +Filesystem resource name for the shared filesystem /sapmnt.
+Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
+Enable this resource setup using `sap_ha_pacemaker_cluster_netweaver_shared_filesystems_cluster_managed`.
+ +### sap_ha_pacemaker_cluster_netweaver_shared_filesystems_cluster_managed + +- _Type:_ `bool` +- _Default:_ `False` + +Change this parameter to 'true' if the 3 shared filesystems `/usr/sap/trans`, `/usr/sap//SYS` and '/sapmnt' shall be configured as cloned cluster resources.
-### sap_ha_pacemaker_cluster_replication_type +### sap_ha_pacemaker_cluster_netweaver_sid -- _Type:_ `str` -- _Default:_ `none` +- _Type:_ `string` -The type of SAP HANA site replication across multiple hosts.
-_Not yet supported_
+SID of the NetWeaver instances.
+Mandatory for NetWeaver cluster configuration.
+Uses `sap_swpm_sid` if defined.
+Mandatory for NetWeaver cluster setups.
+ +### sap_ha_pacemaker_cluster_netweaver_sys_filesystem_resource_name + +- _Type:_ `string` +- _Default:_ `Filesystem_NWAS_SYS_` + +Filesystem resource name for the transports filesystem /usr/sap//SYS.
+Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
+Enable this resource setup using `sap_ha_pacemaker_cluster_netweaver_shared_filesystems_cluster_managed`.
+ +### sap_ha_pacemaker_cluster_netweaver_transports_filesystem_resource_name + +- _Type:_ `string` +- _Default:_ `Filesystem_NWAS_TRANS_` + +Filesystem resource name for the transports filesystem /usr/sap/trans.
+Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
+Enable this resource setup using `sap_ha_pacemaker_cluster_netweaver_shared_filesystems_cluster_managed`.
### sap_ha_pacemaker_cluster_resource_defaults - _Type:_ `dict` -- _Default:_ `See example` +- _Default:_ `{'migration-threshold': 5000, 'resource-stickiness': 3000}` Set default parameters that will be valid for all pacemaker resources.
@@ -424,146 +651,195 @@ sap_ha_pacemaker_cluster_resource_defaults: resource-stickiness: 1000 ``` +### sap_ha_pacemaker_cluster_stonith_custom + +- _Type:_ `list` + +Custom list of STONITH resource(s) to be configured in the cluster.
+This definition override any defaults the role would apply otherwise.
+ +- **agent**
+ Resource agent name, must contain the prefix "stonith:" to avoid mismatches or failures. +- **name**
+ Name that will be used as the resource ID (name). +- **options**
+ The resource options listed in dictionary format, one option per line.
Requires the mandatory options for the particular stonith resource agent to be defined, otherwise the setup will fail. + +Example: + +```yaml +sap_ha_pacemaker_cluster_stonith_custom: +- agent: stonith:fence_rhevm + name: my-fence-resource + options: + ip: rhevm-server + password: login-user-password + pcmk_host_list: node1,node2 + power_wait: 3 + username: login-user +``` + +### sap_ha_pacemaker_cluster_storage_definition + +- _Type:_ `list` + +List of filesystem definitions used for filesystem cluster resources.
+Uses `sap_storage_setup_definition` when defined.
+ +- **mountpoint**
+ Path under which the filesystem will be mounted.
Mandatory for all filesystems that have a mountpoint.
Special treatment for a generic "/usr/sap" which will automatically be duplicated into the 2 standard sub-directories "/usr/sap//" and "/usr/sap//SYS". +- **name**
+ Unique name of the filesystem definition entry. +- **nfs_filesystem_type**
+ _Default:_ ``
+ NFS filesystem type used to mount this filesystem. +- **nfs_mount_options**
+ _Default:_ ``
+ Mount options to be used for this specific filesystem. +- **nfs_path**
+ Path to the filesystem source directory on the NFS server. +- **nfs_server**
+ _Default:_ ``
+ Name of the NFS server for this particular filesystem. + +Example: + +```yaml +sap_ha_pacemaker_cluster_storage_definition: +- mountpoint: /usr/sap + name: usr_sap + nfs_path: /usr/sap + nfs_server: nfs-server.example.com:/ +- mountpoint: /usr/sap/trans + name: usr_sap_trans + nfs_path: /usr/sap/trans + nfs_server: nfs-server.example.com:/ +- mountpoint: /sapmnt + name: sapmnt + nfs_filesystem_type: nfs + nfs_mount_options: defaults + nfs_path: /sapmnt + nfs_server: nfs-server.example.com:/ +``` + +### sap_ha_pacemaker_cluster_storage_nfs_filesytem_type + +- _Type:_ `string` +- _Default:_ `nfs` + +Filesystem type of the NFS filesystems that are part of the cluster configuration.
+ +### sap_ha_pacemaker_cluster_storage_nfs_mount_options + +- _Type:_ `string` +- _Default:_ `defaults` + +Mount options of the NFS filesystems that are part of the cluster configuration.
+ +### sap_ha_pacemaker_cluster_storage_nfs_server + +- _Type:_ `string` + +Default address of the NFS server, if not defined individually by filesystem.
+ +### sap_ha_pacemaker_cluster_system_roles_collection + +- _Type:_ `string` +- _Default:_ `fedora.linux_system_roles` + +Reference to the Ansible Collection used for the Linux System Roles.
+For community/upstream, use 'fedora.linux_system_roles'.
+For RHEL System Roles for SAP, or Red Hat Automation Hub, use 'redhat.rhel_system_roles'.
+ ### sap_ha_pacemaker_cluster_vip_client_interface -- _Type:_ `str` +- _Type:_ `string` OS device name of the network interface to use for the Virtual IP configuration.
When there is only one interface on the system, its name will be used by default.
### sap_ha_pacemaker_cluster_vip_hana_primary_ip_address -- _Type:_ `str` +- _Type:_ `string` The virtual IP of the primary HANA instance.
+Mandatory parameter for HANA clusters.
### sap_ha_pacemaker_cluster_vip_hana_primary_resource_name -- _Type:_ `str` +- _Type:_ `string` - _Default:_ `vip_` Customize the name of the resource managing the Virtual IP of the primary HANA instance.
### sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address -- _Type:_ `str` +- _Type:_ `string` The virtual IP for read-only access to the secondary HANA instance.
+Optional parameter in HANA clusters.
### sap_ha_pacemaker_cluster_vip_netweaver_aas_ip_address -- _Type:_ `str` +- _Type:_ `string` -The virtual IP of the NetWeaver AAS instance.
+Virtual IP of the NetWeaver AAS instance.
+Mandatory for NetWeaver AAS cluster setup.
### sap_ha_pacemaker_cluster_vip_netweaver_aas_resource_name -- _Type:_ `str` -- _Default:_ `vip_` +- _Type:_ `string` +- _Default:_ `vip___aas` -Customize the name of the resource managing the Virtual IP of the NetWeaver AAS instance.
+Name of the SAPInstance resource for NetWeaver AAS.
### sap_ha_pacemaker_cluster_vip_netweaver_ascs_ip_address -- _Type:_ `str` +- _Type:_ `string` -The virtual IP of the NetWeaver ASCS instance.
+Virtual IP of the NetWeaver ASCS instance.
+Mandatory for NetWeaver ASCS/ERS cluster setup.
### sap_ha_pacemaker_cluster_vip_netweaver_ascs_resource_name -- _Type:_ `str` -- _Default:_ `vip_` +- _Type:_ `string` +- _Default:_ `vip___ascs` -Customize the name of the resource managing the Virtual IP of the NetWeaver ASCS instance.
+Name of the SAPInstance resource for NetWeaver ASCS.
### sap_ha_pacemaker_cluster_vip_netweaver_ers_ip_address -- _Type:_ `str` +- _Type:_ `string` -The virtual IP of the NetWeaver ERS instance.
+Virtual IP of the NetWeaver ERS instance.
+Mandatory for NetWeaver ASCS/ERS cluster setup.
### sap_ha_pacemaker_cluster_vip_netweaver_ers_resource_name -- _Type:_ `str` -- _Default:_ `vip_` +- _Type:_ `string` +- _Default:_ `vip___ers` -Customize the name of the resource managing the Virtual IP of the NetWeaver ERS instance.
+Name of the SAPInstance resource for NetWeaver ERS.
### sap_ha_pacemaker_cluster_vip_netweaver_pas_ip_address -- _Type:_ `str` +- _Type:_ `string` -The virtual IP of the NetWeaver PAS instance.
+Virtual IP of the NetWeaver PAS instance.
+Mandatory for NetWeaver PAS cluster setup.
### sap_ha_pacemaker_cluster_vip_netweaver_pas_resource_name -- _Type:_ `str` -- _Default:_ `vip_` +- _Type:_ `string` +- _Default:_ `vip___pas` -Customize the name of the resource managing the Virtual IP of the NetWeaver PAS instance.
+Name of the SAPInstance resource for NetWeaver PAS.
### sap_ha_pacemaker_cluster_vip_secondary_resource_name -- _Type:_ `str` +- _Type:_ `string` - _Default:_ `vip_` Customize the name of the resource managing the Virtual IP of read-only access to the secondary HANA instance.
-### sap_hana_cluster_nodes - -- _Type:_ `list` - -List of cluster nodes and associated attributes to describe the target SAP HA environment.
-This is required for the HANA System Replication configuration.
- -- **hana_site**
- Site of the cluster and/or SAP HANA System Replication node (for example 'DC01').
This is required for HANA System Replication configuration. -- **node_ip**
- IP address of the node used for HANA System Replication. -- **node_name**
- Name of the cluster node, should match the remote systems' hostnames.
This is needed by the cluster members to know all their partner nodes. -- **node_role**
- Role of this node in the SAP cluster setup.
There must be only **one** primary, but there can be multiple secondary nodes. - -Example: - -```yaml -sap_hana_cluster_nodes: -- hana_site: DC01 - node_ip: 192.168.5.1 - node_name: nodeA - node_role: primary -- hana_site: DC02 - node_ip: 192.168.5.2 - node_name: nodeB - node_role: secondary -``` - -### sap_hana_instance_number - -- _Type:_ `str` - -The instance number of the SAP HANA database which this role will configure in the cluster.
- -### sap_hana_sid - -- _Type:_ `str` - -The SAP HANA SID of the instance that will be configured in the cluster.
-The SID must follow SAP specifications - see SAP Note 1979280.
- -### sap_hana_vip - -- _Type:_ `dict` - -One floating IP is required for SAP HANA DB connection by clients.
-This main VIP will always run on the promoted HANA node and be moved with it during a failover.
- -Example: - -```yaml -sap_hana_vip: - primary: 192.168.10.100 -``` - diff --git a/roles/sap_ha_pacemaker_cluster/defaults/main.yml b/roles/sap_ha_pacemaker_cluster/defaults/main.yml index 7726ec60c..062c04aa3 100644 --- a/roles/sap_ha_pacemaker_cluster/defaults/main.yml +++ b/roles/sap_ha_pacemaker_cluster/defaults/main.yml @@ -1,4 +1,11 @@ --- +################################################################################ +# Role generic parameters +################################################################################ + +# Do NOT USE ANSIBLE FACTS for defaults to be compatible with +# playbooks that disable generic fact gathering! + # Set which Ansible Collection to use for the Linux System Roles. # For community/upstream, use 'fedora.linux_system_roles' # For the RHEL System Roles for SAP, or for Red Hat Automation Hub, use 'redhat.rhel_system_roles' @@ -6,92 +13,51 @@ sap_ha_pacemaker_cluster_system_roles_collection: 'fedora.linux_system_roles' # Variables for the cluster setup must be constructed by dedicated tasks! # The included 'ha_cluster' role will not work with the role variables set -# in this role. +# in this role. This SAP HA role takes care of the parameter construction +# based on the target cluster to be configured, before feeding it into 'ha_cluster'. -# Do NOT USE ANSIBLE FACTS for defaults to be compatible with -# playbooks that disable generic fact gathering! - -# Inherit from ha_cluster Linux System Role -sap_ha_pacemaker_cluster_cluster_name: "{{ ha_cluster_cluster_name | default('my-cluster') }}" -sap_ha_pacemaker_cluster_hacluster_password: "{{ ha_cluster_hacluster_password }}" -# Optional: write all cluster configuration (including credentials!) into a yaml -# config file for review or re-use. +# Optional: write all cluster configuration (including unencrypted credentials!) into a yaml +# config file. +# Useful for parameter review or re-use with the 'ha_cluster' LSR. sap_ha_pacemaker_cluster_create_config_varfile: false sap_ha_pacemaker_cluster_create_config_dest: "{{ sap_ha_pacemaker_cluster_cluster_name }}_resource_config.yml" -# Inherit SAP common (global synonyms) parameters -sap_ha_pacemaker_cluster_cluster_nodes: "{{ sap_ha_cluster_nodes | default(sap_hana_cluster_nodes) }}" -sap_ha_pacemaker_cluster_hana_sid: "{{ sap_hana_sid | default('') }}" -sap_ha_pacemaker_cluster_hana_instance_number: "{{ sap_hana_instance_number | default('') }}" +# Inherit SAP common (global synonyms) parameters when defined. -# TODO: document filesystem definitions -sap_ha_pacemaker_cluster_storage_definition: "{{ sap_storage_definition | default([]) }}" -sap_ha_pacemaker_cluster_storage_nfs_filesytem_type: nfs -sap_ha_pacemaker_cluster_storage_nfs_mount_options: 'defaults' -sap_ha_pacemaker_cluster_storage_nfs_server: "{{ sap_storage_nfs_server | default('') }}" - -################################################################################ -# NetWeaver generic definitions -################################################################################ +# This variable is currently only required for HANA nodes to define +# - hana_site: +# Other options are needed in the separate HSR setup role. +sap_ha_pacemaker_cluster_cluster_nodes: "{{ sap_hana_cluster_nodes | default([]) }}" -# TODO: document the nw parameters - -# Default will be ENSA2. To configure HA resources for ENSA1, enable this parameter: -sap_ha_pacemaker_cluster_netweaver_ascs_ers_ensa1: false - -sap_ha_pacemaker_cluster_netweaver_sid: "{{ sap_swpm_sid | default('') }}" -sap_ha_pacemaker_cluster_netweaver_abap_ascs_instance_number: "{{ sap_swpm_ascs_instance_nr | default('') }}" -sap_ha_pacemaker_cluster_netweaver_abap_ers_instance_number: "{{ sap_swpm_ers_instance_nr | default('') }}" -sap_ha_pacemaker_cluster_netweaver_abap_pas_instance_number: "{{ sap_swpm_pas_instance_nr | default('') }}" -sap_ha_pacemaker_cluster_netweaver_abap_aas_instance_number: "{{ sap_swpm_aas_instance_nr | default('') }}" -sap_ha_pacemaker_cluster_netweaver_java_scs_instance_number: "{{ sap_swpm_java_scs_instance_nr | default('') }}" -sap_ha_pacemaker_cluster_netweaver_java_ers_instance_number: "{{ sap_swpm_java_ers_instance_nr | default('') }}" - -#sap_ha_pacemaker_cluster_netweaver_common_filesystems: -# - /sapmnt -# - /usr/sap/trans -# - "/usr/sap/{{ sap_ha_pacemaker_cluster_netweaver_sid }}/SYS" - -# The following directories are appended to the 'nfs_path' of the '/usr/sap' storage -# definition. -# Therefore, the /usr/sap prefix must be left out of the listed path items. -sap_ha_pacemaker_cluster_netweaver_abap_ascs_ers_filesystems: - - "{{ sap_ha_pacemaker_cluster_netweaver_sid }}/ASCS{{ sap_ha_pacemaker_cluster_netweaver_abap_ascs_instance_number }}" - - "{{ sap_ha_pacemaker_cluster_netweaver_sid }}/ERS{{ sap_ha_pacemaker_cluster_netweaver_abap_ers_instance_number }}" - -# Make sure that there is always the default fed into the included role -sap_ha_pacemaker_cluster_fence_agent_packages: +# 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 -sap_ha_pacemaker_cluster_extra_packages: "{{ ha_cluster_extra_packages | default([]) }}" - -## Resource defaults are defined differently by cluster type, if not custom defined. +# 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) sap_ha_pacemaker_cluster_resource_defaults: {} # The type of SAP landscape and multi-node replication # TODO: Type definitions and feature support # TODO: Implement all types # hana_scaleup_costopt (not yet) -# hana_scaleup_perf (default) +# hana_scaleup_perf (available, default) # hana_scaleup_per_dr (not yet) # hana_scaleout (not yet) -# nwas_abap_ascs_ers -# nwas_abap_pas_aas +# nwas_abap_ascs_ers (available) +# nwas_abap_pas_aas (not yet) # nwas_java_scs_ers (maybe) -# + # 'sap_ha_pacemaker_cluster_host_type' is converted from string to list type in # 'tasks/ascertain_sap_landscape.yml'. +# TODO: review with testers, updated arg specs now require it to be a list from the start sap_ha_pacemaker_cluster_host_type: "{{ sap_host_type | default(['hana_scaleup_perf']) }}" -sap_ha_pacemaker_cluster_replication_type: none -# Optional parameters to customize HANA resources -# AUTOMATED_REGISTER -sap_ha_pacemaker_cluster_hana_automated_register: true -# DUPLICATE_PRIMARY_TIMEOUT -sap_ha_pacemaker_cluster_hana_duplicate_primary_timeout: 900 -# PREFER_SITE_TAKEOVER -sap_ha_pacemaker_cluster_hana_prefer_site_takeover: true +# Currently unused parameter. Keeping for future functionality. +#sap_ha_pacemaker_cluster_replication_type: none ### stonith resource parameter defaults sap_ha_pacemaker_cluster_fence_options: @@ -100,15 +66,120 @@ sap_ha_pacemaker_cluster_fence_options: power_timeout: 240 ### VIP resource default patterns +# Currently there is no task for a different default VIP resource agent. +# Leaving out of meta/argument_specs.yml. +# Platform specific defaults are defined separately. sap_ha_pacemaker_cluster_vip_resource_agent: "ocf:heartbeat:IPaddr2" sap_ha_pacemaker_cluster_vip_client_interface: '' +## A custom stonith definition that takes precedence over platform defaults. +# sap_ha_pacemaker_cluster_stonith_custom: +# - name: "" +# agent: "stonith:" +# options: +# pcmk_host_list: "" + +#sap_ha_pacemaker_cluster_stonith_custom: [] + +# Simpler definition format here which gets transformed into the 'ha_cluster' LSR native +# 'ha_cluster_cluster_properties' parameter. +sap_ha_pacemaker_cluster_cluster_properties: + stonith-enabled: true + stonith-timeout: 900 + concurrent-fencing: true + +################################################################################ +# Inherit from 'ha_cluster' Linux System Role parameters when defined +################################################################################ + +# Optional without a default. The 'ha_cluster' LSR defaults will apply when not defined. +#sap_ha_pacemaker_cluster_ha_cluster: +#sap_ha_pacemaker_cluster_cluster_name: + +# Optional. Set a default here and not in the code. +sap_ha_pacemaker_cluster_extra_packages: [] + +# Optional: additional fence agent packages. This is combined with the above "minimal" list. +sap_ha_pacemaker_cluster_fence_agent_packages: [] + +# Mandatory. +# Either inherit from the 'ha_cluster' LSR variable when defined, but do not set a default. +# This fails the argument validation when none of the 2 vars are defined. +sap_ha_pacemaker_cluster_hacluster_password: "{{ ha_cluster_hacluster_password }}" + + +################################################################################ +# HANA +################################################################################ + +sap_ha_pacemaker_cluster_hana_sid: "{{ sap_hana_sid | default('') }}" +sap_ha_pacemaker_cluster_hana_instance_number: "{{ sap_hana_instance_number | default('') }}" + +# Optional parameters to customize SAPHana resources +# AUTOMATED_REGISTER +sap_ha_pacemaker_cluster_hana_automated_register: true +# DUPLICATE_PRIMARY_TIMEOUT +sap_ha_pacemaker_cluster_hana_duplicate_primary_timeout: 900 +# PREFER_SITE_TAKEOVER +sap_ha_pacemaker_cluster_hana_prefer_site_takeover: true + + +# SAP HANA - Resource IDs (names) as convenience parameters. +sap_ha_pacemaker_cluster_hana_resource_name: "SAPHana_{{ sap_ha_pacemaker_cluster_hana_sid }}_{{ sap_ha_pacemaker_cluster_hana_instance_number }}" +sap_ha_pacemaker_cluster_hana_resource_clone_name: "{{ sap_ha_pacemaker_cluster_hana_resource_name }}-clone" +sap_ha_pacemaker_cluster_hana_topology_resource_name: "SAPHanaTopology_{{ sap_ha_pacemaker_cluster_hana_sid }}_{{ sap_ha_pacemaker_cluster_hana_instance_number }}" +sap_ha_pacemaker_cluster_hana_topology_resource_clone_name: "{{ sap_ha_pacemaker_cluster_hana_topology_resource_name }}-clone" + + # Multiple VIP parameters can be defined and will be combined. # See tasks/include_construct_vip_resources.yml +# +# Mandatory: primary VIP address definition in HANA scale-up clusters sap_ha_pacemaker_cluster_vip_hana_primary_ip_address: '' sap_ha_pacemaker_cluster_vip_hana_primary_resource_name: "vip_{{ sap_ha_pacemaker_cluster_hana_sid }}_{{ sap_ha_pacemaker_cluster_hana_instance_number }}_primary" sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address: '' sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name: "vip_{{ sap_ha_pacemaker_cluster_hana_sid }}_{{ sap_ha_pacemaker_cluster_hana_instance_number }}_readonly" + + +################################################################################ +# NetWeaver generic definitions +################################################################################ + +# Default will be ENSA2. To configure HA resources for ENSA1, +# set this parameter to 'true'. +sap_ha_pacemaker_cluster_netweaver_ascs_ers_ensa1: false + +# Inherit common synonym NetWeaver parameters when defined. +sap_ha_pacemaker_cluster_netweaver_sid: "{{ sap_swpm_sid | default('') }}" +sap_ha_pacemaker_cluster_netweaver_abap_ascs_instance_number: "{{ sap_swpm_ascs_instance_nr | default('') }}" +sap_ha_pacemaker_cluster_netweaver_abap_ers_instance_number: "{{ sap_swpm_ers_instance_nr | default('') }}" +sap_ha_pacemaker_cluster_netweaver_abap_pas_instance_number: "{{ sap_swpm_pas_instance_nr | default('') }}" +sap_ha_pacemaker_cluster_netweaver_abap_aas_instance_number: "{{ sap_swpm_aas_instance_nr | default('') }}" +# Prepare in case JAVA SCS/ERS will be included later. +#sap_ha_pacemaker_cluster_netweaver_java_scs_instance_number: "{{ sap_swpm_java_scs_instance_nr | default('') }}" +#sap_ha_pacemaker_cluster_netweaver_java_ers_instance_number: "{{ sap_swpm_java_ers_instance_nr | default('') }}" + +# Definitions for filesystems resources. Currently limited to NFS filesystems. +sap_ha_pacemaker_cluster_storage_definition: "{{ sap_storage_setup_definition | default([]) }}" +sap_ha_pacemaker_cluster_storage_nfs_filesytem_type: nfs +sap_ha_pacemaker_cluster_storage_nfs_mount_options: 'defaults' +sap_ha_pacemaker_cluster_storage_nfs_server: "{{ sap_storage_nfs_server | default('') }}" + +# NFS filesystem resource requirement +# Not adding to argument_specs because this should not be changed anyway. +# TODO: review later and move to internal vars in vars/main.yml? +sap_ha_pacemaker_cluster_resource_filesystem_force_unmount: safe + +# The following directories are appended to the 'nfs_path' of the '/usr/sap' storage +# definition. +# Therefore, the /usr/sap prefix must be left out of the listed path items. +sap_ha_pacemaker_cluster_netweaver_abap_ascs_ers_filesystems: + - "{{ sap_ha_pacemaker_cluster_netweaver_sid }}/ASCS{{ sap_ha_pacemaker_cluster_netweaver_abap_ascs_instance_number }}" + - "{{ sap_ha_pacemaker_cluster_netweaver_sid }}/ERS{{ sap_ha_pacemaker_cluster_netweaver_abap_ers_instance_number }}" + + +# Multiple VIP parameters can be defined and will be combined. +# See tasks/include_construct_vip_resources.yml sap_ha_pacemaker_cluster_vip_netweaver_ascs_ip_address: '' sap_ha_pacemaker_cluster_vip_netweaver_ascs_resource_name: "vip_{{ sap_ha_pacemaker_cluster_netweaver_sid }}_{{ sap_ha_pacemaker_cluster_netweaver_abap_ascs_instance_number }}_ascs" sap_ha_pacemaker_cluster_vip_netweaver_ers_ip_address: '' @@ -118,17 +189,9 @@ sap_ha_pacemaker_cluster_vip_netweaver_pas_resource_name: "vip_{{ sap_ha_pacemak sap_ha_pacemaker_cluster_vip_netweaver_aas_ip_address: '' sap_ha_pacemaker_cluster_vip_netweaver_aas_resource_name: "vip_{{ sap_ha_pacemaker_cluster_netweaver_sid }}_{{ sap_ha_pacemaker_cluster_netweaver_abap_aas_instance_number }}_aas" -# SAP HANA - Resource IDs (names) as convenience parameters. -sap_ha_pacemaker_cluster_hana_resource_name: "SAPHana_{{ sap_ha_pacemaker_cluster_hana_sid }}_{{ sap_ha_pacemaker_cluster_hana_instance_number }}" -sap_ha_pacemaker_cluster_hana_resource_clone_name: "{{ sap_ha_pacemaker_cluster_hana_resource_name }}-clone" -sap_ha_pacemaker_cluster_hana_topology_resource_name: "SAPHanaTopology_{{ sap_ha_pacemaker_cluster_hana_sid }}_{{ sap_ha_pacemaker_cluster_hana_instance_number }}" -sap_ha_pacemaker_cluster_hana_topology_resource_clone_name: "{{ sap_ha_pacemaker_cluster_hana_topology_resource_name }}-clone" -# NFS filesystem resource requirement -sap_ha_pacemaker_cluster_resource_filesystem_force_unmount: safe - - -# SAP NetWeaver common - Resource IDs (names) as convenience parameters. +# SAP NetWeaver common - Resource IDs (names) as convenience parameters +# for the following filesystems: # - /sapmnt # - /usr/sap/trans # - /usr/sap/<>/SYS @@ -136,10 +199,11 @@ sap_ha_pacemaker_cluster_netweaver_sapmnt_filesystem_resource_name: "Filesystem_ sap_ha_pacemaker_cluster_netweaver_transports_filesystem_resource_name: "Filesystem_NWAS_TRANS_{{ sap_ha_pacemaker_cluster_netweaver_sid }}" sap_ha_pacemaker_cluster_netweaver_sys_filesystem_resource_name: "Filesystem_NWAS_SYS_{{ sap_ha_pacemaker_cluster_netweaver_sid }}" -# Enable to manage the SYS, transport and sapmnt filesystems in the cluster +# The shared filesystems are not required to be configured in the cluster. +# By default it is assumed that they are mounted by the system and available on all cluster nodes. +# Set this parameter to "true" to configure the 3 shared filesystems as part of the cluster. sap_ha_pacemaker_cluster_netweaver_shared_filesystems_cluster_managed: false -# TODO: document parameters ################################################################################ # ASCS resource defaults @@ -209,52 +273,36 @@ sap_ha_pacemaker_cluster_netweaver_abap_ers_sapinstance_automatic_recover_bool: # Platform specific ################################################################################ -## A custom stonith definition that takes precedence over platform defaults. -# sap_ha_pacemaker_cluster_stonith_custom: -# - name: "" -# agent: "stonith:" -# options: -# pcmk_host_list: "" - -# Simpler format translated into 'ha_cluster_cluster_properties' format of -# 'ha_cluster' LSR. -sap_ha_pacemaker_cluster_cluster_properties: - stonith-enabled: true - stonith-timeout: 900 - concurrent-fencing: true - - ## Infrastructure Platform variables, shown here for visibility only and should not be given default values -## + ## AWS platform, EC2 Virtual Servers -sap_ha_pacemaker_cluster_aws_vip_update_rt: [] +# sap_ha_pacemaker_cluster_aws_vip_update_rt: [] # sap_ha_pacemaker_cluster_aws_access_key_id # sap_ha_pacemaker_cluster_aws_secret_access_key # sap_ha_pacemaker_cluster_aws_region -## + ## Google Cloud platform, Compute Engine Virtual Machines # sap_ha_pacemaker_cluster_gcp_project # sap_ha_pacemaker_cluster_gcp_region_zone -## + ## IBM Cloud platform, Virtual Servers (x86_64) # sap_ha_pacemaker_cluster_ibmcloud_api_key # sap_ha_pacemaker_cluster_ibmcloud_region -## + ## IBM Cloud platform, IBM Power Virtual Servers (ppc64le) # sap_ha_pacemaker_cluster_ibmcloud_api_key # sap_ha_pacemaker_cluster_ibmcloud_region # sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_crn -# sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_guid # sap_ha_pacemaker_cluster_ibmcloud_powervs_api_type # sap_ha_pacemaker_cluster_ibmcloud_powervs_forward_proxy_url -## + ## IBM PowerVM hypervisor, Virtual Machines (LPAR, ppc64le) # sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host # sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_port # default, SSH Port 22 # sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_login # sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_login_password # sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_version -## + ## MS Azure platform, Virtual Machines # sap_ha_pacemaker_cluster_msazure_subscription_id # sap_ha_pacemaker_cluster_msazure_resource_group diff --git a/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml b/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml index 5a394c0ae..eddf1b298 100644 --- a/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml +++ b/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml @@ -27,69 +27,15 @@ argument_specs: # description: # ... - ha_cluster: + ######################################################################### + # SAP HA role generic parameters + ######################################################################### + sap_ha_pacemaker_cluster_system_roles_collection: + default: fedora.linux_system_roles description: - - Optional _**host_vars**_ parameter - if defined it must be set for each node. - - Dictionary that can contain various node options for the pacemaker cluster configuration. - - Supported options can be reviewed in the `ha_cluster` Linux System Role [https://github.com/linux-system-roles/ha_cluster/blob/master/README.md]. - example: - ha_cluster: - corosync_addresses: - - 192.168.1.10 - - 192.168.2.10 - node_name: nodeA - - required: false - type: dict - - sap_ha_pacemaker_cluster_cluster_name: - default: my-cluster - description: - - The name of the pacemaker cluster. - - Inherits the `ha_cluster` LSR native parameter `ha_cluster_cluster_name` if not defined. - required: false - type: str - - sap_ha_pacemaker_cluster_hacluster_password: - description: - - The password of the `hacluster` user which is created during pacemaker installation. - no_log: true - required: true - type: str - - sap_ha_pacemaker_cluster_aws_region: - description: - - The AWS region in which the instances to be used for the cluster setup are located. - - Required for cluster nodes setup on Amazon cloud. - required: false - type: str - - sap_ha_pacemaker_cluster_aws_access_key_id: - description: - - AWS access key to allow control of instances (for example for fencing operations). - - Required for cluster nodes setup on Amazon cloud. - required: false - type: str - - sap_ha_pacemaker_cluster_aws_secret_access_key: - description: - - AWS secret key, paired with the access key for instance control. - - Required for cluster nodes setup on Amazon cloud. - required: false - type: str - - sap_ha_pacemaker_cluster_cluster_properties: - default: See example - description: - - Standard pacemaker cluster properties are configured with recommended settings for cluster node fencing. - example: - sap_ha_pacemaker_cluster_cluster_properties: - stonith-enabled: true - stonith-timeout: 900 - concurrent-fencing: true - - required: false - type: dict + - Reference to the Ansible Collection used for the Linux System Roles. + - For community/upstream, use 'fedora.linux_system_roles'. + - For RHEL System Roles for SAP, or Red Hat Automation Hub, use 'redhat.rhel_system_roles'. sap_ha_pacemaker_cluster_create_config_dest: default: _resource_config.yml @@ -98,20 +44,102 @@ argument_specs: - Requires `sap_ha_pacemaker_cluster_create_config_varfile` to be enabled for generating the output file. - Specify a path/filename to save the file in a custom location. - The file can be used as input vars file for an Ansible playbook running the 'ha_cluster' Linux System Role. - required: false - type: str sap_ha_pacemaker_cluster_create_config_varfile: + type: bool default: false description: - When enabled, all cluster configuration parameters this role constructs for executing the 'ha_cluster' Linux System role will be written into a file in Yaml format. - This allows using the output file later as input file for additional custom steps using the 'ha_cluster' role and covering the resource configuration in a cluster that was set up using this 'sap_ha_pacemaker_cluster' role. - When enabled this parameters file is also created when the playbook is run in check_mode (`--check`) and can be used to review the configuration parameters without executing actual changes on the target nodes. - WARNING! This report may include sensitive details like secrets required for certain cluster resources! - required: false - type: bool + + sap_ha_pacemaker_cluster_cluster_nodes: + type: list + description: + - List of cluster nodes and associated attributes to describe the target SAP HA environment. + - This is required for the HANA System Replication configuration. + - Synonym for this parameter is `sap_hana_cluster_nodes`. + - Mandatory to be defined for HANA clusters. + elements: dict + options: + node_ip: + description: + - IP address of the node used for HANA System Replication. + - _Optional. Currently not needed/used in cluster configuration._ + node_name: + description: + - Name of the cluster node, should match the remote systems' hostnames. + - _Optional. Currently not needed/used in cluster configuration._ + node_role: + choices: + - primary + - secondary + description: + - Role of the defined `node_name` in the SAP HANA cluster setup. + - There must be only **one** primary, but there can be multiple secondary nodes. + - _Optional. Currently not needed/used in cluster configuration._ + hana_site: + description: + - Site of the cluster and/or SAP HANA System Replication node (for example 'DC01'). + - Mandatory for HANA clusters (sudo config for system replication). + + example: + sap_ha_pacemaker_cluster_cluster_nodes: + - hana_site: DC01 + node_name: nodeA + node_role: primary + node_ip: 192.168.5.1 + - hana_site: DC02 + + sap_ha_pacemaker_cluster_fence_agent_minimal_packages: + type: list + default: ['fence-agents-all'] + description: + - The minimal set of fence agent packages that will be installed. + + sap_ha_pacemaker_cluster_resource_defaults: + type: dict + default: + resource-stickiness: 3000 + migration-threshold: 5000 + description: + - Set default parameters that will be valid for all pacemaker resources. + example: + sap_ha_pacemaker_cluster_resource_defaults: + resource-stickiness: 1000 + migration-threshold: 5000 + + sap_ha_pacemaker_cluster_host_type: + type: list + choices: +# - hana_scaleup_costopt + - hana_scaleup_perf +# - hana_scaleup_perf_dr +# - hana_scaleout + - nwas_abap_ascs_ers +# - nwas_abap_pas_aas +# - nwas_java_scs_ers + default: hana_scaleup_perf + description: + - The SAP landscape to for which the cluster is to be configured. + - The default is a 2-node SAP HANA scale-up cluster. + +# sap_ha_pacemaker_cluster_replication_type: +# choices: +# - mtr +# - none +# default: none +# description: +# - The type of SAP HANA site replication across multiple hosts. +# - _Not yet supported_ sap_ha_pacemaker_cluster_fence_options: + type: dict + default: + pcmk_reboot_retries: 4 + pcmk_reboot_timeout: 400 + power_timeout: 240 description: - STONITH resource common parameters that apply to most fencing agents. - These options are applied to fencing resources this role uses automatically for pre-defined platforms (like AWS EC2 VS, IBM Cloud VS). @@ -124,28 +152,143 @@ argument_specs: pcmk_reboot_timeout: 400 power_timeout: 240 - required: false + + sap_ha_pacemaker_cluster_vip_client_interface: + description: + - OS device name of the network interface to use for the Virtual IP configuration. + - When there is only one interface on the system, its name will be used by default. + + sap_ha_pacemaker_cluster_stonith_custom: + type: list + description: + - Custom list of STONITH resource(s) to be configured in the cluster. + - This definition override any defaults the role would apply otherwise. + elements: dict + options: + name: + description: + - Name that will be used as the resource ID (name). + required: true + agent: + description: + - Resource agent name, must contain the prefix "stonith:" to avoid mismatches or failures. + required: true + options: + description: + - The resource options listed in dictionary format, one option per line. + - Requires the mandatory options for the particular stonith resource agent to be defined, otherwise the setup will fail. + required: true + + example: + sap_ha_pacemaker_cluster_stonith_custom: + - name: "my-fence-resource" + agent: "stonith:fence_rhevm" + options: + ip: rhevm-server + username: login-user + password: login-user-password + pcmk_host_list: node1,node2 + power_wait: 3 + + sap_ha_pacemaker_cluster_cluster_properties: + type: dict + default: + stonith-enabled: true + stonith-timeout: 900 + concurrent-fencing: true + description: + - Standard pacemaker cluster properties are configured with recommended settings for cluster node fencing. + - When no STONITH resource is defined, STONITH will be disabled and a warning displayed. + + example: + sap_ha_pacemaker_cluster_cluster_properties: + stonith-enabled: true + stonith-timeout: 900 + concurrent-fencing: true + + + ########################################################################## + # Parameters that are optionally imported from 'ha_cluster' LSR parameters + ########################################################################## + + sap_ha_pacemaker_cluster_ha_cluster: type: dict + description: + - The `ha_cluster` LSR native parameter `ha_cluster` can be used as a synonym. + - Optional _**host_vars**_ parameter - if defined it must be set for each node. + - Dictionary that can contain various node options for the pacemaker cluster configuration. + - Supported options can be reviewed in the `ha_cluster` Linux System Role [https://github.com/linux-system-roles/ha_cluster/blob/master/README.md]. + - If not defined, the `ha_cluster` Linux System Role default will be used. + + example: + sap_ha_pacemaker_cluster_ha_cluster: + corosync_addresses: + - 192.168.1.10 + - 192.168.2.10 + node_name: nodeA + + + sap_ha_pacemaker_cluster_cluster_name: + description: + - The name of the pacemaker cluster. + - Inherits the `ha_cluster` LSR native parameter `ha_cluster_cluster_name` if not defined. + - If not defined, the `ha_cluster` Linux System Role default will be used. + + sap_ha_pacemaker_cluster_extra_packages: + type: list + description: + - Additional extra packages to be installed, for instance specific resource packages. + - For SAP clusters configured by this role, the relevant standard packages for the target scenario are automatically included. + + sap_ha_pacemaker_cluster_fence_agent_packages: + type: list + description: + - Additional fence agent packages to be installed. + - This is automatically combined with `sap_ha_pacemaker_cluster_fence_agent_minimal_packages`. + + sap_ha_pacemaker_cluster_hacluster_password: + description: + - The password of the `hacluster` user which is created during pacemaker installation. + - Inherits the value of `ha_cluster_hacluster_password`, when defined. + no_log: true + required: true + + + ########################################################################## + # HANA specific parameters + ########################################################################## + + sap_ha_pacemaker_cluster_hana_sid: + description: + - The SAP HANA SID of the instance that will be configured in the cluster. + - The SID must follow SAP specifications - see SAP Note 1979280. + - Inherits the value of `sap_hana_sid`, when defined. + - Mandatory for SAP HANA cluster setups. + + sap_ha_pacemaker_cluster_hana_instance_number: + description: + - The instance number of the SAP HANA database which this role will configure in the cluster. + - Inherits the value of `sap_hana_instance_number`, when defined. + - Mandatory for SAP HANA cluster setups. sap_ha_pacemaker_cluster_hana_automated_register: + type: bool default: true description: - Parameter for the 'SAPHana' cluster resource. - Define if a former primary should be re-registered automatically as secondary. - required: false - type: bool sap_ha_pacemaker_cluster_hana_duplicate_primary_timeout: + type: int default: 900 description: - Parameter for the 'SAPHana' cluster resource. - Time difference needed between to primary time stamps, if a dual-primary situation occurs. - If the time difference is less than the time gap, then the cluster holds one or both instances in a "WAITING" status. - This is to give an admin a chance to react on a failover. A failed former primary will be registered after the time difference is passed. - required: false - type: int sap_ha_pacemaker_cluster_hana_prefer_site_takeover: + type: bool choices: - true - false @@ -154,341 +297,416 @@ argument_specs: - Parameter for the 'SAPHana' cluster resource. - Set to "false" if the cluster should first attempt to restart the instance on the same node. - When set to "true" (default) a failover to secondary will be initiated on resource failure. - required: false - type: bool sap_ha_pacemaker_cluster_hana_resource_name: default: "SAPHana__" description: - Customize the cluster resource name of the SAP HANA DB resource. - required: false - type: str + + sap_ha_pacemaker_cluster_hana_resource_clone_name: + default: "SAPHana__-clone" + description: + - Customize the cluster resource name of the SAP HANA DB resource clone. sap_ha_pacemaker_cluster_hana_topology_resource_name: default: "SAPHanaTopology__" description: - Customize the cluster resource name of the SAP HANA Topology resource. - required: false - type: str - sap_ha_pacemaker_cluster_ibmcloud_api_key: + sap_ha_pacemaker_cluster_hana_topology_resource_clone_name: + default: "SAPHanaTopology__-clone" description: - - The API key is required to allow control of instances (for example for fencing operations). - - Required for cluster nodes setup in IBM Cloud. - required: false - type: str + - Customize the cluster resource name of the SAP HANA Topology resource clone. - sap_ha_pacemaker_cluster_ibmcloud_region: + sap_ha_pacemaker_cluster_vip_hana_primary_ip_address: + description: + - The virtual IP of the primary HANA instance. + - Mandatory parameter for HANA clusters. + + sap_ha_pacemaker_cluster_vip_hana_primary_resource_name: + default: "vip_" + description: + - Customize the name of the resource managing the Virtual IP of the primary HANA instance. + + sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address: + description: + - The virtual IP for read-only access to the secondary HANA instance. + - Optional parameter in HANA clusters. + + sap_ha_pacemaker_cluster_vip_secondary_resource_name: + default: "vip_" + description: + - Customize the name of the resource managing the Virtual IP of read-only access to the secondary HANA instance. + + + ########################################################################## + # NetWeaver specific parameters + ########################################################################## + + sap_ha_pacemaker_cluster_netweaver_ascs_ers_ensa1: + type: bool + default: false + description: + - The standard NetWeaver ASCS/ERS cluster will be set up as ENSA2. + - Set this parameter to 'true' to configure it as ENSA1. + + sap_ha_pacemaker_cluster_netweaver_sid: + description: + - SID of the NetWeaver instances. + - Mandatory for NetWeaver cluster configuration. + - Uses `sap_swpm_sid` if defined. + - Mandatory for NetWeaver cluster setups. + + sap_ha_pacemaker_cluster_netweaver_abap_ascs_instance_number: + description: + - Instance number of the NetWeaver ABAP ASCS instance. + - Mandatory for NetWeaver ASCS/ERS cluster configuration. + + sap_ha_pacemaker_cluster_netweaver_abap_ers_instance_number: + description: + - Instance number of the NetWeaver ABAP ERS instance. + - Mandatory for NetWeaver ASCS/ERS cluster configuration. + + sap_ha_pacemaker_cluster_netweaver_abap_pas_instance_number: + description: + - Instance number of the NetWeaver ABAP PAS instance. + - Mandatory for NetWeaver PAS cluster configuration. + + sap_ha_pacemaker_cluster_netweaver_abap_aas_instance_number: + description: + - Instance number of the NetWeaver ABAP AAS instance. + - Mandatory for NetWeaver AAS cluster configuration. + + sap_ha_pacemaker_cluster_storage_definition: + type: list + description: + - List of filesystem definitions used for filesystem cluster resources. + - Uses `sap_storage_setup_definition` when defined. + elements: dict + options: + name: + description: + - Unique name of the filesystem definition entry. + required: true + + mountpoint: + description: + - Path under which the filesystem will be mounted. + - Mandatory for all filesystems that have a mountpoint. + - Special treatment for a generic "/usr/sap" which will automatically be duplicated into the 2 standard sub-directories "/usr/sap//" and "/usr/sap//SYS". + required: false # for compatibility with definitions that contain swap filesystems as well (sap_storage_setup role input) + + nfs_filesystem_type: + default: + description: + - NFS filesystem type used to mount this filesystem. + + nfs_mount_options: + default: + description: + - Mount options to be used for this specific filesystem. + + nfs_path: + description: + - Path to the filesystem source directory on the NFS server. + + nfs_server: + default: + description: + - Name of the NFS server for this particular filesystem. + + example: + sap_ha_pacemaker_cluster_storage_definition: + - name: usr_sap + mountpoint: /usr/sap + nfs_path: /usr/sap + nfs_server: "nfs-server.example.com:/" + - name: usr_sap_trans + mountpoint: /usr/sap/trans + nfs_path: /usr/sap/trans + nfs_server: "nfs-server.example.com:/" + - name: sapmnt + mountpoint: /sapmnt + nfs_filesystem_type: nfs + nfs_mount_options: defaults + nfs_path: /sapmnt + nfs_server: "nfs-server.example.com:/" + + + sap_ha_pacemaker_cluster_storage_nfs_filesytem_type: + default: nfs + description: + - Filesystem type of the NFS filesystems that are part of the cluster configuration. + + sap_ha_pacemaker_cluster_storage_nfs_mount_options: + default: defaults + description: + - Mount options of the NFS filesystems that are part of the cluster configuration. + + sap_ha_pacemaker_cluster_storage_nfs_server: + description: + - Default address of the NFS server, if not defined individually by filesystem. + + sap_ha_pacemaker_cluster_netweaver_abap_ascs_ers_filesystems: + type: list + default: + - /ASCS + - /ERS + description: + - Standard NetWeaver paths in "/usr/sap" and automatically appended to the configuration, when "/usr/sap" is in the list of `sap_ha_pacemaker_cluster_storage_definition`. + + sap_ha_pacemaker_cluster_vip_netweaver_ascs_ip_address: + description: + - Virtual IP of the NetWeaver ASCS instance. + - Mandatory for NetWeaver ASCS/ERS cluster setup. + + sap_ha_pacemaker_cluster_vip_netweaver_ascs_resource_name: + default: vip___ascs + description: + - Name of the SAPInstance resource for NetWeaver ASCS. + + sap_ha_pacemaker_cluster_vip_netweaver_ers_ip_address: + description: + - Virtual IP of the NetWeaver ERS instance. + - Mandatory for NetWeaver ASCS/ERS cluster setup. + + sap_ha_pacemaker_cluster_vip_netweaver_ers_resource_name: + default: vip___ers + description: + - Name of the SAPInstance resource for NetWeaver ERS. + + sap_ha_pacemaker_cluster_vip_netweaver_pas_ip_address: + description: + - Virtual IP of the NetWeaver PAS instance. + - Mandatory for NetWeaver PAS cluster setup. + + sap_ha_pacemaker_cluster_vip_netweaver_pas_resource_name: + default: vip___pas + description: + - Name of the SAPInstance resource for NetWeaver PAS. + + sap_ha_pacemaker_cluster_vip_netweaver_aas_ip_address: + description: + - Virtual IP of the NetWeaver AAS instance. + - Mandatory for NetWeaver AAS cluster setup. + + sap_ha_pacemaker_cluster_vip_netweaver_aas_resource_name: + default: vip___aas + description: + - Name of the SAPInstance resource for NetWeaver AAS. + + sap_ha_pacemaker_cluster_netweaver_sapmnt_filesystem_resource_name: + default: Filesystem_NWAS_SAPMNT_ + description: + - Filesystem resource name for the shared filesystem /sapmnt. + - Optional, this is typically managed by the OS, but can as well be added to the cluster configuration. + - Enable this resource setup using `sap_ha_pacemaker_cluster_netweaver_shared_filesystems_cluster_managed`. + + sap_ha_pacemaker_cluster_netweaver_transports_filesystem_resource_name: + default: Filesystem_NWAS_TRANS_ + description: + - Filesystem resource name for the transports filesystem /usr/sap/trans. + - Optional, this is typically managed by the OS, but can as well be added to the cluster configuration. + - Enable this resource setup using `sap_ha_pacemaker_cluster_netweaver_shared_filesystems_cluster_managed`. + + sap_ha_pacemaker_cluster_netweaver_sys_filesystem_resource_name: + default: Filesystem_NWAS_SYS_ + description: + - Filesystem resource name for the transports filesystem /usr/sap//SYS. + - Optional, this is typically managed by the OS, but can as well be added to the cluster configuration. + - Enable this resource setup using `sap_ha_pacemaker_cluster_netweaver_shared_filesystems_cluster_managed`. + + sap_ha_pacemaker_cluster_netweaver_shared_filesystems_cluster_managed: + type: bool + default: false description: - - The cloud region key in which the instances are running. - - Required for cluster nodes setup in IBM Cloud. - required: false - type: str + - Change this parameter to 'true' if the 3 shared filesystems `/usr/sap/trans`, `/usr/sap//SYS` and '/sapmnt' shall be configured as cloned cluster resources. + + + ########################################################################## + # NetWeaver ASCS specific parameters + ########################################################################## - ### ASCS parameters sap_ha_pacemaker_cluster_netweaver_abap_ascs_sapinstance_instance_name: description: - The name of the ASCS instance, typically the profile name. - - Required for the NetWeaver ASCS resource. - required: false - type: str + - Mandatory for the NetWeaver ASCS/ERS cluster setup sap_ha_pacemaker_cluster_netweaver_abap_ascs_sapinstance_start_profile_string: description: - The full path and name of the ASCS instance profile. - - Required for the NetWeaver ASCS resource. - required: false - type: str + - Mandatory for the NetWeaver ASCS/ERS cluster setup. sap_ha_pacemaker_cluster_netweaver_abap_ascs_filesystem_resource_name: + default: Filesystem_NWAS_ABAP_ASCS__ description: - Name of the filesystem resource for the ASCS instance. - required: false - type: str sap_ha_pacemaker_cluster_netweaver_abap_ascs_sapinstance_resource_name: + default: SAPInstance_NWAS_ABAP_ASCS__ description: - Name of the ASCS instance resource. - required: false - type: str sap_ha_pacemaker_cluster_netweaver_abap_ascs_sapinstance_automatic_recover_bool: + type: bool + default: false description: - NetWeaver ASCS instance resource option "AUTOMATIC_RECOVER". - default: false - required: false - type: bool sap_ha_pacemaker_cluster_netweaver_abap_ascs_sapinstance_resource_stickiness: + default: 5000 description: - NetWeaver ASCS instance resource stickiness attribute. - default: 5000 - required: false - type: str sap_ha_pacemaker_cluster_netweaver_abap_ascs_sapinstance_ensa1_migration_threshold: + default: 1 description: - NetWeaver ASCS instance migration-threshold setting attribute. - - Only used for ENSA1 setups. Default is ENSA2. - default: 1 - required: false - type: str + - Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_netweaver_ascs_ers_ensa1`). Default setup is ENSA2. sap_ha_pacemaker_cluster_netweaver_abap_ascs_sapinstance_ensa1_failure_timeout: + default: 60 description: - NetWeaver ASCS instance failure-timeout attribute. - - Only used for ENSA1 setups. Default is ENSA2. - default: 60 - required: false - type: str + - Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_netweaver_ascs_ers_ensa1`). Default setup is ENSA2. sap_ha_pacemaker_cluster_netweaver_abap_ascs_group_stickiness: + default: 3000 description: - NetWeaver ASCS resource group stickiness to prefer the ASCS group to stay on the node it was started on. - default: 3000 - required: false - type: str - ### ERS parameters + + ########################################################################## + # NetWeaver ERS specific parameters + ########################################################################## sap_ha_pacemaker_cluster_netweaver_abap_ers_sapinstance_instance_name: description: - The name of the ERS instance, typically the profile name. - - Required for the NetWeaver ERS resource. - required: false - type: str + - Mandatory for the NetWeaver ASCS/ERS cluster setup. sap_ha_pacemaker_cluster_netweaver_abap_ers_sapinstance_start_profile_string: description: - The full path and name of the ERS instance profile. - - Required for the NetWeaver ERS resource. - required: false - type: str + - Mandatory for the NetWeaver ASCS/ERS cluster. sap_ha_pacemaker_cluster_netweaver_abap_ers_sapinstance_automatic_recover_bool: + type: bool + default: false description: - NetWeaver ERS instance resource option "AUTOMATIC_RECOVER". - default: false - required: false - type: bool sap_ha_pacemaker_cluster_netweaver_abap_ers_filesystem_resource_name: + default: Filesystem_NWAS_ABAP_ERS__ description: - Name of the filesystem resource for the ERS instance. - required: false - type: str sap_ha_pacemaker_cluster_netweaver_abap_ers_sapinstance_resource_name: + default: SAPInstance_NWAS_ABAP_ERS__ description: - Name of the ERS instance resource. - required: false - type: str - - ### HANA - sap_ha_pacemaker_cluster_replication_type: - choices: - - mtr - - none - default: none - description: - - The type of SAP HANA site replication across multiple hosts. - - _Not yet supported_ - required: false - type: str - sap_ha_pacemaker_cluster_resource_defaults: - default: See example - description: - - Set default parameters that will be valid for all pacemaker resources. - example: - sap_ha_pacemaker_cluster_resource_defaults: - resource-stickiness: 1000 - migration-threshold: 5000 + ########################################################################## + # PAS specific parameters + ########################################################################## - required: false - type: dict + # TODO: implement PAS cluster setup -# sap_ha_pacemaker_cluster_host_type: -# choices: -## - hana_scaleup_costopt -# - hana_scaleup_perf -## - hana_scaleup_perf_dr -## - hana_scaleout -# - nwas_abap_ascs_ers -# - nwas_abap_pas_aas -## - nwas_java_scs_ers -# default: hana_scaleup_perf -# description: -# - The SAP landscape to be installed. -# required: false -# type: str + ########################################################################## + # PAS specific parameters + ########################################################################## - sap_ha_pacemaker_cluster_vip_client_interface: - description: - - OS device name of the network interface to use for the Virtual IP configuration. - - When there is only one interface on the system, its name will be used by default. - required: false - type: str + # TODO: implement AAS cluster setup - sap_ha_pacemaker_cluster_vip_hana_primary_ip_address: - description: - - The virtual IP of the primary HANA instance. - required: false - type: str - sap_ha_pacemaker_cluster_vip_hana_primary_resource_name: - default: "vip_" - description: - - Customize the name of the resource managing the Virtual IP of the primary HANA instance. - required: false - type: str + ########################################################################## + # Platforms: AWS specific parameters + ########################################################################## - sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address: + sap_ha_pacemaker_cluster_aws_vip_update_rt: + type: list description: - - The virtual IP for read-only access to the secondary HANA instance. - required: false - type: str + - List one more routing table IDs for managing Virtual IP failover through routing table changes. + - Mandatory for the VIP resource configuration in AWS EC2 environments. - sap_ha_pacemaker_cluster_vip_secondary_resource_name: - default: "vip_" + sap_ha_pacemaker_cluster_aws_region: description: - - Customize the name of the resource managing the Virtual IP of read-only access to the secondary HANA instance. - required: false - type: str + - The AWS region in which the instances to be used for the cluster setup are located. + - Mandatory for cluster nodes setup on AWS EC2 instances. - sap_ha_pacemaker_cluster_vip_netweaver_ascs_ip_address: + sap_ha_pacemaker_cluster_aws_access_key_id: description: - - The virtual IP of the NetWeaver ASCS instance. - required: false - type: str + - AWS access key to allow control of instances (for example for fencing operations). + - Mandatory for the cluster nodes setup on AWS EC2 instances. - sap_ha_pacemaker_cluster_vip_netweaver_ascs_resource_name: - default: "vip_" + sap_ha_pacemaker_cluster_aws_secret_access_key: description: - - Customize the name of the resource managing the Virtual IP of the NetWeaver ASCS instance. - required: false - type: str + - AWS secret key, paired with the access key for instance control. + - Mandatory for the cluster setup on AWS EC2 instances. - sap_ha_pacemaker_cluster_vip_netweaver_ers_ip_address: - description: - - The virtual IP of the NetWeaver ERS instance. - required: false - type: str - sap_ha_pacemaker_cluster_vip_netweaver_ers_resource_name: - default: "vip_" - description: - - Customize the name of the resource managing the Virtual IP of the NetWeaver ERS instance. - required: false - type: str + ########################################################################## + # Platforms: GCP specific parameters + ########################################################################## - sap_ha_pacemaker_cluster_vip_netweaver_pas_ip_address: + sap_ha_pacemaker_cluster_gcp_project: description: - - The virtual IP of the NetWeaver PAS instance. - required: false - type: str + - Google Cloud project name in which the target instances are installed. + - Mandatory for the cluster setup on GCP instances. - sap_ha_pacemaker_cluster_vip_netweaver_pas_resource_name: - default: "vip_" + sap_ha_pacemaker_cluster_gcp_region_zone: description: - - Customize the name of the resource managing the Virtual IP of the NetWeaver PAS instance. - required: false - type: str + - Google Cloud Platform region zone ID. + - Mandatory for the cluster setup on GCP instances. - sap_ha_pacemaker_cluster_vip_netweaver_aas_ip_address: - description: - - The virtual IP of the NetWeaver AAS instance. - required: false - type: str - sap_ha_pacemaker_cluster_vip_netweaver_aas_resource_name: - default: "vip_" - description: - - Customize the name of the resource managing the Virtual IP of the NetWeaver AAS instance. - required: false - type: str + ########################################################################## + # Platforms: IBM Cloud specific parameters - VS and Power VS common + ########################################################################## - sap_ha_pacemaker_cluster_aws_vip_update_rt: + sap_ha_pacemaker_cluster_ibmcloud_api_key: description: - - List one more routing table IDs for managing Virtual IP failover through routing table changes. - - Required for VIP configuration in AWS EC2 environments. - required: false - type: list + - The API key which is required to allow the control of instances (for example for fencing operations). + - Mandatory for the cluster setup on IBM Cloud Virtual Server instances or IBM Power Virtual Server on IBM Cloud. - sap_hana_cluster_nodes: + sap_ha_pacemaker_cluster_ibmcloud_region: description: - - List of cluster nodes and associated attributes to describe the target SAP HA environment. - - This is required for the HANA System Replication configuration. + - The IBM Cloud VS region name in which the instances are running. + - Mandatory for the cluster setup on IBM Cloud Virtual Server instances or IBM Power Virtual Server on IBM Cloud. - example: - sap_hana_cluster_nodes: - - node_name: nodeA - node_role: primary - hana_site: DC01 - node_ip: 192.168.5.1 - - node_name: nodeB - node_role: secondary - hana_site: DC02 - node_ip: 192.168.5.2 - elements: dict - required: false - type: list - options: - node_ip: - description: - - IP address of the node used for HANA System Replication. - required: true - node_name: - description: - - Name of the cluster node, should match the remote systems' hostnames. - - This is needed by the cluster members to know all their partner nodes. - required: true - node_role: - choices: - - primary - - secondary - description: - - Role of this node in the SAP cluster setup. - - There must be only **one** primary, but there can be multiple secondary nodes. - required: true - hana_site: - description: - - Site of the cluster and/or SAP HANA System Replication node (for example 'DC01'). - - This is required for HANA System Replication configuration. - required: true + ########################################################################## + # Platforms: IBM Power VS on IBM Cloud specific parameters + ########################################################################## - sap_hana_instance_number: + sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_crn: description: - - The instance number of the SAP HANA database which this role will configure in the cluster. - required: false - type: str + - IBM Power Virtual Server Workspace service cloud resource name (CRN) identifier which contains the target instances + - Mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud. - sap_hana_sid: + sap_ha_pacemaker_cluster_ibmcloud_powervs_api_type: description: - - The SAP HANA SID of the instance that will be configured in the cluster. - - The SID must follow SAP specifications - see SAP Note 1979280. - required: false - type: str + - IBM Power Virtual Server API Endpoint type (public or private) dependent on network interface attachments for the target instances. + - - Mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud. - sap_hana_vip: + sap_ha_pacemaker_cluster_ibmcloud_powervs_forward_proxy_url: description: - - One floating IP is required for SAP HANA DB connection by clients. - - This main VIP will always run on the promoted HANA node and be moved with it during a failover. + - IBM Power Virtual Server forward proxy url when IBM Power Virtual Server API Endpoint type is set to private. + - When public network interface, can be ignored. + - When private network interface, mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud. - example: - sap_hana_vip: - primary: 192.168.10.100 - required: false - type: dict - required_one_of: [{ primary, main, rw, promoted }] + ########################################################################## + # Platforms: MS Azure specific parameters + ########################################################################## -# TODO: review the global parameter vs. role parameter logic and compatibility of combination of HANA + NW -# sap_system_sid: -# description: -# - The SID of the SAP Netweaver system that will be configured in the cluster. -# - The SID must follow SAP specifications - see SAP Note 1979280. -# required: false -# type: str + sap_ha_pacemaker_cluster_msazure_subscription_id: + description: + - Subscription ID of the MS Azure environment containing the target instances. + - Mandatory for the cluster setup on MS Azure instances. + + sap_ha_pacemaker_cluster_msazure_resource_group: + description: + - Resource group name/ID in which the target instances are defined. + - Mandatory for the cluster setup on MS Azure instances. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/ascertain_ha_cluster_in_inventory.yml b/roles/sap_ha_pacemaker_cluster/tasks/ascertain_ha_cluster_in_inventory.yml deleted file mode 100644 index 408bb89e6..000000000 --- a/roles/sap_ha_pacemaker_cluster/tasks/ascertain_ha_cluster_in_inventory.yml +++ /dev/null @@ -1,54 +0,0 @@ ---- -# If there are "ha_cluster" linux system role parameters already defined in the -# inventory, we will include these custom specifications. - -### Take the following template to add additional parameters to be inherited: -# - name: "SAP HA Prepare Pacemaker - Register ha_cluster_" -# ansible.builtin.set_fact: -# __sap_ha_pacemaker_cluster_: "{{ ha_cluster_ }}" -# when: ha_cluster_ is defined - -- name: "SAP HA Prepare Pacemaker - Register ha_cluster_cluster_properties" - when: ha_cluster_cluster_properties is defined - ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_cluster_properties: "{{ ha_cluster_cluster_properties }}" - -- name: "SAP HA Prepare Pacemaker - Register ha_cluster_constraints_colocation" - when: ha_cluster_constraints_colocation is defined - ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_constraints_colocation: "{{ ha_cluster_constraints_colocation }}" - -- name: "SAP HA Prepare Pacemaker - Register ha_cluster_constraints_location" - when: ha_cluster_constraints_location is defined - ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_constraints_location: "{{ ha_cluster_constraints_location }}" - -- name: "SAP HA Prepare Pacemaker - Register ha_cluster_constraints_order" - when: ha_cluster_constraints_order is defined - ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_constraints_order: "{{ ha_cluster_constraints_order }}" - -- name: "SAP HA Prepare Pacemaker - Register ha_cluster_fence_agent_packages" - when: ha_cluster_fence_agent_packages is defined - ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_fence_agent_packages: "{{ ha_cluster_fence_agent_packages }}" - -- name: "SAP HA Prepare Pacemaker - Register ha_cluster_repos" - when: ha_cluster_repos is defined - ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_repos: "{{ ha_cluster_repos }}" - -- name: "SAP HA Prepare Pacemaker - Register ha_cluster_resource_clones" - when: ha_cluster_resource_clones is defined - ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_resource_clones: "{{ ha_cluster_resource_clones }}" - -- name: "SAP HA Prepare Pacemaker - Register ha_cluster_resource_groups" - when: ha_cluster_resource_groups is defined - ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_resource_groups: "{{ ha_cluster_resource_groups }}" - -- name: "SAP HA Prepare Pacemaker - Register ha_cluster_resource_primitives" - when: ha_cluster_resource_primitives is defined - ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_resource_primitives: "{{ ha_cluster_resource_primitives }}" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_final_hacluster_vars.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_final_hacluster_vars.yml new file mode 100644 index 000000000..db3eded7f --- /dev/null +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_final_hacluster_vars.yml @@ -0,0 +1,95 @@ +--- +# After all of the previous construction flows, the final parameters must +# be translated to 'ha_cluster' Linux System Role syntax. +# +# This way the include_role parameters are set as play vars and do not +# require a static list of vars when the role is included. + +# List of parameters that are constructed by this role, but not all of them +# are mandatory to be defined. For any undefined parameter the default of the +# 'ha_cluster' role will apply, if the role has a default defined. +# +# Make sure to always define those parameters which have no 'ha_cluster' LSR default! +# +# SAP HA Pacemaker Cluster role -> 'ha_cluster' Linux System Role +# ------------------------------------------------------------------------------ +# __sap_ha_pacemaker_cluster_ha_cluster ha_cluster +# __sap_ha_pacemaker_cluster_cluster_name ha_cluster_cluster_name +# __sap_ha_pacemaker_cluster_cluster_properties ha_cluster_cluster_properties +# __sap_ha_pacemaker_cluster_constraints_colocation ha_cluster_constraints_colocation +# __sap_ha_pacemaker_cluster_constraints_location ha_cluster_constraints_location +# __sap_ha_pacemaker_cluster_constraints_order ha_cluster_constraints_order +# __sap_ha_pacemaker_cluster_extra_packages ha_cluster_extra_packages +# __sap_ha_pacemaker_cluster_fence_agent_packages ha_cluster_fence_agent_packages +# __sap_ha_pacemaker_cluster_hacluster_password ha_cluster_hacluster_password +# __sap_ha_pacemaker_cluster_repos __ha_cluster_repos +# __sap_ha_pacemaker_cluster_resource_clones ha_cluster_resource_clones +# __sap_ha_pacemaker_cluster_resource_groups ha_cluster_resource_groups +# __sap_ha_pacemaker_cluster_resource_primitives ha_cluster_resource_primitives + +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Define parameter 'ha_cluster'" + when: __sap_ha_pacemaker_cluster_ha_cluster is defined + ansible.builtin.set_fact: + ha_cluster: "{{ __sap_ha_pacemaker_cluster_ha_cluster }}" + +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Define parameter 'ha_cluster_cluster_name'" + when: __sap_ha_pacemaker_cluster_cluster_name is defined + ansible.builtin.set_fact: + ha_cluster_cluster_name: "{{ __sap_ha_pacemaker_cluster_cluster_name }}" + +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Define parameter 'ha_cluster_cluster_properties'" + when: __sap_ha_pacemaker_cluster_cluster_properties is defined + ansible.builtin.set_fact: + ha_cluster_cluster_properties: "{{ __sap_ha_pacemaker_cluster_cluster_properties }}" + +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Define parameter 'ha_cluster_constraints_colocation'" + when: __sap_ha_pacemaker_cluster_constraints_colocation is defined + ansible.builtin.set_fact: + ha_cluster_constraints_colocation: "{{ __sap_ha_pacemaker_cluster_constraints_colocation }}" + +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Define parameter 'ha_cluster_constraints_location'" + when: __sap_ha_pacemaker_cluster_constraints_location is defined + ansible.builtin.set_fact: + ha_cluster_constraints_location: "{{ __sap_ha_pacemaker_cluster_constraints_location }}" + +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Define parameter 'ha_cluster_constraints_order'" + when: __sap_ha_pacemaker_cluster_constraints_order is defined + ansible.builtin.set_fact: + ha_cluster_constraints_order: "{{ __sap_ha_pacemaker_cluster_constraints_order }}" + +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Define parameter 'ha_cluster_extra_packages'" + when: __sap_ha_pacemaker_cluster_extra_packages is defined + ansible.builtin.set_fact: + ha_cluster_extra_packages: "{{ __sap_ha_pacemaker_cluster_extra_packages }}" + +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Define parameter 'ha_cluster_fence_agent_packages'" + when: __sap_ha_pacemaker_cluster_fence_agent_packages is defined + ansible.builtin.set_fact: + ha_cluster_fence_agent_packages: "{{ __sap_ha_pacemaker_cluster_fence_agent_packages }}" + +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Define parameter 'ha_cluster_hacluster_password'" + when: __sap_ha_pacemaker_cluster_hacluster_password is defined + ansible.builtin.set_fact: + ha_cluster_hacluster_password: "{{ __sap_ha_pacemaker_cluster_hacluster_password }}" + no_log: true # secure the credential + +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Define parameter 'ha_cluster_repos'" + when: __sap_ha_pacemaker_cluster_repos is defined + ansible.builtin.set_fact: + __ha_cluster_repos: "{{ __sap_ha_pacemaker_cluster_repos }}" + +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Define parameter 'ha_cluster_resource_clones'" + when: __sap_ha_pacemaker_cluster_resource_clones is defined + ansible.builtin.set_fact: + ha_cluster_resource_clones: "{{ __sap_ha_pacemaker_cluster_resource_clones }}" + +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Define parameter 'ha_cluster_resource_groups'" + when: __sap_ha_pacemaker_cluster_resource_groups is defined + ansible.builtin.set_fact: + ha_cluster_resource_groups: "{{ __sap_ha_pacemaker_cluster_resource_groups }}" + +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Define parameter 'ha_cluster_resource_primitives'" + when: __sap_ha_pacemaker_cluster_resource_primitives is defined + ansible.builtin.set_fact: + ha_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives }}" + no_log: true # be paranoid, there could be credentials in it diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml index 96a4bdb63..d990853b9 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml @@ -1,29 +1,49 @@ --- -# Create or combine input parameters for the ha_cluster role. +# Combine input parameters with inherited vars from the 'ha_cluster' role. +# The inherited values take precedence. Some parameters are not required to be set. +# The 'ha_cluster' LSR will apply its role defaults. +# For mandatory parameters, sanity checks will be done separately. +# sap_ha_pacemaker_cluster_cluster_name -> user-defined or default inherited from {{ ha_cluster_cluster_name }} - name: "SAP HA Prepare Pacemaker - Set cluster name" + when: + - __sap_ha_pacemaker_cluster_cluster_name is not defined + - sap_ha_pacemaker_cluster_cluster_name is defined ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_cluster_name: "{{ ha_cluster_cluster_name | default(sap_ha_pacemaker_cluster_cluster_name) }}" + __sap_ha_pacemaker_cluster_cluster_name: "{{ sap_ha_pacemaker_cluster_cluster_name }}" +# sap_ha_pacemaker_cluster_hacluster_password -> user-defined or default inherited from {{ ha_cluster_hacluster_password }} - name: "SAP HA Prepare Pacemaker - Register the 'hacluster' user password" + when: + - __sap_ha_pacemaker_cluster_hacluster_password is not defined + - sap_ha_pacemaker_cluster_hacluster_password ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_hacluster_password: "{{ ha_cluster_hacluster_password | default(sap_ha_pacemaker_cluster_hacluster_password) }}" - no_log: true + __sap_ha_pacemaker_cluster_hacluster_password: "{{ sap_ha_pacemaker_cluster_hacluster_password }}" + no_log: true # secure the credential + + +# sap_ha_pacemaker_cluster_extra_packages -> user-defined, empty by global default +# __sap_ha_pacemaker_cluster_sap_extra_packages -> included from vars/* +# __sap_ha_pacemaker_cluster_platform_extra_packages -> included from vars/platform* +# Empty defaults defined here for optional non-user-facing parameters. - name: "SAP HA Prepare Pacemaker - Combine extra packages lists" ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_extra_packages: "{{ + __sap_ha_pacemaker_cluster_extra_packages: "{{ ( sap_ha_pacemaker_cluster_extra_packages - + - sap_ha_pacemaker_cluster_sap_extra_packages | default([]) - + - sap_ha_pacemaker_cluster_platform_extra_packages | default([]) - }}" + + __sap_ha_pacemaker_cluster_sap_extra_packages + + __sap_ha_pacemaker_cluster_platform_extra_packages + ) | unique }}" + + +# sap_ha_pacemaker_cluster_fence_agent_minimal_packages -> global default +# sap_ha_pacemaker_cluster_fence_agent_packages -> global default +# __sap_ha_pacemaker_cluster_fence_agent_packages -> internal default (vars/main.yml) - name: "SAP HA Prepare Pacemaker - Combine fence agent packages lists" ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_fence_agent_packages: "{{ - sap_ha_pacemaker_cluster_fence_agent_packages - + - __sap_ha_pacemaker_cluster_fence_agent_packages - }}" + __sap_ha_pacemaker_cluster_fence_agent_packages: "{{ ( + sap_ha_pacemaker_cluster_fence_agent_minimal_packages + + sap_ha_pacemaker_cluster_fence_agent_packages + + __sap_ha_pacemaker_cluster_fence_agent_packages + ) | unique }}" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml index 9859b979a..43da8bf1b 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml @@ -7,7 +7,7 @@ # This block is entered when # - no default stonith resource is defined and no custom is defined either # - an empty custom is defined to override any default (defined or not) -- name: "SAP HA Prepare Pacemaker - Block when no STONITH resource is defined" +- name: "SAP HA Prepare Pacemaker - (STONITH) Block when no STONITH resource is defined" when: - ( sap_ha_pacemaker_cluster_stonith_custom is defined @@ -34,7 +34,7 @@ ) block: - - name: "SAP HA Prepare Pacemaker - Set STONITH to disabled when no fencing resource is defined" + - name: "SAP HA Prepare Pacemaker - (STONITH) Set to disabled when no fencing resource is defined" ansible.builtin.set_fact: sap_ha_pacemaker_cluster_cluster_properties: "{{ sap_ha_pacemaker_cluster_cluster_properties | combine({ 'stonith-enabled': false }) }}" @@ -53,13 +53,15 @@ # END of block for disabling stonith -- name: "SAP HA Prepare Pacemaker - Define cluster stonith properties" +- name: "SAP HA Prepare Pacemaker - (STONITH) Define cluster properties" when: - sap_ha_pacemaker_cluster_cluster_properties is defined - sap_ha_pacemaker_cluster_cluster_properties is iterable - sap_ha_pacemaker_cluster_cluster_properties | length > 0 ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_cluster_properties: + __sap_ha_pacemaker_cluster_cluster_properties: "{{ __sap_ha_pacemaker_cluster_cluster_properties | default([]) + __stonith_properties }}" + vars: + __stonith_properties: - attrs: |- {% set attrs = __sap_ha_pacemaker_cluster_cluster_properties | map(attribute='attrs') | flatten -%} {%- for default_cluster_properties in (sap_ha_pacemaker_cluster_cluster_properties | dict2items) -%} @@ -83,7 +85,7 @@ # - generic pacemaker fence resource options # (see defaults: sap_ha_pacemaker_cluster_fence_options) -- name: "SAP HA Prepare Pacemaker - Assemble the stonith resource definition from platform default" +- name: "SAP HA Prepare Pacemaker - (STONITH) Assemble the resource definition from platform default" when: - sap_ha_pacemaker_cluster_stonith_default is defined - sap_ha_pacemaker_cluster_stonith_custom is not defined @@ -117,7 +119,7 @@ {%- endfor %} {{ attrs }} -- name: "SAP HA Prepare Pacemaker - Assemble the stonith resources from custom definition" +- name: "SAP HA Prepare Pacemaker - (STONITH) Assemble the resources from custom definition" when: - sap_ha_pacemaker_cluster_stonith_custom is defined ansible.builtin.set_fact: @@ -144,7 +146,7 @@ # The STONITH resource is an element in the cluster_resource_primitives list -- name: "SAP HA Prepare Pacemaker - Construct stonith resources definition" +- name: "SAP HA Prepare Pacemaker - (STONITH) Construct resources definition" when: - __sap_ha_pacemaker_cluster_stonith_resource is defined ansible.builtin.set_fact: diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_resources_default.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_resources_default.yml index 98a49b57c..fda53ca9b 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_resources_default.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_resources_default.yml @@ -2,7 +2,7 @@ # Reminder: This file is included in a loop over a dictionary. # VIP resource definition itself -- name: "SAP HA Prepare Pacemaker - Add resource: VIP {{ vip_list_item.key }}" +- name: "SAP HA Prepare Pacemaker - Add resource: VIP {{ vip_list_item.key }} ({{ sap_ha_pacemaker_cluster_vip_resource_agent }})" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_vip] }}" vars: @@ -17,3 +17,4 @@ value: "{{ sap_ha_pacemaker_cluster_vip_client_interface }}" when: - __sap_ha_pacemaker_cluster_vip_resource_id not in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) + - '"IPaddr2" in sap_ha_pacemaker_cluster_vip_resource_agent' diff --git a/roles/sap_ha_pacemaker_cluster/tasks/import_hacluster_vars_from_inventory.yml b/roles/sap_ha_pacemaker_cluster/tasks/import_hacluster_vars_from_inventory.yml new file mode 100644 index 000000000..6598e8ff3 --- /dev/null +++ b/roles/sap_ha_pacemaker_cluster/tasks/import_hacluster_vars_from_inventory.yml @@ -0,0 +1,94 @@ +--- +# If there are "ha_cluster" Linux System Role parameters already defined in the +# inventory, we will include these custom specifications and they take precedence. + +# Only parameters which need to be adjusted or enhanced by the SAP HA role +# need to be included here. + + +### Take the following template to add additional parameters to be inherited: +# - name: "SAP HA Prepare Pacemaker - Register ha_cluster_" +# ansible.builtin.set_fact: +# __sap_ha_pacemaker_cluster_: "{{ ha_cluster_ }}" +# when: ha_cluster_ is defined + + +# ha_cluster +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Register parameter 'ha_cluster'" + when: ha_cluster is defined + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_ha_cluster: "{{ ha_cluster }}" + +# ha_cluster_cluster_name +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Register parameter 'ha_cluster_cluster_name'" + when: ha_cluster_cluster_name is defined + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_cluster_name: "{{ ha_cluster_cluster_name }}" + +# ha_cluster_cluster_properties +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Register parameter 'ha_cluster_cluster_properties'" + when: ha_cluster_cluster_properties is defined + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_cluster_properties: "{{ ha_cluster_cluster_properties }}" + +#__sap_ha_pacemaker_cluster_resource_groups ha_cluster_constraints_colocation +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Register parameter 'ha_cluster_constraints_colocation'" + when: ha_cluster_constraints_colocation is defined + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_constraints_colocation: "{{ ha_cluster_constraints_colocation }}" + +# ha_cluster_constraints_location +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Register parameter 'ha_cluster_constraints_location'" + when: ha_cluster_constraints_location is defined + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_constraints_location: "{{ ha_cluster_constraints_location }}" + +# ha_cluster_constraints_order +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Register parameter 'ha_cluster_constraints_order'" + when: ha_cluster_constraints_order is defined + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_constraints_order: "{{ ha_cluster_constraints_order }}" + +# ha_cluster_extra_packages +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Register parameter 'ha_cluster_extra_packages'" + when: ha_cluster_extra_packages is defined + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_extra_packages: "{{ ha_cluster_extra_packages }}" + +# ha_cluster_fence_agent_packages +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Register parameter 'ha_cluster_fence_agent_packages'" + when: ha_cluster_fence_agent_packages is defined + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_fence_agent_packages: "{{ ha_cluster_fence_agent_packages }}" + +# ha_cluster_hacluster_password +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Register parameter 'ha_cluster_repos'" + when: ha_cluster_hacluster_password is defined + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_hacluster_password: "{{ ha_cluster_hacluster_password }}" + no_log: true # handle credentials with care + +# ha_cluster_repos +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Register parameter 'ha_cluster_repos'" + when: ha_cluster_repos is defined + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_repos: "{{ ha_cluster_repos }}" + +# ha_cluster_resource_clones +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Register parameter 'ha_cluster_resource_clones'" + when: ha_cluster_resource_clones is defined + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_resource_clones: "{{ ha_cluster_resource_clones }}" + +# ha_cluster_resource_groups +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Register parameter 'ha_cluster_resource_groups'" + when: ha_cluster_resource_groups is defined + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_resource_groups: "{{ ha_cluster_resource_groups }}" + +# ha_cluster_resource_primitives +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Register parameter 'ha_cluster_resource_primitives'" + when: ha_cluster_resource_primitives is defined + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_resource_primitives: "{{ ha_cluster_resource_primitives }}" + no_log: true # be paranoid, there could be credentials in it diff --git a/roles/sap_ha_pacemaker_cluster/tasks/include_construct_vip_resources.yml b/roles/sap_ha_pacemaker_cluster/tasks/include_construct_vip_resources.yml index 1007f703b..7d2d2ad03 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/include_construct_vip_resources.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/include_construct_vip_resources.yml @@ -40,8 +40,8 @@ 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 != '' + - sap_ha_pacemaker_cluster_vip_method == 'ipaddr' + - vip_list_item.value | length > 0 - name: "SAP HA Prepare Pacemaker - Include variable construction for platform VIP resources" @@ -52,8 +52,8 @@ 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 != '' + - sap_ha_pacemaker_cluster_vip_method != 'ipaddr' + - vip_list_item.value | length > 0 - name: "SAP HA Prepare Pacemaker - Include variable construction for SAP Hana VIP constraints" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/main.yml b/roles/sap_ha_pacemaker_cluster/tasks/main.yml index 8d7f4e92d..f13fe361a 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/main.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/main.yml @@ -21,8 +21,8 @@ # Make sure that all parameters already set for 'ha_cluster' are also inherited. # Add to this file a task for EACH parameter which this SAP cluster role # supports. -- name: "SAP HA Prepare Pacemaker - Include tasks for checking 'ha_cluster' predefinitions" - ansible.builtin.import_tasks: ascertain_ha_cluster_in_inventory.yml +- name: "SAP HA Prepare Pacemaker - Include tasks from 'ha_cluster' role definitions" + ansible.builtin.import_tasks: import_hacluster_vars_from_inventory.yml - name: "SAP HA Prepare Pacemaker - Include facts and common variables" ansible.builtin.import_tasks: include_vars_common.yml @@ -94,6 +94,17 @@ when: - "'nwas_java' in nwas_build_item" +# All of the SAP HA role constructed parameters must be translated to +# 'ha_cluster' Linux System Role parameters. +- name: "SAP HA Prepare Pacemaker - Translate all parameters to 'ha_cluster' input variables" + ansible.builtin.include_tasks: + file: construct_final_hacluster_vars.yml + + +########################################################## +# BLOCK which covers actual changes on the target systems +########################################################## + - name: "SAP HA Install Pacemaker - Block with actual changes" block: @@ -124,20 +135,6 @@ - __sap_ha_pacemaker_cluster_disable_services.failed - '"Could not find the requested service" not in __sap_ha_pacemaker_cluster_disable_services.msg' - # Before we are ready to call the ha_cluster role, we want to validate - # that the minimum required parameters are defined and not empty. - # TODO: make this smarter, currently all these vars are pre-defined anyway - - name: "SAP HA Install Pacemaker - Validate parameters for 'ha_cluster' role input" - ansible.builtin.assert: - that: - - __sap_ha_pacemaker_cluster_cluster_properties is defined - - __sap_ha_pacemaker_cluster_extra_packages is defined - - __sap_ha_pacemaker_cluster_resource_primitives is defined - - __sap_ha_pacemaker_cluster_resource_clones is defined - - __sap_ha_pacemaker_cluster_constraints_order is defined - - __sap_ha_pacemaker_cluster_constraints_colocation is defined - fail_msg: "Cluster build parameter construction has failed for this parameter." - - name: "SAP HA Install Pacemaker - Query if CIB already exists" ansible.builtin.command: cmd: cibadmin --query @@ -166,21 +163,6 @@ apply: tags: ha_cluster no_log: true # some parameters contain secrets - no_log: true # some parameters contain secrets - vars: - __ha_cluster_repos: "{{ __sap_ha_pacemaker_cluster_repos }}" - ha_cluster_cluster_name: "{{ __sap_ha_pacemaker_cluster_cluster_name }}" - ha_cluster_constraints_order: "{{ __sap_ha_pacemaker_cluster_constraints_order }}" - ha_cluster_constraints_colocation: "{{ __sap_ha_pacemaker_cluster_constraints_colocation }}" - ha_cluster_constraints_location: "{{ __sap_ha_pacemaker_cluster_constraints_location }}" - ha_cluster_cluster_properties: "{{ __sap_ha_pacemaker_cluster_cluster_properties }}" - ha_cluster_extra_packages: "{{ __sap_ha_pacemaker_cluster_extra_packages }}" - ha_cluster_fence_agent_packages: "{{ __sap_ha_pacemaker_cluster_fence_agent_packages }}" - ha_cluster_hacluster_password: "{{ __sap_ha_pacemaker_cluster_hacluster_password }}" - ha_cluster_properties: "{{ __sap_ha_pacemaker_cluster_cluster_properties }}" - ha_cluster_resource_clones: "{{ __sap_ha_pacemaker_cluster_resource_clones }}" - ha_cluster_resource_groups: "{{ __sap_ha_pacemaker_cluster_resource_groups }}" - ha_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives }}" tags: ha_cluster # Resource defaults settings were added to "ha_cluster" in Apr 2023 (GH version 1.9.0) diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/ascertain_platform_type.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/ascertain_platform_type.yml index 26715c375..a12ee9c30 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/ascertain_platform_type.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/ascertain_platform_type.yml @@ -98,12 +98,12 @@ ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_platform: cloud_ibmcloud_powervs -#- name: "SAP HA Prepare Pacemaker - Check if platform is IBM PowerVC" -# when: -# - ansible_architecture == "ppc64le" -# - '"ibmcloud" not in __sap_ha_pacemaker_cluster_power_rsct_hscid.stdout' -# ansible.builtin.set_fact: -# __sap_ha_pacemaker_cluster_platform: hyp_ibmpower_vm +- name: "SAP HA Prepare Pacemaker - Check if platform is IBM PowerVM" + when: + - ansible_architecture == "ppc64le" + - '"ibmcloud" not in __sap_ha_pacemaker_cluster_power_rsct_hscid.stdout' + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_platform: hyp_ibmpower_vm #- name: "SAP HA Prepare Pacemaker - Check if platform is VMware vSphere" # when: diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/include_vars_platform.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/include_vars_platform.yml index f48692a74..2779d9d65 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/include_vars_platform.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/include_vars_platform.yml @@ -20,10 +20,10 @@ {% endfor %} when: __sap_ha_pacemaker_cluster_platform == "cloud_aws_ec2_vs" - - name: "SAP HA Prepare Pacemaker - IBM Power VS from IBM Cloud - Set variable for fencing agent" ansible.builtin.set_fact: sap_ha_pacemaker_cluster_ibmcloud_powervs_host_guid: "{{ __sap_ha_pacemaker_cluster_register_ibmcloud_powervs_host }}" + sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_guid: '{{ __sap_ha_pacemaker_cluster_register_ibmcloud_powervs_workspace_crn | replace("::","") | regex_replace(".*\:") }}' when: __sap_ha_pacemaker_cluster_platform == "cloud_ibmcloud_powervs" # pcmk_host_map format: :;:... @@ -31,7 +31,7 @@ ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_pcmk_host_map: |- {% for node in ansible_play_hosts_all -%} - {{ hostvars[node].ansible_hostname }}:{{ hostvars[node].sap_ha_pacemaker_cluster_ibmcloud_powervs_host_guid }} + {{ hostvars[node].ansible_hostname }}:{{ hostvars[node].sap_ha_pacemaker_cluster_ibmcloud_powervs_instance_id }} {%- if not loop.last %};{% endif %} {% endfor %} when: __sap_ha_pacemaker_cluster_platform == "cloud_ibmcloud_powervs" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_powervs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_powervs.yml index c31078c72..63be853f6 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_powervs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_powervs.yml @@ -1,9 +1,11 @@ --- # Ansible facts rely on SMBIOS/DMI, which does not exist on ppc64le CPU Architecture. -# Identify from RSCT binary instead. -- name: "SAP HA Prepare Pacemaker - IBM Power VS from IBM Cloud - Register instance ID" + +# alt command using IBM Power RSCT binary: /opt/rsct/bin/ctgethscid | grep PartitionUUID | cut -d \" -f2 +# alt command using cloud-init data: cat /run/cloud-init/instance-data.json | grep uuid | cut -d \" -f4 +- name: SAP HA Prepare Pacemaker - IBM Power VS from IBM Cloud - IBM Power Virtual Server instance ID ansible.builtin.shell: | - /opt/rsct/bin/ctgethscid -value PartitionUUID - register: __sap_ha_pacemaker_cluster_register_ibmcloud_powervs_host + set -o pipefail && echo $(tr -d '\0' < /proc/device-tree/ibm,partition-name) + register: __sap_ha_pacemaker_cluster_register_ibmcloud_powervs_workspace_guid changed_when: false check_mode: false diff --git a/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml b/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml index 6d77a1c67..00bfc6eec 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml @@ -11,6 +11,28 @@ when: - sap_ha_pacemaker_cluster_host_type | select('search', 'hana') | length > 0 +- name: "SAP HA Prepare Pacemaker - (SAP HANA) Validate SAP Instance Number" + ansible.builtin.assert: + that: + - ( + sap_ha_pacemaker_cluster_hana_instance_number | type_debug != 'int' + and sap_ha_pacemaker_cluster_hana_instance_number | length == 2 + ) + or + ( + sap_ha_pacemaker_cluster_hana_instance_number | type_debug == 'int' + and sap_ha_pacemaker_cluster_hana_instance_number is regex("^[0-9][0-9]$") + ) + fail_msg: | + + Host type = {{ sap_ha_pacemaker_cluster_host_type }} + Requires 'sap_ha_pacemaker_cluster_hana_instance_number' to be defined. + + The instance number must be exactly 2 digits. + Add quotes if the number starts with a 0! + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'hana') | length > 0 + - name: "SAP HA Prepare Pacemaker - (SAP NetWeaver) Validate SAP System ID" ansible.builtin.assert: that: @@ -22,6 +44,37 @@ when: - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas') | length > 0 +- name: "SAP HA Prepare Pacemaker - (SAP NetWeaver) Validate SAP Instance Number" + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap') | length > 0 + ansible.builtin.assert: + that: + - ( + ascs_ers_nr_item | type_debug != 'int' + and ascs_ers_nr_item | length == 2 + ) + or + ( + ascs_ers_nr_item | type_debug == 'int' + and ascs_ers_nr_item is regex("^[0-9][0-9]$") + ) + fail_msg: | + + Host type = {{ sap_ha_pacemaker_cluster_host_type }} + Requires the ASCS/ERS instance numbers to be defined: + - sap_ha_pacemaker_cluster_netweaver_abap_ascs_instance_number + - sap_ha_pacemaker_cluster_netweaver_abap_ers_instance_number + + The instance number must be exactly 2 digits. + Add quotes if the number starts with a 0! + + loop: + - "{{ sap_ha_pacemaker_cluster_netweaver_abap_ascs_instance_number }}" + - "{{ sap_ha_pacemaker_cluster_netweaver_abap_ers_instance_number }}" + loop_control: + loop_var: ascs_ers_nr_item + + # NIC definition validation - name: "SAP HA Prepare Pacemaker - Verify that a custom NIC name is defined when multiple NICs exist" ansible.builtin.assert: diff --git a/roles/sap_ha_pacemaker_cluster/templates/cluster_create_config.j2 b/roles/sap_ha_pacemaker_cluster/templates/cluster_create_config.j2 index 5f35649d0..87a96a067 100644 --- a/roles/sap_ha_pacemaker_cluster/templates/cluster_create_config.j2 +++ b/roles/sap_ha_pacemaker_cluster/templates/cluster_create_config.j2 @@ -5,66 +5,46 @@ # Created by: {{ ansible_role_name }} # The name of the cluster -ha_cluster_cluster_name: {{ __sap_ha_pacemaker_cluster_cluster_name }} +ha_cluster_cluster_name: {{ ha_cluster_cluster_name | default('') }} -{% if __sap_ha_pacemaker_cluster_cluster_properties is defined and __sap_ha_pacemaker_cluster_cluster_properties|length > 0 %} # Properties that enable and control cluster behavior ha_cluster_cluster_properties: -{{ __sap_ha_pacemaker_cluster_cluster_properties | to_nice_yaml(indent=2) }} -{%- endif %} +{{ ha_cluster_cluster_properties | default() | to_nice_yaml(indent=2) }} -{% if __sap_ha_pacemaker_cluster_constraints_colocation is defined and __sap_ha_pacemaker_cluster_constraints_colocation|length > 0 %} # Definition of resources which depend on other resources ha_cluster_constraints_colocation: -{{ __sap_ha_pacemaker_cluster_constraints_colocation | to_nice_yaml(indent=2) }} -{%- endif -%} +{{ ha_cluster_constraints_colocation | default() | to_nice_yaml(indent=2) }} -{% if __sap_ha_pacemaker_cluster_constraints_location is defined and __sap_ha_pacemaker_cluster_constraints_location|length > 0 %} # Definition of resources which have specific location dependencies or preferences ha_cluster_constraints_location: -{{ __sap_ha_pacemaker_cluster_constraints_location | to_nice_yaml(indent=2) }} -{%- endif %} +{{ ha_cluster_constraints_location | default() | to_nice_yaml(indent=2) }} -{% if __sap_ha_pacemaker_cluster_constraints_order is defined and __sap_ha_pacemaker_cluster_constraints_order|length > 0 %} # Definition of an order in which resources must be started. # They are automatically stopped in reverse order. ha_cluster_constraints_order: -{{ __sap_ha_pacemaker_cluster_constraints_order | to_nice_yaml(indent=2) }} -{%- endif %} +{{ ha_cluster_constraints_order | default() | to_nice_yaml(indent=2) }} -{% if __sap_ha_pacemaker_cluster_extra_packages is defined and __sap_ha_pacemaker_cluster_extra_packages|length > 0 %} # Extra packages that are needed for this HA environment ha_cluster_extra_packages: -{{ __sap_ha_pacemaker_cluster_extra_packages | to_nice_yaml(indent=2) }} -{%- endif %} +{{ ha_cluster_extra_packages | default() | to_nice_yaml(indent=2) }} -{% if __sap_ha_pacemaker_cluster_fence_agent_packages is defined and __sap_ha_pacemaker_cluster_fence_agent_packages|length > 0 %} # Fence agent package(s) for this HA environment ha_cluster_fence_agent_packages: -{{ __sap_ha_pacemaker_cluster_fence_agent_packages | to_nice_yaml(indent=2) }} -{%- endif %} +{{ ha_cluster_fence_agent_packages | default() | to_nice_yaml(indent=2) }} -{% if __sap_ha_pacemaker_cluster_repos is defined and __sap_ha_pacemaker_cluster_repos|length > 0 %} # Definition of repositories to enable (if disable) to ensure # access to all required packages __ha_cluster_repos: -{{ __sap_ha_pacemaker_cluster_repos | to_nice_yaml(indent=2) }} -{%- endif %} +{{ __ha_cluster_repos | default() | to_nice_yaml(indent=2) }} -{% if __sap_ha_pacemaker_cluster_resource_clones is defined and __sap_ha_pacemaker_cluster_resource_clones|length > 0 %} # Definition of resources that are cloned and monitored on all nodes ha_cluster_resource_clones: -{{ __sap_ha_pacemaker_cluster_resource_clones | to_nice_yaml(indent=2) }} -{%- endif %} +{{ ha_cluster_resource_clones | default() | to_nice_yaml(indent=2) }} -{% if __sap_ha_pacemaker_cluster_resource_groups is defined and __sap_ha_pacemaker_cluster_resource_groups|length > 0 %} # Definition of resources that are grouped together ha_cluster_resource_groups: -{{ __sap_ha_pacemaker_cluster_resource_groups | to_nice_yaml(indent=2) }} -{%- endif %} +{{ ha_cluster_resource_groups | default() | to_nice_yaml(indent=2) }} -{% if __sap_ha_pacemaker_cluster_resource_primitives is defined and __sap_ha_pacemaker_cluster_resource_primitives|length > 0 %} # Definition of all cluster resources ha_cluster_resource_primitives: -{{ __sap_ha_pacemaker_cluster_resource_primitives | to_nice_yaml(indent=2) }} -{%- endif %} +{{ ha_cluster_resource_primitives | default()| to_nice_yaml(indent=2) }} diff --git a/roles/sap_ha_pacemaker_cluster/vars/hana_scaleout_common.yml b/roles/sap_ha_pacemaker_cluster/vars/hana_scaleout_common.yml index 4e356cae9..4175257b5 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/hana_scaleout_common.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/hana_scaleout_common.yml @@ -3,7 +3,7 @@ # # TODO: make sure to first respect 'ha_cluster' native variables -sap_ha_pacemaker_cluster_sap_extra_packages: +__sap_ha_pacemaker_cluster_sap_extra_packages: - resource-agents-sap-hana-scaleout sap_ha_pacemaker_cluster_ra_hana: SAPHanaController diff --git a/roles/sap_ha_pacemaker_cluster/vars/hana_scaleup_common.yml b/roles/sap_ha_pacemaker_cluster/vars/hana_scaleup_common.yml index 5c76b2497..85043b5c5 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/hana_scaleup_common.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/hana_scaleup_common.yml @@ -3,7 +3,7 @@ # # TODO: make sure to first respect 'ha_cluster' native variables -sap_ha_pacemaker_cluster_sap_extra_packages: +__sap_ha_pacemaker_cluster_sap_extra_packages: - resource-agents-sap-hana sap_ha_pacemaker_cluster_ra_hana: SAPHana diff --git a/roles/sap_ha_pacemaker_cluster/vars/main.yml b/roles/sap_ha_pacemaker_cluster/vars/main.yml index 27b93aee8..22384d3de 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/main.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/main.yml @@ -31,15 +31,13 @@ __sap_ha_pacemaker_cluster_required_facts: # This is automatically adjusted during preparation tasks. __sap_ha_pacemaker_cluster_nic_multi_bool: false -# Define empty parameters to avoid undefined input variables. -# The arguments_spec check complains. -# The actual values must be empty, they are set by various tasks! +# By default use the construction of IPaddr2 VIP resources. +# Platforms define different methods as applicable. +sap_ha_pacemaker_cluster_vip_method: ipaddr # (cloud) platform helper variable - leave empty for default = not cloud __sap_ha_pacemaker_cluster_platform: '' -__sap_ha_pacemaker_cluster_supported_platforms: - - cloud_aws_ec2_vs - - cloud_msazure_vm + # ATTENTION: # Any variables for 'ha_cluster' which this SAP role supports/inherits should also @@ -48,14 +46,26 @@ __sap_ha_pacemaker_cluster_supported_platforms: # - conditionals (if applicable) # - config report template # -__sap_ha_pacemaker_cluster_cluster_name: '' +# TODO: verify that the task flow logic works without these explicit +# pre-definitions. Otherwise there is a need to hard-code parameters +# which have defaults in the 'ha_cluster' LSR. +# Remove this section when validated. +# +# Never set defaults for these: +#__sap_ha_pacemaker_cluster_cluster_name: +#__sap_ha_pacemaker_cluster_hacluster_password: + + +# Pre-define internal optional parameters to avoid defaults in the code: +__sap_ha_pacemaker_cluster_sap_extra_packages: [] +__sap_ha_pacemaker_cluster_platform_extra_packages: [] + __sap_ha_pacemaker_cluster_cluster_properties: [] __sap_ha_pacemaker_cluster_constraints_colocation: [] __sap_ha_pacemaker_cluster_constraints_location: [] __sap_ha_pacemaker_cluster_constraints_order: [] __sap_ha_pacemaker_cluster_extra_packages: [] __sap_ha_pacemaker_cluster_fence_agent_packages: [] -__sap_ha_pacemaker_cluster_hacluster_password: __sap_ha_pacemaker_cluster_repos: [] __sap_ha_pacemaker_cluster_resource_primitives: [] __sap_ha_pacemaker_cluster_resource_groups: [] diff --git a/roles/sap_ha_pacemaker_cluster/vars/nwas_common.yml b/roles/sap_ha_pacemaker_cluster/vars/nwas_common.yml index 21dd17d20..e23244431 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/nwas_common.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/nwas_common.yml @@ -3,5 +3,5 @@ # # TODO: make sure to first respect 'ha_cluster' native variables -sap_ha_pacemaker_cluster_sap_extra_packages: +__sap_ha_pacemaker_cluster_sap_extra_packages: - resource-agents-sap diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml index 9153f6591..238960267 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml @@ -6,7 +6,7 @@ sap_ha_pacemaker_cluster_fence_agent_packages: - fence-agents-aws -sap_ha_pacemaker_cluster_platform_extra_packages: +__sap_ha_pacemaker_cluster_platform_extra_packages: - awscli __sap_ha_pacemaker_cluster_repos: diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml index 160f6135d..34e9ade20 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml @@ -6,7 +6,7 @@ sap_ha_pacemaker_cluster_fence_agent_packages: - fence-agents-gce -sap_ha_pacemaker_cluster_platform_extra_packages: +__sap_ha_pacemaker_cluster_platform_extra_packages: - resource-agents-gcp __sap_ha_pacemaker_cluster_repos: diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml index af35b0202..82e71e1c9 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml @@ -6,7 +6,7 @@ sap_ha_pacemaker_cluster_fence_agent_packages: - fence-agents-ibm-powervs -#sap_ha_pacemaker_cluster_platform_extra_packages: +#__sap_ha_pacemaker_cluster_platform_extra_packages: # - __sap_ha_pacemaker_cluster_repos: @@ -28,10 +28,10 @@ sap_ha_pacemaker_cluster_stonith_default: token: "{{ sap_ha_pacemaker_cluster_ibmcloud_api_key }}" region: "{{ sap_ha_pacemaker_cluster_ibmcloud_region }}" crn: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_crn }}" - instance: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_guid }}" - plug: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_host_guid }}" # Identified during execution initial tasks, populated when variables are imported - api-type: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_api_type | default('private') }}" - proxy: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_forward_proxy_url }}" + instance: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_guid }}" # Identified during execution initial tasks, populated when variables are imported + plug: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_instance_id }}" # Identified during execution initial tasks, populated when variables are imported + api-type: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_api_type | default('public') }}" # Dependent on network interface attachments, if no public network interface then 'private' value must be provided. + proxy: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_forward_proxy_url | default('') }}" # Dependent on network interface attachments, if no public network interface then a valid HTTP Proxy URL value must be provided. sap_ha_pacemaker_cluster_fence_options: pcmk_reboot_retries: 4 diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml index 5430a4608..076495c61 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml @@ -6,7 +6,7 @@ sap_ha_pacemaker_cluster_fence_agent_packages: - fence-agents-ibm-vpc -#sap_ha_pacemaker_cluster_platform_extra_packages: +#__sap_ha_pacemaker_cluster_platform_extra_packages: # - __sap_ha_pacemaker_cluster_repos: diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml index 2d056bf12..cf23a19a2 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml @@ -6,7 +6,7 @@ sap_ha_pacemaker_cluster_fence_agent_packages: - fence-agents-azure-arm -sap_ha_pacemaker_cluster_platform_extra_packages: +__sap_ha_pacemaker_cluster_platform_extra_packages: - socat __sap_ha_pacemaker_cluster_repos: diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml index dfcb407fd..083622f47 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml @@ -6,7 +6,7 @@ sap_ha_pacemaker_cluster_fence_agent_packages: - fence-agents-lpar -#sap_ha_pacemaker_cluster_platform_extra_packages: +#__sap_ha_pacemaker_cluster_platform_extra_packages: # - __sap_ha_pacemaker_cluster_repos: