diff options
-rwxr-xr-x | hooks/hooks.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/hooks/hooks.py b/hooks/hooks.py index ec4adfb..93d8329 100755 --- a/hooks/hooks.py +++ b/hooks/hooks.py @@ -275,7 +275,10 @@ def mongodb_conf(config_data=None): # bind_ip if config_data['bind_ip'] != "all": config.append("bind_ip = %s" % config_data['bind_ip']) - config.append("") + elif is_bionic_or_greater(): + config_data['bind_ip'] = '0.0.0.0' + config.append("") + # port config.append("port = %d" % config_data['port']) @@ -573,10 +576,6 @@ def enable_replset(replicaset_name=None): current_config = get_current_mongo_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']: juju_log('enable_replset: replica set is already enabled', |