Puppet Class: mongodb::mongos::config
- Defined in:
- manifests/mongos/config.pp
Overview
PRIVATE CLASS: do not call directly
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'manifests/mongos/config.pp', line 2
class mongodb::mongos::config (
$package_ensure = $mongodb::mongos::package_ensure,
$config = $mongodb::mongos::config,
$config_content = $mongodb::mongos::config_content,
$config_template = $mongodb::mongos::config_template,
$service_manage = $mongodb::mongos::service_manage,
# Used in the template
$configdb = $mongodb::mongos::configdb,
$bind_ip = $mongodb::mongos::bind_ip,
$port = $mongodb::mongos::port,
$fork = $mongodb::mongos::fork,
$pidfilepath = $mongodb::mongos::pidfilepath,
$logpath = $mongodb::mongos::logpath,
$unixsocketprefix = $mongodb::mongos::unixsocketprefix,
$config_data = $mongodb::mongos::config_data,
) {
if $package_ensure == 'purged' {
$ensure = 'absent'
} else {
$ensure = 'file'
}
#Pick which config content to use
if $config_content {
$config_content_real = $config_content
} else {
# Template has $config_data hash available
$config_content_real = template(pick($config_template, 'mongodb/mongodb-shard.conf.erb'))
}
file { $config:
ensure => $ensure,
content => $config_content_real,
owner => 'root',
group => 'root',
mode => '0644',
}
if $service_manage {
if $facts['os']['family'] == 'RedHat' or $facts['os']['family'] == 'Suse' {
file { '/etc/sysconfig/mongos' :
ensure => $ensure,
owner => 'root',
group => 'root',
mode => '0644',
content => "OPTIONS=\"--quiet -f ${config}\"\n",
}
} elsif $facts['os']['family'] == 'Debian' {
file { '/etc/init.d/mongos' :
ensure => $ensure,
content => template('mongodb/mongos/Debian/mongos.erb'),
owner => 'root',
group => 'root',
mode => '0755',
}
}
}
}
|