Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Dockerfile-15
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,14 @@ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout
COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf
COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts
COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/bin/pgsodium_getkey.sh
COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/wal-g.conf
COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh
COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh

RUN sed -i \
-e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \
-e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \
-e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \
-e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \
/etc/postgresql/postgresql.conf && \
echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
usermod -aG postgres wal-g && \
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile-17
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,14 @@ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout
COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf
COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts
COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/bin/pgsodium_getkey.sh
COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/wal-g.conf
COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh
COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh

RUN sed -i \
-e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \
-e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \
-e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \
-e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \
/etc/postgresql/postgresql.conf && \
echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
usermod -aG postgres wal-g && \
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile-orioledb-17
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,14 @@ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout
COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf
COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts
COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/bin/pgsodium_getkey.sh
COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/wal-g.conf
COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh
COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh

RUN sed -i \
-e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \
-e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \
-e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \
-e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \
/etc/postgresql/postgresql.conf && \
echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
usermod -aG postgres wal-g && \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
# - Archiving -

#archive_mode = on
#archive_command = '/usr/bin/admin-mgr wal-push %p >> /var/log/wal-g/wal-push.log 2>&1'
#archive_timeout = 120


# - Archive Recovery -

#restore_command = '/usr/bin/admin-mgr wal-fetch %f %p >> /var/log/wal-g/wal-fetch.log 2>&1'
# - Hot Standby -
hot_standby = off

# - Recovery Target -

#recovery_target_action = 'promote'
#recovery_target_inclusive = off
#recovery_target_lsn = ''
#recovery_target_time = ''
#recovery_target_action = 'promote'
#recovery_target_timeline = 'current'
#recovery_target_inclusive = off

# - Hot Standby -
hot_standby = off
#restore_command = '/usr/bin/admin-mgr wal-fetch %f %p >> /var/log/wal-g/wal-fetch.log 2>&1'
14 changes: 5 additions & 9 deletions ansible/files/postgresql_config/postgresql.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,11 @@ checkpoint_flush_after = 256kB # measured in pages, 0 disables

# - Archiving -

#archive_mode = off # enables archiving; off, on, or always
# (change requires restart)
#archive_command = '' # command to use to archive a logfile segment
# placeholders: %p = path of file to archive
# %f = file name only
# e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'
archive_mode = on # enables archiving; off, on, or always (change requires restart)
archive_command = '/bin/true' # command to use to archive a logfile segment
# placeholders: %p = path of file to archive
# %f = file name only
# e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'
#archive_timeout = 0 # force a logfile segment switch after this
# number of seconds; 0 disables

Expand Down Expand Up @@ -758,9 +757,6 @@ jit_provider = 'llvmjit' # JIT library to use
# User-supplied custom parameters, override any automatically generated ones
#include = '/etc/postgresql-custom/custom-overrides.conf'

# WAL-G specific configurations
#include = '/etc/postgresql-custom/wal-g.conf'

# supautils specific configurations
#include = '/etc/postgresql-custom/supautils.conf'

Expand Down
21 changes: 7 additions & 14 deletions ansible/tasks/setup-wal-g.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@
path: '/etc/wal-g/config.json'
state: 'touch'

- name: Move custom wal-g.conf file to /etc/postgresql-custom/wal-g.conf
ansible.builtin.template:
dest: '/etc/postgresql-custom/wal-g.conf'
group: 'postgres'
mode: '0664'
owner: 'postgres'
src: 'files/postgresql_config/custom_walg.conf.j2'

- name: Add script to be run for restore_command
ansible.builtin.template:
dest: '/home/postgres/wal_fetch.sh'
Expand All @@ -77,9 +69,10 @@
owner: 'root'
src: 'files/walg_helper_scripts/wal_change_ownership.sh'

- name: Include /etc/postgresql-custom/wal-g.conf in postgresql.conf
ansible.builtin.replace:
path: '/etc/postgresql/postgresql.conf'
regexp: "#include = '/etc/postgresql-custom/wal-g.conf'"
replace: "include = '/etc/postgresql-custom/wal-g.conf'"
become: true
- name: Move custom wal-g.conf file to /etc/postgresql-custom/conf.d/wal-g.conf
ansible.builtin.copy:
dest: '/etc/postgresql-custom/conf.d/wal-g.conf'
group: 'postgres'
mode: '0664'
owner: 'postgres'
src: 'files/postgresql_config/conf.d/wal-g.conf'
Loading