Skip to content

Commit

Permalink
Merge pull request #310 from BillAnastasiadis/depr_awsgcp
Browse files Browse the repository at this point in the history
Replace depracated crm commands aws/gcp
  • Loading branch information
BillAnastasiadis authored Jan 22, 2025
2 parents 4bfbdbb + 55f7dfc commit 7f6e479
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions ansible/playbooks/tasks/cluster-hana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@
when: is_primary
changed_when: false

- name: Gather package facts
ansible.builtin.package_facts:
manager: auto

- name: Set variables for clone command and promoted term
set_fact:
clone_command: >-
{{ 'ms' if ansible_facts.packages['pacemaker'][0].version is version('2.1.9', '<')
else 'clone' }}
promoted_term: >-
{{ 'Master' if ansible_facts.packages['pacemaker'][0].version is version('2.1.9', '<')
else 'Promoted' }}
- name: Ensure maintenance mode is active
ansible.builtin.command:
cmd: crm maintenance on
Expand Down Expand Up @@ -114,7 +127,7 @@
- name: Create HANA resource clone
ansible.builtin.command:
cmd: >-
crm configure ms
crm configure {{ clone_command }}
{{ ms_saphanactl }}
{{ rsc_saphanactl }}
meta
Expand All @@ -123,6 +136,7 @@
clone-node-max="1"
target-role="Started"
interleave="true"
{% if clone_command == 'clone' %}promotable="true"{% endif %}
when:
- is_primary
- hana_clone | length == 0
Expand Down Expand Up @@ -172,7 +186,7 @@
col_saphana_ip_{{ sap_hana_install_sid }}_HDB{{ sap_hana_install_instance_number }}
2000:
rsc_ip_{{ sap_hana_install_sid }}_HDB{{ sap_hana_install_instance_number }}:Started
{{ ms_saphanactl }}:Master
{{ ms_saphanactl }}:{{ promoted_term }}
when:
- is_primary
- ip_colo | length == 0
Expand All @@ -185,7 +199,7 @@
col_saphana_ip_{{ sap_hana_install_sid }}_HDB{{ sap_hana_install_instance_number }}
4000:
rsc_ip_{{ sap_hana_install_sid }}_HDB{{ sap_hana_install_instance_number }}:Started
{{ ms_saphanactl }}:Master
{{ ms_saphanactl }}:{{ promoted_term }}
when:
- is_primary
- ip_colo | length == 0
Expand Down

0 comments on commit 7f6e479

Please sign in to comment.