Skip to content

Commit

Permalink
Fix all use_sbd usage
Browse files Browse the repository at this point in the history
Remove asignment to constant value
Add debug task to print what is coming from the external
  • Loading branch information
mpagot committed Oct 18, 2023
1 parent 17dbd8b commit 8150c25
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
5 changes: 4 additions & 1 deletion ansible/playbooks/hana-cluster-prep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

tasks:
# tasks sourced from https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
- name: Variable use_sbd
ansible.builtin.debug:
msg: "Cloud platform appears to be use_sbd:{{ use_sbd }} use_sbd bool:{{ use_sbd | bool }} use_sbd string:{{ use_sbd | string | lower == 'false' }}"

- name: Set fact
- name: Set fact
ansible.builtin.set_fact:
sbd: "{{ use_sbd | default('true') }}"

Expand Down
21 changes: 10 additions & 11 deletions ansible/playbooks/sap-hana-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# corosync variables
crypto_hash: sha1
crypto_cipher: aes256

handlers:
- name: Restart systemd daemon
ansible.builtin.systemd:
Expand All @@ -27,19 +27,18 @@
state: started

pre_tasks:
- name: Detect cloud platform
ansible.builtin.include_tasks:
./tasks/detect-cloud-platform.yaml
- name: Detection result
ansible.builtin.debug:
msg: "Cloud platform appears to be {{ cloud_platform_name }}"
- name: Detect cloud platform
ansible.builtin.include_tasks:
./tasks/detect-cloud-platform.yaml

- name: Load SAP HANA variables
ansible.builtin.include_vars: ./vars/hana_vars.yaml
- name: Detection result
ansible.builtin.debug:
msg: "Cloud platform appears to be {{ cloud_platform_name }}"

tasks:
- name: Load SAP HANA variables
ansible.builtin.include_vars: ./vars/hana_vars.yaml

tasks:
- name: Include AWS variables
ansible.builtin.include_vars: ../../terraform/aws/aws_cluster_data.yaml
when: cloud_platform_is_aws
Expand Down
4 changes: 4 additions & 0 deletions ansible/playbooks/tasks/azure-cluster-hana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
ansible.builtin.command: "crm configure primitive rsc_SAPHanaTopology_HDB_{{ sap_hana_install_sid }}{{ sap_hana_install_instance_number }} ocf:suse:SAPHanaTopology operations $id=\"rsc_sap2_HDB_{{ sap_hana_install_sid }}{{ sap_hana_install_instance_number }}-operations\" op monitor interval=\"10\" timeout=\"600\" op start interval=\"0\" timeout=\"600\" op stop interval=\"0\" timeout=\"300\" params SID=\"{{ sap_hana_install_sid }}\" InstanceNumber=\"{{ sap_hana_install_instance_number }}\""
when: hana_topology_resource | length == 0

- name: Variable use_sbd
ansible.builtin.debug:
msg: "Cloud platform appears to be use_sbd:{{ use_sbd }} use_sbd bool:{{ use_sbd | bool }} use_sbd string:{{ use_sbd | string | lower == 'false' }}"

- name: Set stonith-timeout [sdb]
ansible.builtin.command: crm configure property stonith-timeout=144
when:
Expand Down
6 changes: 5 additions & 1 deletion ansible/playbooks/tasks/cluster-bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,15 @@
migration_threshold: "{{ (crm_rsc_options_show.stdout | regex_search('migration-threshold=([0-9]*)', '\\1'))[0] | default('false') }}"
op_default_timeout: "{{ (crm_op_options_show.stdout | regex_search('timeout=([0-9]*)', '\\1'))[0] | default('false') }}"

- name: Variable use_sbd
ansible.builtin.debug:
msg: "Cloud platform appears to be use_sbd:{{ use_sbd }} use_sbd bool:{{ use_sbd | bool }} use_sbd string:{{ use_sbd | string | lower == 'false' }}"

- name: Enable SBD [sbd]
ansible.builtin.command: crm configure primitive rsc_iscsi_sbd stonith:external/sbd
when:
- sbd_stonith | string | lower == 'false'
- use_sbd
- use_sbd | bool
- is_primary

- name: Set stonith-timeout [sdb]
Expand Down

0 comments on commit 8150c25

Please sign in to comment.