Bind MongoDB to internal eth

- Bind MongoDB to internal eth
- Readd nojournal
- Readd unit tests

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
This commit is contained in:
Emilien Macchi 2014-02-10 09:42:02 +01:00
parent 489b64b4ef
commit 91aaef6291
2 changed files with 21 additions and 7 deletions

View File

@ -17,11 +17,21 @@
#
# Install a nosql server (MongoDB)
#
# === Parameters:
#
# [*bind_ip*]
# (optional) IP address on which mongod instance should listen
# Defaults in params
#
# [*nojournal*]
# (optional) Disable mongodb internal cache. This is not recommended for
# production but results in a much faster boot process.
# http://docs.mongodb.org/manual/reference/configuration-options/#nojournal
# Defaults to false
#
class cloud::database::nosql(
# $bind_ip = $os_params::api_eth,
# disabled for the moment
# See: https://github.com/enovance/puppet-cloud/issues/186
$bind_ip = undef,
$bind_ip = $os_params::internal_netif_ip,
$nojournal = false,
) {
@ -33,7 +43,8 @@ class cloud::database::nosql(
manage_package_repo => true
}->
class { 'mongodb':
bind_ip => $bind_ip_real,
bind_ip => $bind_ip_real,
nojournal => $nojournal
}
}

View File

@ -23,13 +23,16 @@ describe 'cloud::database::nosql' do
shared_examples_for 'openstack database nosql' do
let :params do
{ :bind_ip => '10.0.0.1' }
{ :bind_ip => '10.0.0.1',
:nojournal => false }
end
it 'configure mongodb server' do
should contain_class('mongodb::globals').with( :manage_package_repo => true)
should contain_class('mongodb::globals').with_before('Class[Mongodb]')
should contain_class('mongodb').with(
:bind_ip => ['10.0.0.1']
:bind_ip => ['10.0.0.1'],
:nojournal => false
)
end