diff options
Diffstat (limited to 'templates/pgBadger.sh.j2')
-rw-r--r-- | templates/pgBadger.sh.j2 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/templates/pgBadger.sh.j2 b/templates/pgBadger.sh.j2 new file mode 100644 index 0000000..93a2247 --- /dev/null +++ b/templates/pgBadger.sh.j2 | |||
@@ -0,0 +1,10 @@ | |||
1 | #!/bin/bash | ||
2 | # {{ ansible_managed }} | ||
3 | |||
4 | {% for cluster in postgres_clusters %} | ||
5 | install --mode=0644 --owner=pgbadger {{ postgres_log_dir | default("/var/log/postgresql") }}/postgresql-{{ cluster.version }}-{{ cluster.name }}.log.1 ~pgbadger/ | ||
6 | sudo -H -u pgbadger scp ~pgbadger/postgresql-{{ cluster.version }}-{{ cluster.name }}.log.1 {{Ā postgres_pgbadger_server }}:postgresql-{{ ansible_nodename }}-{{ cluster.version }}-{{ cluster.name }}.log.1 | ||
7 | sudo -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 %} | ||