This won't `return` from the calling context, so this isn't a pure refactoring. Are we sure this won't effect the `ruby_block[config_replicaset]` and `ruby_block[config_sharding]`?

But total :+1: to DRYing out the code.