diff --git a/bitnami/mongodb-sharded/4.4/debian-10/rootfs/opt/bitnami/scripts/libmongodb.sh b/bitnami/mongodb-sharded/4.4/debian-10/rootfs/opt/bitnami/scripts/libmongodb.sh index 1a8a098b959f..33c1ae7fa8af 100644 --- a/bitnami/mongodb-sharded/4.4/debian-10/rootfs/opt/bitnami/scripts/libmongodb.sh +++ b/bitnami/mongodb-sharded/4.4/debian-10/rootfs/opt/bitnami/scripts/libmongodb.sh @@ -119,9 +119,6 @@ in the primary node and MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD in the rest of nod } if [[ -n "$MONGODB_REPLICA_SET_MODE" ]]; then - if [[ -z "$MONGODB_ADVERTISED_HOSTNAME" ]]; then - warn "In order to use hostnames instead of IPs your should set MONGODB_ADVERTISED_HOSTNAME" - fi if [[ "$MONGODB_REPLICA_SET_MODE" =~ ^(secondary|arbiter|hidden) ]]; then if [[ -z "$MONGODB_INITIAL_PRIMARY_HOST" ]]; then error_message="In order to configure MongoDB as a secondary or arbiter node \ @@ -245,10 +242,12 @@ mongodb_copy_mounted_config() { # Arguments: # None # Returns: -# The value of $MONGODB_ADVERTISED_HOSTNAME or the current host address +# The value of get_machine_ip, $MONGODB_ADVERTISED_HOSTNAME or the current host address ######################## get_mongo_hostname() { - if [[ -n "$MONGODB_ADVERTISED_HOSTNAME" ]]; then + if is_boolean_yes "$MONGODB_ADVERTISE_IP"; then + get_machine_ip + elif [[ -n "$MONGODB_ADVERTISED_HOSTNAME" ]]; then echo "$MONGODB_ADVERTISED_HOSTNAME" else hostname diff --git a/bitnami/mongodb-sharded/4.4/debian-10/rootfs/opt/bitnami/scripts/mongodb-env.sh b/bitnami/mongodb-sharded/4.4/debian-10/rootfs/opt/bitnami/scripts/mongodb-env.sh index 3ec7773cd643..b1ec7975bf00 100644 --- a/bitnami/mongodb-sharded/4.4/debian-10/rootfs/opt/bitnami/scripts/mongodb-env.sh +++ b/bitnami/mongodb-sharded/4.4/debian-10/rootfs/opt/bitnami/scripts/mongodb-env.sh @@ -31,6 +31,7 @@ mongodb_env_vars=( MONGODB_ENABLE_NUMACTL MONGODB_SHELL_EXTRA_FLAGS MONGODB_ADVERTISED_HOSTNAME + MONGODB_ADVERTISE_IP MONGODB_ADVERTISED_PORT_NUMBER MONGODB_DISABLE_JAVASCRIPT MONGODB_ENABLE_JOURNAL @@ -119,6 +120,7 @@ export MONGODB_ENABLE_NUMACTL="${MONGODB_ENABLE_NUMACTL:-false}" MONGODB_SHELL_EXTRA_FLAGS="${MONGODB_SHELL_EXTRA_FLAGS:-"${MONGODB_CLIENT_EXTRA_FLAGS:-}"}" export MONGODB_SHELL_EXTRA_FLAGS="${MONGODB_SHELL_EXTRA_FLAGS:-}" export MONGODB_ADVERTISED_HOSTNAME="${MONGODB_ADVERTISED_HOSTNAME:-}" +export MONGODB_ADVERTISE_IP="${MONGODB_ADVERTISE_IP:-false}" export MONGODB_ADVERTISED_PORT_NUMBER="${MONGODB_ADVERTISED_PORT_NUMBER:-}" export MONGODB_DISABLE_JAVASCRIPT="${MONGODB_DISABLE_JAVASCRIPT:-no}" export MONGODB_ENABLE_JOURNAL="${MONGODB_ENABLE_JOURNAL:-}" diff --git a/bitnami/mongodb-sharded/README.md b/bitnami/mongodb-sharded/README.md index e5ee92a80925..743317a70889 100644 --- a/bitnami/mongodb-sharded/README.md +++ b/bitnami/mongodb-sharded/README.md @@ -46,7 +46,7 @@ Learn more about the Bitnami tagging policy and the difference between rolling t * [`5.0`, `5.0-debian-10`, `5.0.9`, `5.0.9-debian-10-r0`, `latest` (5.0/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/5.0.9-debian-10-r0/5.0/debian-10/Dockerfile) -* [`4.4`, `4.4-debian-10`, `4.4.14`, `4.4.14-debian-10-r13` (4.4/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.4.14-debian-10-r13/4.4/debian-10/Dockerfile) +* [`4.4`, `4.4-debian-10`, `4.4.14`, `4.4.14-debian-10-r14` (4.4/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.4.14-debian-10-r14/4.4/debian-10/Dockerfile) * [`4.2`, `4.2-debian-10`, `4.2.20`, `4.2.20-debian-10-r17` (4.2/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.2.20-debian-10-r17/4.2/debian-10/Dockerfile) Subscribe to project updates by watching the [bitnami/mongodb GitHub repo](https://github.com/bitnami/bitnami-docker-mongodb).