|
231 | 231 | - name: Enable SBD [sbd] |
232 | 232 | ansible.builtin.command: |
233 | 233 | cmd: crm configure primitive rsc_iscsi_sbd stonith:external/sbd |
| 234 | + register: enable_sbd_result |
| 235 | + changed_when: enable_sbd_result.rc == 0 |
234 | 236 | when: |
235 | 237 | - sbd_stonith | string | lower == 'false' |
236 | 238 | - use_sbd | default(false) | bool |
|
253 | 255 | - not (use_sbd | default(false) | bool) |
254 | 256 | - ansible_distribution_major_version == '12' |
255 | 257 | register: stonith_config_result |
| 258 | + changed_when: stonith_config_result.rc == 0 |
256 | 259 | failed_when: > |
257 | 260 | stonith_config_result.stderr_lines | select("match", "ERROR") | reject("match", "ERROR: warning") | list | length > 0 |
258 | 261 |
|
|
263 | 266 | - not (use_sbd | default(false) | bool) |
264 | 267 | - ansible_distribution_major_version != '12' |
265 | 268 | register: stonith_config_result |
| 269 | + changed_when: stonith_config_result.rc == 0 |
266 | 270 | failed_when: "'ERROR' in stonith_config_result.stderr" |
267 | 271 |
|
268 | 272 | - name: Set stonith-timeout [sdb] |
269 | 273 | ansible.builtin.command: |
270 | 274 | cmd: crm configure property stonith-timeout=144 |
| 275 | + register: set_stonith_timeout_sdb_result |
| 276 | + changed_when: set_stonith_timeout_sdb_result.rc == 0 |
271 | 277 | when: |
272 | 278 | - stonith_timeout != '144' |
273 | 279 | - use_sbd | default(false) | bool |
|
279 | 285 | crm configure property |
280 | 286 | $id="cib-bootstrap-options" |
281 | 287 | stonith-timeout=600s |
| 288 | + register: set_stonith_timeout_aws_result |
| 289 | + changed_when: set_stonith_timeout_aws_result.rc == 0 |
282 | 290 | when: |
283 | 291 | - stonith_timeout != '600s' |
284 | 292 | - is_primary |
|
290 | 298 | crm configure property |
291 | 299 | $id="cib-bootstrap-options" |
292 | 300 | stonith-enabled=true |
| 301 | + register: enable_stonith_result |
| 302 | + changed_when: enable_stonith_result.rc == 0 |
293 | 303 | when: |
294 | 304 | - stonith_enabled | string | lower != 'true' |
295 | 305 | - is_primary |
|
300 | 310 | crm configure property |
301 | 311 | $id="cib-bootstrap-options" |
302 | 312 | stonith-action=off |
| 313 | + register: disable_stonith_action_result |
| 314 | + changed_when: disable_stonith_action_result.rc == 0 |
303 | 315 | when: |
304 | 316 | - stonith_action != 'off' |
305 | 317 | - is_primary |
|
314 | 326 | - resource_stickiness != '1000' |
315 | 327 | - is_primary |
316 | 328 | register: reg_rsc_defaults |
| 329 | + changed_when: reg_rsc_defaults.rc == 0 |
317 | 330 | until: reg_rsc_defaults.rc == 0 |
318 | 331 | retries: 10 |
319 | 332 | delay: 10 |
|
324 | 337 | crm configure rsc_defaults |
325 | 338 | $id="rsc-options" |
326 | 339 | migration-threshold=5000 |
| 340 | + register: set_migration_threshold_result |
| 341 | + changed_when: set_migration_threshold_result.rc == 0 |
327 | 342 | when: |
328 | 343 | - migration_threshold != '5000' |
329 | 344 | - is_primary |
330 | 345 |
|
331 | 346 | - name: Set op_defaults timeout |
332 | 347 | ansible.builtin.command: |
333 | 348 | cmd: crm configure op_defaults timeout=600 |
| 349 | + register: set_op_defaults_timeout_result |
| 350 | + changed_when: set_op_defaults_timeout_result.rc == 0 |
334 | 351 | when: |
335 | 352 | - op_default_timeout != '600' |
336 | 353 | - is_primary |
|
348 | 365 | op start interval=0 timeout=180 |
349 | 366 | op stop interval=0 timeout=180 |
350 | 367 | op monitor interval=60 timeout=60 |
| 368 | + register: configure_cluster_ip_result |
| 369 | + changed_when: configure_cluster_ip_result.rc == 0 |
351 | 370 | when: |
352 | 371 | - rsc_ip | length == 0 |
353 | 372 | - is_primary |
|
372 | 391 | rsc_ip_{{ sap_hana_install_sid }}_HDB{{ sap_hana_install_instance_number }} |
373 | 392 | {{ primary_hostname }} |
374 | 393 | register: reg_move_cmd |
| 394 | + changed_when: reg_move_cmd.rc == 0 |
375 | 395 | when: |
376 | 396 | - is_primary |
377 | 397 | - reg_vip_location.stdout | trim | split(' ') | last != primary_hostname |
|
385 | 405 | crm resource locate |
386 | 406 | rsc_ip_{{ sap_hana_install_sid }}_HDB{{ sap_hana_install_instance_number }} |
387 | 407 | register: reg_vip_location2 |
| 408 | + changed_when: false |
388 | 409 | when: |
389 | 410 | - is_primary |
390 | 411 | - reg_vip_location.stdout | trim | split(' ') | last != primary_hostname |
|
0 commit comments