Skip to content

Commit

Permalink
Merge pull request voxpupuli#535 from radupantiru/develop
Browse files Browse the repository at this point in the history
Fix for MongoDB v4 Replica Set initialization
  • Loading branch information
bastelfreak committed Apr 8, 2019
2 parents 4e8b866 + e435bea commit d03357d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/puppet/provider/mongodb_replset/mongo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ def get_hosts_status(members)
alive.push(member)
end

if status.key?('errmsg') && status['errmsg'].include?('no replset config has been received')
Puppet.debug 'Mongo v4 rs.status() RS not initialized output'
alive.push(member)
end

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

0 comments on commit d03357d

Please sign in to comment.