|
106 | 106 | loop_control: |
107 | 107 | loop_var: check_type |
108 | 108 |
|
109 | | - - name: "Run role-specific checks for DB hosts" |
| 109 | + - name: "Run role-specific checks for HANA DB hosts" |
110 | 110 | ansible.builtin.include_tasks: |
111 | 111 | file: "./roles/configuration_checks/tasks/main.yml" |
112 | 112 | vars: |
|
117 | 117 | results_var: "db_hana_results" |
118 | 118 | when: >- |
119 | 119 | role == 'DB' and |
| 120 | + (platform | default('HANA') | upper == 'HANA') and |
120 | 121 | (configuration_test_type == 'all' or |
121 | 122 | configuration_test_type == 'Database') |
122 | 123 |
|
123 | | - - name: "Debug DB checks execution" |
| 124 | + - name: "Debug HANA checks execution" |
124 | 125 | ansible.builtin.debug: |
125 | 126 | msg: "Executing Database (HANA) checks on host {{ inventory_hostname }}" |
126 | 127 | when: >- |
127 | 128 | role == 'DB' and |
| 129 | + (platform | default('HANA') | upper == 'HANA') and |
128 | 130 | (configuration_test_type == 'all' or |
129 | 131 | configuration_test_type == 'Database') |
130 | 132 |
|
131 | | - - name: "Run HA configuration checks for DB hosts" |
| 133 | + - name: "Run role-specific checks for DB2 DB hosts" |
| 134 | + ansible.builtin.include_tasks: |
| 135 | + file: "./roles/configuration_checks/tasks/main.yml" |
| 136 | + vars: |
| 137 | + check_type: |
| 138 | + name: "Database (DB2) Checks" |
| 139 | + file_name: "db2" |
| 140 | + checks_var: "db_db2_checks" |
| 141 | + results_var: "db_db2_results" |
| 142 | + when: >- |
| 143 | + role == 'DB' and |
| 144 | + (platform | default('HANA') | upper == 'DB2') and |
| 145 | + (configuration_test_type == 'all' or |
| 146 | + configuration_test_type == 'Database') |
| 147 | +
|
| 148 | + - name: "Debug DB2 checks execution" |
| 149 | + ansible.builtin.debug: |
| 150 | + msg: "Executing Database (DB2) checks on host {{ inventory_hostname }}" |
| 151 | + when: >- |
| 152 | + role == 'DB' and |
| 153 | + (platform | default('HANA') | upper == 'DB2') and |
| 154 | + (configuration_test_type == 'all' or |
| 155 | + configuration_test_type == 'Database') |
| 156 | +
|
| 157 | + - name: "Run HA configuration checks for HANA DB hosts" |
132 | 158 | ansible.builtin.include_tasks: |
133 | 159 | file: "./roles/configuration_checks/tasks/main.yml" |
134 | 160 | vars: |
|
138 | 164 | checks_var: "db_ha_config_checks" |
139 | 165 | results_var: "db_ha_config_results" |
140 | 166 | when: |
141 | | - - role == 'DB' and |
| 167 | + - role == 'DB' |
| 168 | + - (platform | default('HANA') | upper == 'HANA') |
142 | 169 | - database_high_availability | default(false) | bool |
143 | | - - configuration_test_type == 'all' or configuration_test_type == 'Database') |
| 170 | + - (configuration_test_type == 'all' or configuration_test_type == 'Database') |
144 | 171 |
|
145 | 172 | - name: "Run role-specific checks for ASCS/SCS hosts" |
146 | 173 | ansible.builtin.include_tasks: |
|
297 | 324 | loop: "{{ groups[sap_sid | upper + '_DB']|default([]) }}" |
298 | 325 | when: hostvars[item].db_hana_results is defined |
299 | 326 |
|
| 327 | + - name: "Collect DB (DB2) check results" |
| 328 | + ansible.builtin.set_fact: |
| 329 | + all_results: "{{ all_results + hostvars[item].db_db2_results |
| 330 | + | default([]) }}" |
| 331 | + execution_metadata: "{{ execution_metadata + [ |
| 332 | + {'host': item, |
| 333 | + 'check_type': 'db_db2', |
| 334 | + 'metadata': hostvars[item].db_db2_results_metadata |
| 335 | + | default({})}] }}" |
| 336 | + loop: "{{ groups[sap_sid | upper + '_DB']|default([]) }}" |
| 337 | + when: hostvars[item].db_db2_results is defined |
| 338 | + |
300 | 339 | - name: "Collect DB HA configuration check results" |
301 | 340 | ansible.builtin.set_fact: |
302 | 341 | all_results: "{{ all_results + hostvars[item].db_ha_config_results |
|
0 commit comments