diff options
| author | Thomas Cuthbert <thomas.cuthbert@canonical.com> | 2018-07-09 17:45:53 +0800 |
|---|---|---|
| committer | Thomas Cuthbert <thomas.cuthbert@canonical.com> | 2018-07-09 17:45:53 +0800 |
| commit | 531ea207f911500d947bf2d642f8d3114364e14c (patch) | |
| tree | 5a7e9eec722d4e9ec5ac6d46d21dfe355f5391ac | |
| parent | 7e6f2361252055c19e8f70752d071eecc17e468e (diff) | |
Listen on all interfaces when HA is enable
The MongoDB version that ships with bionic starts as localhost by default.
| -rwxr-xr-x | hooks/hooks.py | 6 |
1 files changed, 5 insertions, 1 deletions
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']: |
