]>
Commit | Line | Data |
---|---|---|
d0bc90e0 P |
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 %} |