|
83 | 83 | ansible.builtin.set_fact: |
84 | 84 | hana_prevalidate_pacemaker_ge_2_1_7: "{{ ansible_facts.packages['pacemaker'][0].version is version('2.1.7', '>=') }}" |
85 | 85 |
|
86 | | -# Wait for sync and healthy cluster |
87 | 86 | - name: Wait for cluster idle |
88 | 87 | ansible.builtin.command: cs_wait_for_idle --sleep 5 |
89 | 88 | retries: 48 |
|
203 | 202 | register: hana_prevalidate_crm_mon_report |
204 | 203 | changed_when: false |
205 | 204 | become: true |
| 205 | + |
| 206 | +- name: Run HDBSettings.sh landscapeHostConfiguration.py for HANA landscape validation |
| 207 | + ansible.builtin.command: "su - {{ sap_sid | lower }}adm -c 'HDBSettings.sh landscapeHostConfiguration.py'" |
| 208 | + register: hana_landscape_config |
| 209 | + changed_when: false |
| 210 | + failed_when: "'overall host status: ok' not in hana_landscape_config.stdout" |
| 211 | + become: true |
| 212 | + environment: |
| 213 | + HANA_HOME: "/usr/sap/{{ sap_sid | default('HA0') }}/HDB{{ instance_num | default('00') }}" |
| 214 | + tags: |
| 215 | + - hana_config_validation |
| 216 | + |
| 217 | +- name: Check for inconsistencies in HANA landscapeHostConfiguration output |
| 218 | + ansible.builtin.assert: |
| 219 | + that: |
| 220 | + - hana_landscape_config.stdout is not search('inconsistent') |
| 221 | + - hana_landscape_config.stdout is not search('ERROR') |
| 222 | + fail_msg: "HANA landscapeHostConfiguration.py reported inconsistencies or errors. Output:\n{{ hana_landscape_config.stdout }}" |
| 223 | + success_msg: "HANA landscapeHostConfiguration.py reported a consistent landscape configuration." |
| 224 | + when: hana_landscape_config.rc == 0 |
| 225 | + tags: |
| 226 | + - hana_config_validation |
| 227 | + |
| 228 | +- name: Run hdbnsutil -sr_stateConfiguration for HSR control plane validation |
| 229 | + ansible.builtin.command: "su - {{ sap_sid | lower }}adm -c '/usr/sap/{{ sap_sid | default('HA0') }}/HDB{{ instance_num | default('00') }}/exe/hdbnsutil -sr_stateConfiguration'" |
| 230 | + register: hdbnsutil_sr_state_configuration_output |
| 231 | + changed_when: false |
| 232 | + become: true |
| 233 | + environment: |
| 234 | + HANA_HOME: "/usr/sap/{{ sap_sid | default('HA0') }}/HDB{{ instance_num | default('00') }}" |
| 235 | + tags: |
| 236 | + - hana_config_validation |
| 237 | + |
| 238 | +- name: Check hdbnsutil -sr_stateConfiguration output for primary master / mode |
| 239 | + ansible.builtin.assert: |
| 240 | + that: |
| 241 | + - >- |
| 242 | + (is_primary and hdbnsutil_sr_state_configuration_output.stdout is search('mode: primary')) or |
| 243 | + (not is_primary and hdbnsutil_sr_state_configuration_output.stdout is search('primary masters: {{ primary_hostname }}')) |
| 244 | + fail_msg: "hdbnsutil -sr_stateConfiguration output does not show expected configuration for {{ ansible_hostname }}. Output:\n{{ hdbnsutil_sr_state_configuration_output.stdout }}" |
| 245 | + success_msg: "hdbnsutil -sr_stateConfiguration output confirms expected configuration for {{ ansible_hostname }}." |
| 246 | + when: hdbnsutil_sr_state_configuration_output.rc == 0 |
| 247 | + tags: |
| 248 | + - hana_config_validation |
| 249 | + |
| 250 | +- name: Run HDBSettings.sh systemReplicationStatus.py for replication data path validation |
| 251 | + ansible.builtin.command: "su - {{ sap_sid | lower }}adm -c 'HDBSettings.sh systemReplicationStatus.py'" |
| 252 | + register: system_replication_status_output |
| 253 | + changed_when: false |
| 254 | + failed_when: "system_replication_status_output.stderr | length > 0" # Fail only if stderr is not empty |
| 255 | + become: true |
| 256 | + environment: |
| 257 | + HANA_HOME: "/usr/sap/{{ sap_sid | default('HA0') }}/HDB{{ instance_num | default('00') }}" |
| 258 | + tags: |
| 259 | + - hana_config_validation |
| 260 | + |
| 261 | +- name: Check HDBSettings.sh systemReplicationStatus.py output for overall active status |
| 262 | + ansible.builtin.assert: |
| 263 | + that: |
| 264 | + - system_replication_status_output.stdout is search('status system replication site "\\d+": ACTIVE') # Checks for ACTIVE status of any site |
| 265 | + - system_replication_status_output.stdout is search('overall system replication status: ACTIVE') |
| 266 | + fail_msg: "HDBSettings.sh systemReplicationStatus.py reported inactive or non-synced status. Output:\n{{ system_replication_status_output.stdout }}" |
| 267 | + success_msg: "HDBSettings.sh systemReplicationStatus.py reported ACTIVE system replication status." |
| 268 | + tags: |
| 269 | + - hana_config_validation |
0 commit comments