File tree Expand file tree Collapse file tree 4 files changed +29
-1
lines changed Expand file tree Collapse file tree 4 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ patroni_config_file: "{{ inventory_hostname }}.yml"
1212patroni_system_user : postgres
1313patroni_system_group : postgres
1414
15+ patroni_handlers_disable : false
16+
1517# create a backup file before copying files on hosts
1618patroni_backup_on_copy : true
1719
Original file line number Diff line number Diff line change 4646 owner : " {{ patroni_system_user }}"
4747 group : " {{ patroni_system_group }}"
4848 mode : 0600
49+ register : patroni_config
50+
51+ - name : Check if Patroni handler has to be executed
52+ debug :
53+ msg : " Patroni config file was changed, handler will be triggered."
4954 notify :
5055 - restart patroni
56+ when :
57+ - patroni_config.changed | bool and
58+ not patroni_handlers_disable | bool
5159
5260- name : Create haproxy configuration file
5361 template :
5664 owner : root
5765 group : root
5866 mode : 0644
67+ register : haproxy_config
68+ when : patroni_install_haproxy
69+
70+ - name : Check if HAProxy handler has to be executed
71+ debug :
72+ msg : " HAProxy config file was changed, handler will be triggered."
5973 notify :
6074 - restart haproxy
61- when : patroni_install_haproxy
75+ when :
76+ - patroni_install_haproxy and
77+ haproxy_config.changed | bool and
78+ not patroni_handlers_disable | bool
Original file line number Diff line number Diff line change 88 tags : [patroni, patroni-configure]
99
1010- meta : flush_handlers
11+ when : not patroni_handlers_disable | bool
1112
1213- name : Ensure patroni is running
1314 systemd :
Original file line number Diff line number Diff line change 2020 owner : root
2121 group : root
2222 mode : 0644
23+ register : patroni_watchdog_config
24+
25+ - name : Check if watchdog handler has to be executed
26+ debug :
27+ msg : " Watchdog config file was changed, handler will be triggered."
2328 notify :
2429 - restart patroni-watchdog
30+ when :
31+ - patroni_watchdog_config.changed | bool and
32+ not patroni_handlers_disable | bool
2533
2634# Dirty hack. See https://bugs.launchpad.net/ubuntu/+source/watchdog/+bug/1448924
2735- name : Enable watchdog daemon to start on boot
You can’t perform that action at this time.
0 commit comments