Commit Graph

2 Commits (e9d602056350c7a020155d5344f09ed2d1e27344)

Author SHA1 Message Date
Dustin 0048a87630 r/postgresql-server: Set become on postgres tasks
Tasks that must run as the _postgres_ user need to explicity enable
`become`, in case it is not already enabled at the playbook level.  This
can happen, for example, when the playbook is running directly as root.
2024-11-16 11:50:28 -06:00
Dustin 4f202c55e4 r/postgres-exporter: Deploy postgres-exporter
The [postgres-exporter][0] exposes PostgreSQL server statistics to
Prometheus.  It connects to a specified PostgreSQL server (in this
case, a server on the local machine via UNIX socket) and collects data
from the `pg_stat_activity`, et al. views.  It needs the `pg_monitor`
role in order to be allowed to read the relevant metrics.

Since we're setting up the exporter to connect via UNIX socket, it needs
a dedicated OS user to match the PostgreSQL user in order to
authenticate via the _peer_ method.

[0]: https://github.com/prometheus-community/postgres_exporter/
2024-07-02 20:44:29 -05:00