From ca9b35206cab4eb31d3f5d397bf3cf9ffc1618da Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Thu, 5 Sep 2019 06:39:58 +0000 Subject: [PATCH] 4.0.3-centos-7-r3 release --- .../postgresql-repmgr/4/centos-7/Dockerfile | 6 +-- .../4/centos-7/rootfs/librepmgr.sh | 40 +++++++++++++------ bitnami/postgresql-repmgr/README.md | 2 +- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/bitnami/postgresql-repmgr/4/centos-7/Dockerfile b/bitnami/postgresql-repmgr/4/centos-7/Dockerfile index 4d80a15ea7c1..63ea27a433c3 100644 --- a/bitnami/postgresql-repmgr/4/centos-7/Dockerfile +++ b/bitnami/postgresql-repmgr/4/centos-7/Dockerfile @@ -1,4 +1,4 @@ -FROM bitnami/centos-extras-base:7-r125 +FROM bitnami/centos-extras-base:7-r126 LABEL maintainer "Bitnami " ENV BITNAMI_PKG_CHMOD="-R g+rwX" \ @@ -12,10 +12,10 @@ RUN install_packages glibc keyutils-libs krb5-libs libcom_err libedit libgcc lib RUN . ./libcomponent.sh && component_unpack "postgresql-repmgr" "4.0.3-0" --checksum ca0106030d42be0ca0c9429915c54502c08704d83f311b340e4de94d084b547a COPY rootfs / -RUN yum -y install epel-release && yum -y update && yum -y install nss_wrapper +RUN yum --enablerepo base,updates,extras -y install epel-release && yum --enablerepo base,updates,extras -y update && yum --enablerepo base,updates -y install nss_wrapper RUN /postunpack.sh ENV BITNAMI_APP_NAME="postgresql-repmgr" \ - BITNAMI_IMAGE_VERSION="4.0.3-centos-7-r2" \ + BITNAMI_IMAGE_VERSION="4.0.3-centos-7-r3" \ NAMI_PREFIX="/.nami" \ NSS_WRAPPER_LIB="/usr/lib64/libnss_wrapper.so" \ PATH="/opt/bitnami/postgresql-repmgr/bin:/opt/bitnami/repmgr/bin:/opt/bitnami/postgresql/bin:$PATH" diff --git a/bitnami/postgresql-repmgr/4/centos-7/rootfs/librepmgr.sh b/bitnami/postgresql-repmgr/4/centos-7/rootfs/librepmgr.sh index 79e5b449140a..a0789af82be3 100644 --- a/bitnami/postgresql-repmgr/4/centos-7/rootfs/librepmgr.sh +++ b/bitnami/postgresql-repmgr/4/centos-7/rootfs/librepmgr.sh @@ -41,6 +41,7 @@ repmgr_env() { # Paths export REPMGR_BASE_DIR="/opt/bitnami/repmgr" export REPMGR_CONF_DIR="${REPMGR_BASE_DIR}/conf" +export REPMGR_MOUNTED_CONF_DIR="${REPMGR_MOUNTED_CONF_DIR:-/bitnami/repmgr/conf}" export REPMGR_TMP_DIR="${REPMGR_BASE_DIR}/tmp" export REPMGR_EVENTS_DIR="${REPMGR_BASE_DIR}/events" export REPMGR_PRIMARY_ROLE_LOCK_FILE_NAME="${REPMGR_TMP_DIR}/master.lock" @@ -353,14 +354,14 @@ repmgr_inject_postgresql_configuration() { postgresql_set_property "logging_collector" "on" postgresql_set_property "log_directory" "$POSTGRESQL_LOG_DIR" postgresql_set_property "log_filename" "postgresql.log" - cp "$POSTGRESQL_CONF_FILE" "$POSTGRESQL_MOUNTED_CONF_DIR/postgresql.conf" + cp "$POSTGRESQL_CONF_FILE" "${POSTGRESQL_MOUNTED_CONF_DIR}/postgresql.conf" } ######################## # Use a different pg_hba.conf file by pretending it's an injected custom configuration\ # Globals: +# POSTGRESQL_MOUNTED_CONF_DIR # REPMGR_* -# POSTGRESQL_* # Arguments: # None # Returns: @@ -382,21 +383,29 @@ EOF # Prepare PostgreSQL default configuration # Globals: # POSTGRESQL_MOUNTED_CONF_DIR +# REPMGR_MOUNTED_CONF_DIR # Arguments: # None # Returns: # None ######################### repmgr_postgresql_configuration() { - repmgr_info "Preparing PostgreSQL configuration..." - # User injected custom configuration - if [[ -d "$POSTGRESQL_MOUNTED_CONF_DIR" ]] && compgen -G "$POSTGRESQL_MOUNTED_CONF_DIR"/* > /dev/null; then - repmgr_debug "User injected custom configuration detected!" - else - ensure_dir_exists "$POSTGRESQL_MOUNTED_CONF_DIR" - repmgr_inject_postgresql_configuration - repmgr_inject_pghba_configuration - fi + repmgr_info "Preparing PostgreSQL configuration..." + # User injected custom configuration + if [[ -d "$REPMGR_MOUNTED_CONF_DIR" ]] && compgen -G "$REPMGR_MOUNTED_CONF_DIR"/* > /dev/null; then + repmgr_debug "User injected custom configuration detected!" + fi + ensure_dir_exists "$POSTGRESQL_MOUNTED_CONF_DIR" + if [[ -f "${REPMGR_MOUNTED_CONF_DIR}/postgresql.conf" ]]; then + cp "${REPMGR_MOUNTED_CONF_DIR}/postgresql.conf" "${POSTGRESQL_MOUNTED_CONF_DIR}/postgresql.conf" + else + repmgr_inject_postgresql_configuration + fi + if [[ -f "${REPMGR_MOUNTED_CONF_DIR}/pg_hba.conf" ]]; then + cp "${REPMGR_MOUNTED_CONF_DIR}/pg_hba.conf" "${POSTGRESQL_MOUNTED_CONF_DIR}/pg_hba.conf" + else + repmgr_inject_pghba_configuration + fi } ######################## @@ -412,7 +421,11 @@ repmgr_postgresql_configuration() { repmgr_generate_repmgr_config() { repmgr_info "Preparing repmgr configuration..." - cat << EOF >> "$REPMGR_CONF_FILE" + if [[ -f "${REPMGR_MOUNTED_CONF_DIR}/repmgr.conf" ]]; then + repmgr_info "Custom repmgr.conf file detected" + cp "${REPMGR_MOUNTED_CONF_DIR}/repmgr.conf" "$REPMGR_CONF_FILE" + else + cat << EOF >> "$REPMGR_CONF_FILE" event_notification_command='${REPMGR_EVENTS_DIR}/router.sh %n %e %s "%t" "%d"' ssh_options=-o \"StrictHostKeyChecking no\" -v use_replication_slots=$REPMGR_USE_REPLICATION_SLOTS @@ -433,6 +446,7 @@ degraded_monitoring_timeout=$REPMGR_DEGRADED_MONITORING_TIMEOUT data_directory=$POSTGRESQL_DATA_DIR async_query_timeout=$REPMGR_MASTER_RESPONSE_TIMEOUT EOF + fi } ######################## @@ -587,6 +601,8 @@ repmgr_initialize() { postgresql_stop postgresql_start_bg repmgr_register_primary + # Allow running custom initialization scripts + postgresql_custom_init_scripts else postgresql_start_bg repmgr_unregister_standby diff --git a/bitnami/postgresql-repmgr/README.md b/bitnami/postgresql-repmgr/README.md index bdc7adacb2f5..d6ad67f23398 100644 --- a/bitnami/postgresql-repmgr/README.md +++ b/bitnami/postgresql-repmgr/README.md @@ -45,7 +45,7 @@ Learn more about the Bitnami tagging policy and the difference between rolling t * [`4-ol-7`, `4.0.3-ol-7-r3` (4/ol-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/4.0.3-ol-7-r3/4/ol-7/Dockerfile) * [`4-debian-9`, `4.0.3-debian-9-r6`, `4`, `4.0.3`, `4.0.3-r6`, `latest` (4/debian-9/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/4.0.3-debian-9-r6/4/debian-9/Dockerfile) -* [`4-centos-7`, `4.0.3-centos-7-r2` (4/centos-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/4.0.3-centos-7-r2/4/centos-7/Dockerfile) +* [`4-centos-7`, `4.0.3-centos-7-r3` (4/centos-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql-repmgr/blob/4.0.3-centos-7-r3/4/centos-7/Dockerfile) Subscribe to project updates by watching the [bitnami/postgresql-repmgr GitHub repo](https://github.com/bitnami/bitnami-docker-postgresql-repmgr).