modified: README.md modified: compose.yml modified: configuration.py new file: haproxy.cfg new file: init-patroni-users.sql renamed: entrypoint.sh -> netbox-entrypoint.sh renamed: Containerfile -> netbox.Containerfile modified: nginx.conf new file: patroni-entrypoint.sh new file: patroni.Containerfile new file: patroni.yml
20 lines
1.0 KiB
SQL
20 lines
1.0 KiB
SQL
-- ============================================================
|
|
-- init-patroni-users.sql
|
|
-- Creates users required by Patroni on an existing standalone
|
|
-- PostgreSQL instance before Patroni takeover.
|
|
--
|
|
-- Run this on the current primary BEFORE starting Patroni:
|
|
-- podman compose run --rm --no-deps postgres \
|
|
-- psql -U netbox -d netbox -f /init-patroni-users.sql
|
|
-- ============================================================
|
|
|
|
-- Replication user (used by replicas for streaming replication)
|
|
CREATE ROLE replicator WITH REPLICATION LOGIN PASSWORD 'replicator-pass';
|
|
|
|
-- Rewind user (used by pg_rewind when a former leader rejoins)
|
|
CREATE ROLE rewind_user WITH LOGIN PASSWORD 'rewind-pass';
|
|
GRANT EXECUTE ON function pg_catalog.pg_ls_dir(text, boolean, boolean) TO rewind_user;
|
|
GRANT EXECUTE ON function pg_catalog.pg_stat_file(text, boolean) TO rewind_user;
|
|
GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text) TO rewind_user;
|
|
GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text, bigint, bigint, boolean) TO rewind_user;
|