Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,11 @@ class mongodb::server {
}
```

##### `config_data`
A hash to allow for additional configuration options
to be set in user-provided template.


##### `rest`
Set to true to enable a simple REST interface. Default: false

Expand Down Expand Up @@ -559,6 +564,9 @@ Config content if the default doesn't match one needs.
##### `config_template`
Path to the config template if the default doesn't match one needs.

##### `config_data`
Hash containing key-value pairs to allow for additional configuration options to be set in user-provided template.

##### `configdb`
Array of the config servers IP addresses the mongos should connect to.

Expand Down
1 change: 1 addition & 0 deletions manifests/mongos.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
$config_content = undef,
$config_template = undef,
$configdb = $mongodb::params::mongos_configdb,
$config_data = $mongodb::params::config_data,
$service_manage = $mongodb::params::mongos_service_manage,
$service_provider = undef,
$service_name = $mongodb::params::mongos_service_name,
Expand Down
3 changes: 3 additions & 0 deletions manifests/mongos/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
$config_content = $mongodb::mongos::config_content,
$config_template = $mongodb::mongos::config_template,
$configdb = $mongodb::mongos::configdb,
$config_data = $mongodb::mongos::config_data,
) {

if ($ensure == 'present' or $ensure == true) {
Expand All @@ -13,8 +14,10 @@
if $config_content {
$config_content_real = $config_content
} elsif $config_template {
# Template has $config_data hash available
$config_content_real = template($config_template)
} else {
# Template has $config_data hash available
$config_content_real = template('mongodb/mongodb-shard.conf.erb')
}

Expand Down
2 changes: 2 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

$version = $::mongodb::globals::version

$config_data = undef

# Amazon Linux's OS Family is 'Linux', operating system 'Amazon'.
case $::osfamily {
'RedHat', 'Linux', 'Suse': {
Expand Down
1 change: 1 addition & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
$syslog = undef,
$config_content = undef,
$config_template = undef,
$config_data = undef,
$ssl = undef,
$ssl_key = undef,
$ssl_ca = undef,
Expand Down
8 changes: 8 additions & 0 deletions manifests/server/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
$config = $mongodb::server::config
$config_content = $mongodb::server::config_content
$config_template = $mongodb::server::config_template
$config_data = $mongodb::server::config_data
$dbpath = $mongodb::server::dbpath
$dbpath_fix = $mongodb::server::dbpath_fix
$pidfilepath = $mongodb::server::pidfilepath
Expand Down Expand Up @@ -109,6 +110,8 @@
if $config_content {
$cfg_content = $config_content
} elsif $config_template {
# Template has available user-supplied data
# - $config_data
$cfg_content = template($config_template)
} elsif $version and (versioncmp($version, '2.6.0') >= 0) {
# Template uses:
Expand Down Expand Up @@ -152,6 +155,9 @@
# - $system_logrotate
# - $verbose
# - $verbositylevel

# Template has available user-supplied data
# - $config_data
$cfg_content = template('mongodb/mongodb.conf.2.6.erb')
} else {
# Fall back to oldest most basic config
Expand Down Expand Up @@ -209,6 +215,8 @@
# - $syslog
# - $verbose
# - $verbositylevel
# Template has available user-supplied data
# - $config_data
$cfg_content = template('mongodb/mongodb.conf.erb')
}

Expand Down
6 changes: 6 additions & 0 deletions templates/mongodb-shard.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ logpath = <%= @logpath %>
<% if @unixsocketprefix -%>
unixSocketPrefix = <%= @unixsocketprefix %>
<% end -%>

<% if @config_data -%>
<% @config_data.each do |k,v| -%>
<%= k %> = <%= v %>
<% end -%>
<% end -%>
6 changes: 6 additions & 0 deletions templates/mongodb.conf.2.6.erb
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,9 @@ operationProfiling.slowOpThresholdMs: <%= @slowms %>
<% if @set_parameter -%>
setParameter: <%= @set_parameter %>
<% end -%>

<% if @config_data -%>
<% @config_data.each do |k,v| -%>
<%= k %>: <%= v %>
<% end -%>
<% end -%>
6 changes: 6 additions & 0 deletions templates/mongodb.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,9 @@ sslWeakCertificateValidation = <%= @ssl_weak_cert %>
net.ssl.allowInvalidHostnames = <%= @ssl_invalid_hostnames %>
<% end -%>
<% end -%>

<% if @config_data -%>
<% @config_data.each do |k,v| -%>
<%= k %> = <%= v %>
<% end -%>
<% end -%>