Skip to content

Instantly share code, notes, and snippets.

@sathlan
Created January 16, 2016 13:07
Show Gist options
  • Save sathlan/a39b3877c5c221e56104 to your computer and use it in GitHub Desktop.
Save sathlan/a39b3877c5c221e56104 to your computer and use it in GitHub Desktop.
Modified lib/puppet/provider/mongodb.rb
diff --git a/lib/puppet/provider/mongodb.rb b/lib/puppet/provider/mongodb.rb
index 6bbc350..d82fa83 100644
--- a/lib/puppet/provider/mongodb.rb
+++ b/lib/puppet/provider/mongodb.rb
@@ -55,8 +55,11 @@ class Puppet::Provider::Mongodb < Puppet::Provider
if bindip
first_ip_in_list = bindip.split(',').first
- if first_ip_in_list.eql? '0.0.0.0'
+ case first_ip_in_list
+ when '0.0.0.0'
ip_real = '127.0.0.1'
+ when '::0'
# bracket or not ?
+ ip_real = '[::1]'
else
ip_real = first_ip_in_list
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment