Skip to content

Commit 7839c9e

Browse files
committed
revert: revert PR 1956
1 parent 495d9f9 commit 7839c9e

File tree

8 files changed

+16
-3
lines changed

8 files changed

+16
-3
lines changed

Dockerfile-15

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout
214214
COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf
215215
COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts
216216
COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/bin/pgsodium_getkey.sh
217+
COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf /etc/postgresql-custom/read-replica.conf
217218
COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh
218219
COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh
219220

Dockerfile-17

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout
218218
COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf
219219
COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts
220220
COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/bin/pgsodium_getkey.sh
221+
COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf /etc/postgresql-custom/read-replica.conf
221222
COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh
222223
COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh
223224

Dockerfile-orioledb-17

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout
218218
COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf
219219
COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts
220220
COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/bin/pgsodium_getkey.sh
221+
COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf /etc/postgresql-custom/read-replica.conf
221222
COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh
222223
COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh
223224

ansible/files/postgresql_config/conf.d/read_replica.conf renamed to ansible/files/postgresql_config/custom_read_replica.conf

File renamed without changes.

ansible/files/postgresql_config/postgresql.conf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,9 @@ jit_provider = 'llvmjit' # JIT library to use
752752
#include_if_exists = '...' # include file only if it exists
753753
#include = '...' # include file
754754

755+
# read replica specific configurations
756+
include = '/etc/postgresql-custom/read-replica.conf'
757+
755758
# supautils specific configurations
756759
#include = '/etc/postgresql-custom/supautils.conf'
757760

ansible/tasks/setup-postgres.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,13 @@
167167
loop_control:
168168
loop_var: 'pg_config_item'
169169

170-
- name: Move read-replica.conf file to /etc/postgresql-custom/conf.d/read-replica.conf
170+
- name: Move read-replica.conf file to /etc/postgresql-custom/read-replica.conf
171171
ansible.builtin.copy:
172-
dest: '/etc/postgresql-custom/conf.d/read_replica.conf'
172+
dest: '/etc/postgresql-custom/read-replica.conf'
173173
mode: '0664'
174174
owner: 'postgres'
175175
group: 'postgres'
176-
src: 'files/postgresql_config/conf.d/read_replica.conf'
176+
src: 'files/postgresql_config/custom_read_replica.conf'
177177

178178
# Install extensions before init
179179
- name: Install Postgres extensions

nix/packages/lib.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
name = "logging.conf";
4949
path = ../../ansible/files/postgresql_config/postgresql-csvlog.conf;
5050
};
51+
readReplicaConfigFile = builtins.path {
52+
name = "readreplica.conf";
53+
path = ../../ansible/files/postgresql_config/custom_read_replica.conf;
54+
};
5155
pgHbaConfigFile = builtins.path {
5256
name = "pg_hba.conf";
5357
path = ../../ansible/files/postgresql_config/pg_hba.conf.j2;
@@ -87,6 +91,7 @@
8791
POSTGRESQL_CONFIG_DIR = "${postgresqlConfigBaseDir}";
8892
PSQLORIOLEDB17_BINDIR = "${psql_orioledb-17}";
8993
PGSODIUM_GETKEY = "${paths.getkeyScript}";
94+
READREPL_CONF_FILE = "${paths.readReplicaConfigFile}";
9095
LOGGING_CONF_FILE = "${paths.loggingConfigFile}";
9196
SUPAUTILS_CONF_FILE = "${paths.supautilsConfigFile}";
9297
PG_HBA = "${paths.pgHbaConfigFile}";
@@ -118,6 +123,7 @@
118123
cp ${paths.supautilsConfigFile} $out/etc/postgresql-custom/supautils.conf || { echo "Failed to copy supautils.conf"; exit 1; }
119124
cp ${paths.pgconfigFile} $out/etc/postgresql/postgresql.conf || { echo "Failed to copy postgresql.conf"; exit 1; }
120125
cp ${paths.loggingConfigFile} $out/etc/postgresql-custom/logging.conf || { echo "Failed to copy logging.conf"; exit 1; }
126+
cp ${paths.readReplicaConfigFile} $out/etc/postgresql-custom/read-replica.conf || { echo "Failed to copy read-replica.conf"; exit 1; }
121127
cp ${paths.pgHbaConfigFile} $out/etc/postgresql/pg_hba.conf || { echo "Failed to copy pg_hba.conf"; exit 1; }
122128
cp ${paths.pgIdentConfigFile} $out/etc/postgresql/pg_ident.conf || { echo "Failed to copy pg_ident.conf"; exit 1; }
123129
cp -r ${paths.postgresqlExtensionCustomScriptsPath}/* $out/extension-custom-scripts/ || { echo "Failed to copy custom scripts"; exit 1; }

nix/tools/run-server.sh.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ vault.getkey_script = '$PGSODIUM_GETKEY_SCRIPT'" \
240240
-e "s|hba_file = '/etc/postgresql/pg_hba.conf'|hba_file = '$DATDIR/pg_hba.conf'|" \
241241
-e "s|ident_file = '/etc/postgresql/pg_ident.conf'|ident_file = '$DATDIR/pg_ident.conf'|" \
242242
-e "s|include = '/etc/postgresql/logging.conf'|#&|" \
243+
-e "s|include = '/etc/postgresql-custom/read-replica.conf'|include = '$DATDIR/read-replica.conf'|" \
243244
-e "\$a\\
244245
session_preload_libraries = 'supautils'" \
245246
-e "s|include_dir = '/etc/postgresql-custom/conf.d'|include_dir = '$DATDIR/conf.d'|" \

0 commit comments

Comments
 (0)