File tree Expand file tree Collapse file tree 6 files changed +32
-5
lines changed
Expand file tree Collapse file tree 6 files changed +32
-5
lines changed Original file line number Diff line number Diff line change @@ -214,6 +214,7 @@ 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 /etc/postgresql-custom/wal-g.conf
217218COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf /etc/postgresql-custom/read-replica.conf
218219COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh
219220COPY 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 && \
Original file line number Diff line number Diff line change @@ -218,6 +218,7 @@ 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 /etc/postgresql-custom/wal-g.conf
221222COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf /etc/postgresql-custom/read-replica.conf
222223COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh
223224COPY 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 && \
Original file line number Diff line number Diff line change @@ -218,6 +218,7 @@ 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 /etc/postgresql-custom/wal-g.conf
221222COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf /etc/postgresql-custom/read-replica.conf
222223COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh
223224COPY 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 && \
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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
756764include = '/etc/postgresql-custom/read-replica.conf'
757765
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'
64+
5765 - name : Add script to be run for restore_command
5866 ansible.builtin.template :
5967 dest : ' /home/postgres/wal_fetch.sh'
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'
You can’t perform that action at this time.
0 commit comments