]> git.immae.eu Git - github/fretlink/ansible-postgresql-role.git/blame - templates/pgBadger.sh.j2
Merge pull request #11 from paulrbr-fl/postgresql-12
[github/fretlink/ansible-postgresql-role.git] / templates / pgBadger.sh.j2
CommitLineData
d0bc90e0
P
1#!/bin/bash
2# {{ ansible_managed }}
3
4{% for cluster in postgres_clusters %}
5install --mode=0644 --owner=pgbadger {{ postgres_log_dir | default("/var/log/postgresql") }}/postgresql-{{ cluster.version }}-{{ cluster.name }}.log.1 ~pgbadger/
6sudo -H -u pgbadger scp ~pgbadger/postgresql-{{ cluster.version }}-{{ cluster.name }}.log.1 {{Ā postgres_pgbadger_server }}:postgresql-{{ ansible_nodename }}-{{ cluster.version }}-{{ cluster.name }}.log.1
7sudo -H -u pgbadger ssh {{Ā postgres_pgbadger_server }} ./update.sh {{ ansible_nodename }}-{{ cluster.version }}-{{ cluster.name }}
8{% else %}
9# No servers are configured for sending logs to pgbadger
10{% endfor %}