-
Notifications
You must be signed in to change notification settings - Fork 260
Backport MongoDB hosts array support to 3.x #879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 3.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,32 @@ | |
| it { is_expected.to contain_file(conf_file).without_content(%r{tags:}) } | ||
| end | ||
|
|
||
| context 'with one mongo host defined in hosts array' do | ||
| let(:params) do | ||
| { | ||
| servers: [ | ||
| { | ||
| 'hosts' => ['localhost:27017'], | ||
| 'username' => 'user', | ||
| 'password' => 'pass', | ||
| 'database' => 'admin', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this database admin required for mongo? I noticed it was different from the original PR that was linked, but I'm not familiar enough with mongo to know what implications this has |
||
| 'dbm' => true, | ||
| 'database_autodiscovery' => { 'enabled' => true }, | ||
| 'reported_database_hostname' => 'mongohost', | ||
| }, | ||
| ], | ||
| } | ||
| end | ||
|
|
||
| it { is_expected.to contain_file(conf_file).with_content(%r{- hosts:\s+- localhost:27017}) } | ||
| it { is_expected.to contain_file(conf_file).with_content(%r{username: user}) } | ||
| it { is_expected.to contain_file(conf_file).with_content(%r{password: pass}) } | ||
| it { is_expected.to contain_file(conf_file).with_content(%r{database: admin}) } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same idea here |
||
| it { is_expected.to contain_file(conf_file).with_content(%r{dbm: true}) } | ||
| it { is_expected.to contain_file(conf_file).with_content(%r{database_autodiscovery:\s+enabled: true}) } | ||
| it { is_expected.to contain_file(conf_file).with_content(%r{reported_database_hostname: mongohost}) } | ||
| end | ||
|
|
||
| context 'with one mongo' do | ||
| let(:params) do | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll add a changelog entry upon release, so this can be removed