Skip to content

Commit ad4f2e0

Browse files
committed
revert: revert PR 1965
1 parent 7839c9e commit ad4f2e0

File tree

6 files changed

+32
-5
lines changed

6 files changed

+32
-5
lines changed

Dockerfile-15

Lines changed: 2 additions & 1 deletion
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_walg.conf /etc/postgresql-custom/wal-g.conf
217218
COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf /etc/postgresql-custom/read-replica.conf
218219
COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh
219220
COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh
@@ -222,7 +223,7 @@ RUN sed -i \
222223
-e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \
223224
-e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \
224225
-e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \
225-
/etc/postgresql/postgresql.conf && \
226+
-e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \
226227
echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
227228
echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
228229
usermod -aG postgres wal-g && \

Dockerfile-17

Lines changed: 2 additions & 1 deletion
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_walg.conf /etc/postgresql-custom/wal-g.conf
221222
COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf /etc/postgresql-custom/read-replica.conf
222223
COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh
223224
COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh
@@ -226,7 +227,7 @@ RUN sed -i \
226227
-e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \
227228
-e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \
228229
-e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \
229-
/etc/postgresql/postgresql.conf && \
230+
-e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \
230231
echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
231232
echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
232233
usermod -aG postgres wal-g && \

Dockerfile-orioledb-17

Lines changed: 2 additions & 1 deletion
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_walg.conf /etc/postgresql-custom/wal-g.conf
221222
COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf /etc/postgresql-custom/read-replica.conf
222223
COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh
223224
COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh
@@ -226,7 +227,7 @@ RUN sed -i \
226227
-e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \
227228
-e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \
228229
-e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \
229-
/etc/postgresql/postgresql.conf && \
230+
-e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \
230231
echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
231232
echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
232233
usermod -aG postgres wal-g && \

ansible/files/postgresql_config/conf.d/wal-g.conf renamed to ansible/files/postgresql_config/custom_walg.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# - Archiving -
22

3+
#archivce_mode = on
34
#archive_command = '/usr/bin/admin-mgr wal-push %p >> /var/log/wal-g/wal-push.log 2>&1'
45
#archive_timeout = 120
56

ansible/files/postgresql_config/postgresql.conf.j2

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ checkpoint_flush_after = 256kB # measured in pages, 0 disables
242242

243243
# - Archiving -
244244

245-
archive_mode = on # enables archiving; off, on, or always (change requires restart)
246-
archive_command = '/bin/true' # command to use to archive a logfile segment
245+
#archive_mode = off # enables archiving; off, on, or always (change requires restart)
246+
#archive_command = '' # command to use to archive a logfile segment
247247
# placeholders: %p = path of file to archive
248248
# %f = file name only
249249
# e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'
@@ -752,6 +752,14 @@ jit_provider = 'llvmjit' # JIT library to use
752752
#include_if_exists = '...' # include file only if it exists
753753
#include = '...' # include file
754754

755+
# Automatically generated optimizations
756+
#include = '/etc/postgresql-custom/generated-optimizations.conf'
757+
# User-supplied custom parameters, override any automatically generated ones
758+
#include = '/etc/postgresql-custom/custom-overrides.conf'
759+
760+
# WAL-G specific configurations
761+
#include = '/etc/postgresql-custom/wal-g.conf'
762+
755763
# read replica specific configurations
756764
include = '/etc/postgresql-custom/read-replica.conf'
757765

ansible/tasks/setup-wal-g.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@
5454
path: '/etc/wal-g/config.json'
5555
state: 'touch'
5656

57+
- name: Move custom wal-g.conf file to /etc/postgresql-custom/wal-g.conf
58+
ansible.builtin.template:
59+
dest: '/etc/postgresql-custom/wal-g.conf'
60+
group: 'postgres'
61+
mode: '0664'
62+
owner: 'postgres'
63+
src: 'files/postgresql_config/custom_walg.conf'
64+
5765
- name: Add script to be run for restore_command
5866
ansible.builtin.template:
5967
dest: '/home/postgres/wal_fetch.sh'
@@ -69,6 +77,13 @@
6977
owner: 'root'
7078
src: 'files/walg_helper_scripts/wal_change_ownership.sh'
7179

80+
- name: Include /etc/postgresql-custom/wal-g.conf in postgresql.conf
81+
ansible.builtin.replace:
82+
path: '/etc/postgresql/postgresql.conf'
83+
regexp: "#include = '/etc/postgresql-custom/wal-g.conf'"
84+
replace: "include = '/etc/postgresql-custom/wal-g.conf'"
85+
become: true
86+
7287
- name: Move custom wal-g.conf file to /etc/postgresql-custom/conf.d/wal-g.conf
7388
ansible.builtin.copy:
7489
dest: '/etc/postgresql-custom/conf.d/wal-g.conf'

0 commit comments

Comments
 (0)