hapostgres / hapostgres/pg_auto_failover

If .pgpass is found use its information for configuration if possible

Open
#750 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
1.4k
Forks
142
Avg merge
5h 8m
Merged PRs (30d)
1

Description

When creating a monitor you need to manually set password for `autoctl_node` user using
```
// postgres needs to run
psql postgres://localhost/pg_auto_failover -c "alter user autoctl_node password 'h4ckm3'"
```

When creating postgres nodes you have to manually set password for `pgautofailover_replicator` user using
```
// postgres does not need to run
pg_autoctl config set replication.password h4ckm3

// postgres needs to run
psql postgres://localhost/postgres -c "alter user pgautofailover_replicator password 'h4ckm3'"
```

It would be nice if pg_auto_failover would check for `.pgpass` file and if it exists and contains entries for the above users, then configure passwords automatically.

Currently when using Docker it is a bit annoying that you can not easily make a docker image what works out of the box. You always have to start the image, so that postgres db is running, and then connect to it and configure passwords manually. Given that it is good practice to use a `.pgpass` file you would usually mount that file into the image or generate it via a docker entrypoint shell script based on mounted docker secrets.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.