Skip init logic if custom PostgreSQL config files are mounted (#96)

This commit is contained in:
Juan Ariza Toledano
2021-11-11 19:37:02 +01:00
committed by GitHub
parent 6775c24675
commit 043bd560a8
6 changed files with 66 additions and 48 deletions

View File

@@ -683,15 +683,18 @@ repmgr_initialize() {
fi
fi
postgresql_initialize
# Allow remote connections, required to register primary and standby nodes
postgresql_enable_remote_connections
# Configure port and restrict access to PostgreSQL (MD5)
postgresql_set_property "port" "$POSTGRESQL_PORT_NUMBER"
if ! postgresql_is_file_external "postgresql.conf"; then
# Allow remote connections, required to register primary and standby nodes
postgresql_enable_remote_connections
# Configure port and restrict access to PostgreSQL (MD5)
postgresql_set_property "port" "$POSTGRESQL_PORT_NUMBER"
postgresql_configure_replication_parameters
postgresql_configure_fsync
is_boolean_yes "$REPMGR_PGHBA_TRUST_ALL" || postgresql_restrict_pghba
postgresql_configure_replication_parameters
postgresql_configure_fsync
fi
if ! postgresql_is_file_external "pg_hba.conf"; then
is_boolean_yes "$REPMGR_PGHBA_TRUST_ALL" || postgresql_restrict_pghba
fi
if [[ "$REPMGR_ROLE" = "primary" ]]; then
if is_boolean_yes "$POSTGRESQL_FIRST_BOOT"; then
postgresql_start_bg

View File

@@ -683,15 +683,18 @@ repmgr_initialize() {
fi
fi
postgresql_initialize
# Allow remote connections, required to register primary and standby nodes
postgresql_enable_remote_connections
# Configure port and restrict access to PostgreSQL (MD5)
postgresql_set_property "port" "$POSTGRESQL_PORT_NUMBER"
if ! postgresql_is_file_external "postgresql.conf"; then
# Allow remote connections, required to register primary and standby nodes
postgresql_enable_remote_connections
# Configure port and restrict access to PostgreSQL (MD5)
postgresql_set_property "port" "$POSTGRESQL_PORT_NUMBER"
postgresql_configure_replication_parameters
postgresql_configure_fsync
is_boolean_yes "$REPMGR_PGHBA_TRUST_ALL" || postgresql_restrict_pghba
postgresql_configure_replication_parameters
postgresql_configure_fsync
fi
if ! postgresql_is_file_external "pg_hba.conf"; then
is_boolean_yes "$REPMGR_PGHBA_TRUST_ALL" || postgresql_restrict_pghba
fi
if [[ "$REPMGR_ROLE" = "primary" ]]; then
if is_boolean_yes "$POSTGRESQL_FIRST_BOOT"; then
postgresql_start_bg

View File

@@ -683,15 +683,18 @@ repmgr_initialize() {
fi
fi
postgresql_initialize
# Allow remote connections, required to register primary and standby nodes
postgresql_enable_remote_connections
# Configure port and restrict access to PostgreSQL (MD5)
postgresql_set_property "port" "$POSTGRESQL_PORT_NUMBER"
if ! postgresql_is_file_external "postgresql.conf"; then
# Allow remote connections, required to register primary and standby nodes
postgresql_enable_remote_connections
# Configure port and restrict access to PostgreSQL (MD5)
postgresql_set_property "port" "$POSTGRESQL_PORT_NUMBER"
postgresql_configure_replication_parameters
postgresql_configure_fsync
is_boolean_yes "$REPMGR_PGHBA_TRUST_ALL" || postgresql_restrict_pghba
postgresql_configure_replication_parameters
postgresql_configure_fsync
fi
if ! postgresql_is_file_external "pg_hba.conf"; then
is_boolean_yes "$REPMGR_PGHBA_TRUST_ALL" || postgresql_restrict_pghba
fi
if [[ "$REPMGR_ROLE" = "primary" ]]; then
if is_boolean_yes "$POSTGRESQL_FIRST_BOOT"; then
postgresql_start_bg

View File

@@ -683,15 +683,18 @@ repmgr_initialize() {
fi
fi
postgresql_initialize
# Allow remote connections, required to register primary and standby nodes
postgresql_enable_remote_connections
# Configure port and restrict access to PostgreSQL (MD5)
postgresql_set_property "port" "$POSTGRESQL_PORT_NUMBER"
if ! postgresql_is_file_external "postgresql.conf"; then
# Allow remote connections, required to register primary and standby nodes
postgresql_enable_remote_connections
# Configure port and restrict access to PostgreSQL (MD5)
postgresql_set_property "port" "$POSTGRESQL_PORT_NUMBER"
postgresql_configure_replication_parameters
postgresql_configure_fsync
is_boolean_yes "$REPMGR_PGHBA_TRUST_ALL" || postgresql_restrict_pghba
postgresql_configure_replication_parameters
postgresql_configure_fsync
fi
if ! postgresql_is_file_external "pg_hba.conf"; then
is_boolean_yes "$REPMGR_PGHBA_TRUST_ALL" || postgresql_restrict_pghba
fi
if [[ "$REPMGR_ROLE" = "primary" ]]; then
if is_boolean_yes "$POSTGRESQL_FIRST_BOOT"; then
postgresql_start_bg

View File

@@ -683,15 +683,18 @@ repmgr_initialize() {
fi
fi
postgresql_initialize
# Allow remote connections, required to register primary and standby nodes
postgresql_enable_remote_connections
# Configure port and restrict access to PostgreSQL (MD5)
postgresql_set_property "port" "$POSTGRESQL_PORT_NUMBER"
if ! postgresql_is_file_external "postgresql.conf"; then
# Allow remote connections, required to register primary and standby nodes
postgresql_enable_remote_connections
# Configure port and restrict access to PostgreSQL (MD5)
postgresql_set_property "port" "$POSTGRESQL_PORT_NUMBER"
postgresql_configure_replication_parameters
postgresql_configure_fsync
is_boolean_yes "$REPMGR_PGHBA_TRUST_ALL" || postgresql_restrict_pghba
postgresql_configure_replication_parameters
postgresql_configure_fsync
fi
if ! postgresql_is_file_external "pg_hba.conf"; then
is_boolean_yes "$REPMGR_PGHBA_TRUST_ALL" || postgresql_restrict_pghba
fi
if [[ "$REPMGR_ROLE" = "primary" ]]; then
if is_boolean_yes "$POSTGRESQL_FIRST_BOOT"; then
postgresql_start_bg

View File

@@ -683,15 +683,18 @@ repmgr_initialize() {
fi
fi
postgresql_initialize
# Allow remote connections, required to register primary and standby nodes
postgresql_enable_remote_connections
# Configure port and restrict access to PostgreSQL (MD5)
postgresql_set_property "port" "$POSTGRESQL_PORT_NUMBER"
if ! postgresql_is_file_external "postgresql.conf"; then
# Allow remote connections, required to register primary and standby nodes
postgresql_enable_remote_connections
# Configure port and restrict access to PostgreSQL (MD5)
postgresql_set_property "port" "$POSTGRESQL_PORT_NUMBER"
postgresql_configure_replication_parameters
postgresql_configure_fsync
is_boolean_yes "$REPMGR_PGHBA_TRUST_ALL" || postgresql_restrict_pghba
postgresql_configure_replication_parameters
postgresql_configure_fsync
fi
if ! postgresql_is_file_external "pg_hba.conf"; then
is_boolean_yes "$REPMGR_PGHBA_TRUST_ALL" || postgresql_restrict_pghba
fi
if [[ "$REPMGR_ROLE" = "primary" ]]; then
if is_boolean_yes "$POSTGRESQL_FIRST_BOOT"; then
postgresql_start_bg