diff options
| author | Thomas Cuthbert <thomas.cuthbert@canonical.com> | 2018-07-09 09:47:54 +0000 |
|---|---|---|
| committer | Canonial IS Mergebot <canonical-is-mergebot@canonical.com> | 2018-07-09 09:47:54 +0000 |
| commit | 7b2828638b3dad83776fef60b0dc96825ec4e10e (patch) | |
| tree | 5a7e9eec722d4e9ec5ac6d46d21dfe355f5391ac | |
| parent | 7e6f2361252055c19e8f70752d071eecc17e468e (diff) | |
| parent | 531ea207f911500d947bf2d642f8d3114364e14c (diff) | |
Listen on all interfaces when HA is enabled. The MongoDB version that ships with bionic starts as localhost by default.
Reviewed-on: https://code.launchpad.net/~tcuthbert/mongodb-charm/+git/mongodb-charm/+merge/349169 Reviewed-by: Stuart Bishop <stuart.bishop@canonical.com>
| -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']: |
