File tree Expand file tree Collapse file tree 6 files changed +20
-37
lines changed
Expand file tree Collapse file tree 6 files changed +20
-37
lines changed Original file line number Diff line number Diff line change @@ -214,15 +214,14 @@ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout
214214COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf
215215COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts
216216COPY --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.j2 /etc/postgresql-custom/wal-g.conf
218217COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh
219218COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh
220219
221220RUN sed -i \
222221 -e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \
223222 -e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \
224223 -e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \
225- -e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \
224+ /etc/postgresql/postgresql.conf && \
226225 echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
227226 echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
228227 usermod -aG postgres wal-g && \
Original file line number Diff line number Diff line change @@ -218,15 +218,14 @@ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout
218218COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf
219219COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts
220220COPY --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.j2 /etc/postgresql-custom/wal-g.conf
222221COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh
223222COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh
224223
225224RUN sed -i \
226225 -e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \
227226 -e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \
228227 -e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \
229- -e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \
228+ /etc/postgresql/postgresql.conf && \
230229 echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
231230 echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
232231 usermod -aG postgres wal-g && \
Original file line number Diff line number Diff line change @@ -218,15 +218,14 @@ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout
218218COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf
219219COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts
220220COPY --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.j2 /etc/postgresql-custom/wal-g.conf
222221COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh
223222COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh
224223
225224RUN sed -i \
226225 -e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \
227226 -e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \
228227 -e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \
229- -e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \
228+ /etc/postgresql/postgresql.conf && \
230229 echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
231230 echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
232231 usermod -aG postgres wal-g && \
Original file line number Diff line number Diff line change 11# - Archiving -
22
3- #archive_mode = on
43#archive_command = '/usr/bin/admin-mgr wal-push %p >> /var/log/wal-g/wal-push.log 2>&1'
54#archive_timeout = 120
65
76
8- # - Archive Recovery -
9-
10- #restore_command = '/usr/bin/admin-mgr wal-fetch %f %p >> /var/log/wal-g/wal-fetch.log 2>&1'
7+ # - Hot Standby -
8+ hot_standby = off
119
1210# - Recovery Target -
1311
12+ #recovery_target_action = 'promote'
13+ #recovery_target_inclusive = off
1414#recovery_target_lsn = ''
1515#recovery_target_time = ''
16- #recovery_target_action = 'promote'
1716#recovery_target_timeline = 'current'
18- #recovery_target_inclusive = off
1917
20- # - Hot Standby -
21- hot_standby = off
18+ #restore_command = '/usr/bin/admin-mgr wal-fetch %f %p >> /var/log/wal-g/wal-fetch.log 2>&1'
Original file line number Diff line number Diff line change @@ -242,12 +242,11 @@ checkpoint_flush_after = 256kB # measured in pages, 0 disables
242242
243243# - Archiving -
244244
245- #archive_mode = off # enables archiving; off, on, or always
246- # (change requires restart)
247- #archive_command = '' # command to use to archive a logfile segment
248- # placeholders: %p = path of file to archive
249- # %f = file name only
250- # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'
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
247+ # placeholders: %p = path of file to archive
248+ # %f = file name only
249+ # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'
251250#archive_timeout = 0 # force a logfile segment switch after this
252251 # number of seconds; 0 disables
253252
@@ -758,9 +757,6 @@ jit_provider = 'llvmjit' # JIT library to use
758757# User-supplied custom parameters, override any automatically generated ones
759758#include = '/etc/postgresql-custom/custom-overrides.conf'
760759
761- # WAL-G specific configurations
762- #include = '/etc/postgresql-custom/wal-g.conf'
763-
764760# supautils specific configurations
765761#include = '/etc/postgresql-custom/supautils.conf'
766762
Original file line number Diff line number Diff line change 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.j2'
64-
6557 - name : Add script to be run for restore_command
6658 ansible.builtin.template :
6759 dest : ' /home/postgres/wal_fetch.sh'
7769 owner : ' root'
7870 src : ' files/walg_helper_scripts/wal_change_ownership.sh'
7971
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
72+ - name : Move custom wal-g.conf file to /etc/postgresql-custom/conf.d/wal-g.conf
73+ ansible.builtin.copy :
74+ dest : ' /etc/postgresql-custom/conf.d/wal-g.conf'
75+ group : ' postgres'
76+ mode : ' 0664'
77+ owner : ' postgres'
78+ src : ' files/postgresql_config/conf.d/wal-g.conf'
You can’t perform that action at this time.
0 commit comments