|
379 | 379 | command: "{{ postgresql_bin_dir }}/pg_ctl start -D {{ postgresql_data_dir }}"
|
380 | 380 | when: pg_ctl_status_result.rc == 3 and
|
381 | 381 | (ansible_os_family == "RedHat" or
|
382 |
| - postgresql_packages is search("postgrespro")) |
| 382 | + postgresql_packages|join(" ") is search("postgrespro")) |
383 | 383 |
|
384 | 384 | - name: Prepare PostgreSQL | check PostgreSQL is accepting connections
|
385 | 385 | become: true
|
|
451 | 451 | retries: 10
|
452 | 452 | delay: 30
|
453 | 453 | when: ansible_os_family == "Debian" and
|
454 |
| - postgresql_packages is not search("postgrespro") |
| 454 | + postgresql_packages|join(" ") is not search("postgrespro") |
455 | 455 |
|
456 | 456 | # "RedHat" or PostgresPro
|
457 | 457 | - name: Prepare PostgreSQL | stop PostgreSQL (will be managed by patroni)
|
|
463 | 463 | retries: 30
|
464 | 464 | delay: 10
|
465 | 465 | when: ansible_os_family == "RedHat" or
|
466 |
| - postgresql_packages is search("postgrespro") |
| 466 | + postgresql_packages|join(" ") is search("postgrespro") |
467 | 467 |
|
468 | 468 | - name: Prepare PostgreSQL | check PostgreSQL is stopped
|
469 | 469 | become: true
|
|
504 | 504 | path: "{{ postgresql_conf_dir }}/postgresql.conf"
|
505 | 505 | register: postgresql_conf_file
|
506 | 506 | when: ansible_os_family == "Debian" and
|
507 |
| - postgresql_packages is not search("postgrespro") |
| 507 | + postgresql_packages|join(" ") is not search("postgrespro") |
508 | 508 |
|
509 | 509 | - name: Prepare PostgreSQL | generate default postgresql config files
|
510 | 510 | become: true
|
|
518 | 518 | register: pg_createcluster_result
|
519 | 519 | failed_when: pg_createcluster_result.rc != 0
|
520 | 520 | when: (ansible_os_family == "Debian" and
|
521 |
| - postgresql_packages is not search("postgrespro")) and |
| 521 | + postgresql_packages|join(" ") is not search("postgrespro")) and |
522 | 522 | not postgresql_conf_file.stat.exists
|
523 | 523 |
|
524 | 524 | - name: Prepare PostgreSQL | make sure the data directory "{{ postgresql_data_dir }}" is empty on Master
|
|
625 | 625 |
|
626 | 626 | - name: Start PostgreSQL for Recovery # RedHat or PostgresPro
|
627 | 627 | command: "{{ postgresql_bin_dir }}/pg_ctl start -D {{ postgresql_data_dir }} -o '-c hot_standby=off'"
|
628 |
| - when: (ansible_os_family == "RedHat" or postgresql_packages is search("postgrespro")) and |
| 628 | + when: (ansible_os_family == "RedHat" or postgresql_packages|join(" ") is search("postgrespro")) and |
629 | 629 | (is_master == "true" or
|
630 | 630 | (is_master != "true" and 'pgbackrest' in patroni_create_replica_methods))
|
631 | 631 |
|
|
661 | 661 | until: stop_result.rc == 0
|
662 | 662 | retries: 10
|
663 | 663 | delay: 10
|
664 |
| - when: (ansible_os_family == "RedHat" or postgresql_packages is search("postgrespro")) and |
| 664 | + when: (ansible_os_family == "RedHat" or postgresql_packages|join(" ") is search("postgrespro")) and |
665 | 665 | (pg_ctl_status_result.rc is defined and pg_ctl_status_result.rc != 3)
|
666 | 666 | when: patroni_cluster_bootstrap_method == "pgbackrest"
|
667 | 667 | become: true
|
|
895 | 895 | enabled: false
|
896 | 896 | daemon_reload: true
|
897 | 897 | when: ansible_os_family == "Debian" and
|
898 |
| - postgresql_packages is not search("postgrespro") |
| 898 | + postgresql_packages|join(" ") is not search("postgrespro") |
899 | 899 | tags: patroni, postgresql_disable
|
900 | 900 |
|
901 | 901 | # "RedHat"
|
|
905 | 905 | enabled: false
|
906 | 906 | daemon_reload: true
|
907 | 907 | when: ansible_os_family == "RedHat" and
|
908 |
| - postgresql_packages is not search("postgrespro") |
| 908 | + postgresql_packages|join(" ") is not search("postgrespro") |
909 | 909 | tags: patroni, postgresql_disable
|
910 | 910 |
|
911 | 911 | # PostgresPro
|
|
914 | 914 | name: "postgrespro-std-{{ postgresql_version }}"
|
915 | 915 | enabled: false
|
916 | 916 | daemon_reload: true
|
917 |
| - when: postgresql_packages is search("postgrespro-std") |
| 917 | + when: postgresql_packages|join(" ") is search("postgrespro-std") |
918 | 918 | tags: patroni, postgresql_disable
|
919 | 919 |
|
920 | 920 | # PATRONICTL_CONFIG_FILE (patroni v1.6.1 and higher)
|
|
0 commit comments