summaryrefslogtreecommitdiff
diff options
authorDrew Freiberger <drew.freiberger@canonical.com>2018-10-31 22:53:48 +0000
committerCanonial IS Mergebot <canonical-is-mergebot@canonical.com>2018-10-31 22:53:48 +0000
commit136dbc1fd42a4d9d429046140485fb6433872e3b (patch)
tree412e3775cd19487de5ae160a4b49dcc4aea49be7
parent7b2828638b3dad83776fef60b0dc96825ec4e10e (diff)
parent4f9b946b2afe3f2eaa179beaab8d5929eed19270 (diff)
Ensure bind_ip=all listens externally on bionic
Reviewed-on: https://code.launchpad.net/~afreiberger/mongodb-charm/+git/mongodb-charm/+merge/358133 Reviewed-by: Xav Paice <xav.paice@canonical.com>
-rwxr-xr-xhooks/hooks.py9
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',