From 6bfd82cdcb2650a34ea29c29664f5141c2a2cedd Mon Sep 17 00:00:00 2001 From: Bill Anastasiadis Date: Mon, 20 Jan 2025 10:17:17 +0100 Subject: [PATCH] Replace pacemaker deprecated commands for Azure --- .../playbooks/tasks/azure-cluster-hana.yaml | 46 +++++++++++++++++-- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/ansible/playbooks/tasks/azure-cluster-hana.yaml b/ansible/playbooks/tasks/azure-cluster-hana.yaml index 5813d824..fc65625b 100644 --- a/ansible/playbooks/tasks/azure-cluster-hana.yaml +++ b/ansible/playbooks/tasks/azure-cluster-hana.yaml @@ -98,7 +98,11 @@ AUTOMATED_REGISTER="false" when: hana_resource | length == 0 -- name: Create HANA resource clone +- name: Gather the package facts to check cloud-regionsrv-client in 15sp2 + ansible.builtin.package_facts: + manager: auto + +- name: Create HANA resource clone [deprecated - <15sp4] ansible.builtin.command: cmd: >- crm configure ms @@ -111,7 +115,27 @@ target-role="Started" interleave="true" maintenance="true" - when: hana_clone | length == 0 + when: + - hana_clone | length == 0 + - ansible_facts.packages['pacemaker'][0].version is version('2.1.9', '<') + +- name: Create HANA resource clone [non-deprecated - >=15sp4] + ansible.builtin.command: + cmd: >- + crm configure clone + msl_SAPHanaCtl_{{ sap_hana_install_sid }}_HDB{{ sap_hana_install_instance_number }} + {{ rsc_saphanactl }} + meta + notify="true" + clone-max="2" + clone-node-max="1" + target-role="Started" + interleave="true" + maintenance="true" + promotable="true" + when: + - hana_clone | length == 0 + - ansible_facts.packages['pacemaker'][0].version is version('2.1.9', '>=') - name: Validate cluster IP vars: @@ -158,7 +182,7 @@ {{ rsc_socat }} when: ip_grp | length == 0 -- name: Configure hana/IP colocation +- name: Configure hana/IP colocation [deprecated - <15sp4] ansible.builtin.command: cmd: >- crm configure colocation @@ -166,7 +190,21 @@ 4000: g_ip_{{ sap_hana_install_sid }}_HDB{{ sap_hana_install_instance_number }}:Started msl_SAPHanaCtl_{{ sap_hana_install_sid }}_HDB{{ sap_hana_install_instance_number }}:Master - when: ip_colo | length == 0 + when: + - ip_colo | length == 0 + - ansible_facts.packages['pacemaker'][0].version is version('2.1.9', '<') + +- name: Configure hana/IP colocation [non-deprecated - >=15sp4] + ansible.builtin.command: + cmd: >- + crm configure colocation + col_saphana_ip_{{ sap_hana_install_sid }}_HDB{{ sap_hana_install_instance_number }} + 4000: + g_ip_{{ sap_hana_install_sid }}_HDB{{ sap_hana_install_instance_number }}:Started + msl_SAPHanaCtl_{{ sap_hana_install_sid }}_HDB{{ sap_hana_install_instance_number }}:Promoted + when: + - ip_colo | length == 0 + - ansible_facts.packages['pacemaker'][0].version is version('2.1.9', '>=') - name: Configure order ansible.builtin.command: