Skip to content
Snippets Groups Projects
Commit d95f09db authored by Nicolas KAROLAK's avatar Nicolas KAROLAK
Browse files

fix pgconf path

parent ce638f6c
No related branches found
No related tags found
No related merge requests found
--- ---
- name: reload systemd
systemd:
daemon_reload: true
- name: restart postgresql - name: restart postgresql
systemd: systemd:
name: postgresql@{{ repmgr_pg_version }}-{{ repmgr_pg_cluster }} name: postgresql@{{ repmgr_pg_version }}-{{ repmgr_pg_cluster }}
...@@ -10,4 +14,9 @@ ...@@ -10,4 +14,9 @@
name: repmgrd name: repmgrd
state: restarted state: restarted
- name: restart rephacheck
systemd:
name: rephacheck.socket
state: restarted
... ...
...@@ -84,9 +84,9 @@ ...@@ -84,9 +84,9 @@
replace: '{{ item.key }}={{ item.value }}' replace: '{{ item.key }}={{ item.value }}'
- name: copy events notification script - name: copy events notification script
copy: template:
src: repmgr-event.py src: repmgr-event.py.j2
dest: /usr/local/bin/repmgr-event dest: /usr/bin/repmgr-event
mode: 0755 mode: 0755
- name: configure sudo - name: configure sudo
...@@ -268,8 +268,8 @@ ...@@ -268,8 +268,8 @@
# REPHACHECK # REPHACHECK
- name: install rephacheck - name: install rephacheck
copy: template:
src: rephacheck.py src: rephacheck.py.j2
dest: /usr/bin/rephacheck dest: /usr/bin/rephacheck
mode: 0755 mode: 0755
...@@ -281,12 +281,15 @@ ...@@ -281,12 +281,15 @@
- name: configure rephacheck - name: configure rephacheck
template: template:
src: rephacheck.conf.j2 src: rephacheck.conf.j2
dest: /etc/postgresql/11/main/rephacheck.conf dest: /etc/postgresql/{{ repmgr_pg_version }}/{{ repmgr_pg_cluster }}/rephacheck.conf
owner: postgres owner: postgres
group: postgres group: postgres
mode: 0644 mode: 0644
- name: configure rephacheck socket - name: configure rephacheck socket
notify:
- reload systemd
- restart rephacheck
copy: copy:
dest: /etc/systemd/system/rephacheck.socket dest: /etc/systemd/system/rephacheck.socket
content: | content: |
...@@ -301,6 +304,9 @@ ...@@ -301,6 +304,9 @@
WantedBy=sockets.target WantedBy=sockets.target
- name: configure rephacheck service - name: configure rephacheck service
notify:
- reload systemd
- restart rephacheck
copy: copy:
dest: /etc/systemd/system/rephacheck@.service dest: /etc/systemd/system/rephacheck@.service
content: | content: |
......
...@@ -50,7 +50,7 @@ def get_quorum_state(node_id): ...@@ -50,7 +50,7 @@ def get_quorum_state(node_id):
if __name__ == '__main__': if __name__ == '__main__':
with open('/etc/postgresql/11/main/rephacheck.conf') as rephaconf: with open('/etc/postgresql/{{ repmgr_pg_version }}/{{ repmgr_pg_cluster }}/rephacheck.conf') as rephaconf:
conf = toml.load(rephaconf) conf = toml.load(rephaconf)
NODES = conf.get('nodes') NODES = conf.get('nodes')
......
...@@ -36,7 +36,7 @@ def main(): ...@@ -36,7 +36,7 @@ def main():
# load config if exists # load config if exists
try: try:
with open("/etc/postgresql/11/main/repmgr-event.json") as data_file: with open("/etc/postgresql/{{ repmgr_pg_version }}/{{ repmgr_pg_cluster }}/repmgr-event.json") as data_file:
data = json.load(data_file) data = json.load(data_file)
except EnvironmentError: except EnvironmentError:
data = {} data = {}
......
...@@ -3,7 +3,7 @@ node_name={{ repmgr_node_name }} ...@@ -3,7 +3,7 @@ node_name={{ repmgr_node_name }}
conninfo='{{ repmgr_conninfo }}' conninfo='{{ repmgr_conninfo }}'
data_directory=/var/lib/postgresql/{{ repmgr_pg_version }}/{{ repmgr_pg_cluster }} data_directory=/var/lib/postgresql/{{ repmgr_pg_version }}/{{ repmgr_pg_cluster }}
use_replication_slots=1 use_replication_slots=1
event_notification_command='/usr/local/bin/repmgr-event %n %e %s "%t" "%d"' event_notification_command='/usr/bin/repmgr-event %n %e %s "%t" "%d"'
pg_bindir=/usr/lib/postgresql/{{ repmgr_pg_version }}/bin/ pg_bindir=/usr/lib/postgresql/{{ repmgr_pg_version }}/bin/
pg_ctl_options='-s' pg_ctl_options='-s'
pg_basebackup_options='--label=repmgr_backup' pg_basebackup_options='--label=repmgr_backup'
...@@ -11,8 +11,8 @@ primary_follow_timeout=30 ...@@ -11,8 +11,8 @@ primary_follow_timeout=30
failover=automatic failover=automatic
reconnect_attempts=6 reconnect_attempts=6
reconnect_interval=5 reconnect_interval=5
promote_command='repmgr standby promote' promote_command='repmgr -f {{ repmgr_config }} standby promote'
follow_command='repmgr standby follow -W' follow_command='repmgr -f {{ repmgr_config }} standby follow -W'
service_start_command='sudo systemctl start postgresql@{{ repmgr_pg_version }}-{{ repmgr_pg_cluster }}' service_start_command='sudo systemctl start postgresql@{{ repmgr_pg_version }}-{{ repmgr_pg_cluster }}'
service_stop_command='sudo systemctl stop postgresql@{{ repmgr_pg_version }}-{{ repmgr_pg_cluster }}' service_stop_command='sudo systemctl stop postgresql@{{ repmgr_pg_version }}-{{ repmgr_pg_cluster }}'
service_restart_command='sudo systemctl restart postgresql@{{ repmgr_pg_version }}-{{ repmgr_pg_cluster }}' service_restart_command='sudo systemctl restart postgresql@{{ repmgr_pg_version }}-{{ repmgr_pg_cluster }}'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment