Puppet Class: mongodb::mongos

Inherits:
mongodb::params
Defined in:
manifests/mongos.pp

Overview

This installs a Mongo Shard daemon. See README.md for more details.

Parameters:

  • ensure (Any) (defaults to: $mongodb::params::mongos_ensure)
  • config (Any) (defaults to: $mongodb::params::mongos_config)
  • config_content (Any) (defaults to: undef)
  • config_template (Any) (defaults to: undef)
  • configdb (Any) (defaults to: $mongodb::params::mongos_configdb)
  • service_manage (Any) (defaults to: $mongodb::params::mongos_service_manage)
  • service_provider (Any) (defaults to: undef)
  • service_name (Any) (defaults to: $mongodb::params::mongos_service_name)
  • service_enable (Any) (defaults to: $mongodb::params::mongos_service_enable)
  • service_ensure (Any) (defaults to: $mongodb::params::mongos_service_ensure)
  • service_status (Any) (defaults to: $mongodb::params::mongos_service_status)
  • package_ensure (Any) (defaults to: $mongodb::params::package_ensure_mongos)
  • package_name (Any) (defaults to: $mongodb::params::mongos_package_name)
  • unixsocketprefix (Any) (defaults to: $mongodb::params::mongos_unixsocketprefix)
  • pidfilepath (Any) (defaults to: $mongodb::params::mongos_pidfilepath)
  • logpath (Any) (defaults to: $mongodb::params::mongos_logpath)
  • fork (Any) (defaults to: $mongodb::params::mongos_fork)
  • bind_ip (Any) (defaults to: undef)
  • port (Any) (defaults to: undef)
  • restart (Any) (defaults to: $mongodb::params::mongos_restart)


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
# File 'manifests/mongos.pp', line 2

class mongodb::mongos (
  $ensure           = $mongodb::params::mongos_ensure,
  $config           = $mongodb::params::mongos_config,
  $config_content   = undef,
  $config_template  = undef,
  $configdb         = $mongodb::params::mongos_configdb,
  $service_manage   = $mongodb::params::mongos_service_manage,
  $service_provider = undef,
  $service_name     = $mongodb::params::mongos_service_name,
  $service_enable   = $mongodb::params::mongos_service_enable,
  $service_ensure   = $mongodb::params::mongos_service_ensure,
  $service_status   = $mongodb::params::mongos_service_status,
  $package_ensure   = $mongodb::params::package_ensure_mongos,
  $package_name     = $mongodb::params::mongos_package_name,
  $unixsocketprefix = $mongodb::params::mongos_unixsocketprefix,
  $pidfilepath      = $mongodb::params::mongos_pidfilepath,
  $logpath          = $mongodb::params::mongos_logpath,
  $fork             = $mongodb::params::mongos_fork,
  $bind_ip          = undef,
  $port             = undef,
  $restart          = $mongodb::params::mongos_restart,
) inherits mongodb::params {

  if ($ensure == 'present' or $ensure == true) {
    if $restart {
      anchor { 'mongodb::mongos::start': }
      -> class { 'mongodb::mongos::install': }
      # If $restart is true, notify the service on config changes (~>)
      -> class { 'mongodb::mongos::config': }
      ~> class { 'mongodb::mongos::service': }
      -> anchor { 'mongodb::mongos::end': }
    } else {
      anchor { 'mongodb::mongos::start': }
      -> class { 'mongodb::mongos::install': }
      # If $restart is false, config changes won't restart the service (->)
      -> class { 'mongodb::mongos::config': }
      -> class { 'mongodb::mongos::service': }
      -> anchor { 'mongodb::mongos::end': }
    }
  } else {
    anchor { 'mongodb::mongos::start': }
    -> class { '::mongodb::mongos::service': }
    -> class { '::mongodb::mongos::config': }
    -> class { '::mongodb::mongos::install': }
    -> anchor { 'mongodb::mongos::end': }
  }

}