Skip to content

Commit 9237bbb

Browse files
committed
fixup! Connect to localhost in provider when possible
1 parent 0e27a11 commit 9237bbb

File tree

1 file changed

+5
-1
lines changed
  • lib/puppet/provider/mongodb_replset

1 file changed

+5
-1
lines changed

lib/puppet/provider/mongodb_replset/mongo.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ def get_hosts_status(members)
154154
host = member['host']
155155
Puppet.debug "Checking replicaset member #{host} ..."
156156
begin
157-
status = rs_status(host)
157+
if host.split(':').first == Facter.value(:fqdn)
158+
status = rs_status(conn_string)
159+
else
160+
status = rs_status(host)
161+
end
158162

159163
if status.key?('set')
160164
raise Puppet::Error, "Can't configure replicaset #{name}, host #{host} is already part of another replicaset." if status['set'] != name

0 commit comments

Comments
 (0)