From 531ea207f911500d947bf2d642f8d3114364e14c Mon Sep 17 00:00:00 2001 From: Thomas Cuthbert Date: Mon, 9 Jul 2018 17:45:53 +0800 Subject: Listen on all interfaces when HA is enable The MongoDB version that ships with bionic starts as localhost by default. --- hooks/hooks.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hooks/hooks.py b/hooks/hooks.py index a458e99..ec4adfb 100755 --- a/hooks/hooks.py +++ b/hooks/hooks.py @@ -571,7 +571,11 @@ def enable_replset(replicaset_name=None): juju_log('enable_replset: Enabling replicaset configuration:') current_config = get_current_mongo_config() - config_data = config() + config_data = dict(config()) + + if is_bionic_or_greater(): + if config_data['bind_ip'] == "all": + config_data['bind_ip'] = '0.0.0.0' if 'replSet' in current_config and \ current_config['replSet'] == config_data['replicaset']: -- cgit v1.2.3