Puppet Class: mongodb::mongos::config

Defined in:
manifests/mongos/config.pp

Summary

Manages mongos config

Overview

Parameters:

  • package_ensure (Any) (defaults to: $mongodb::mongos::package_ensure)

    This setting can be used to specify if puppet should install the package or not

  • config (Any) (defaults to: $mongodb::mongos::config)

    Path of the config file. If not specified, the module will use the default for your OS distro.

  • config_content (Any) (defaults to: $mongodb::mongos::config_content)

    Config content if the default doesn’t match one needs.

  • config_template (Any) (defaults to: $mongodb::mongos::config_template)

    Path to the config template if the default doesn’t match one needs.

  • service_manage (Any) (defaults to: $mongodb::mongos::service_manage)

    Whether or not the MongoDB sharding service resource should be part of the catalog.

  • configdb (Any) (defaults to: $mongodb::mongos::configdb)

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

  • bind_ip (Any) (defaults to: $mongodb::mongos::bind_ip)

    Set this option to configure the mongod or mongos process to bind to and listen for connections from applications on this address. If not specified, the module will use the default for your OS distro.

  • port (Any) (defaults to: $mongodb::mongos::port)

    Specifies a TCP port for the server instance to listen for client connections.

  • fork (Any) (defaults to: $mongodb::mongos::fork)

    Set to true to fork server process at launch time. The default setting depends on the operating system.

  • pidfilepath (Any) (defaults to: $mongodb::mongos::pidfilepath)

    Specify a file location to hold the PID or process ID of the mongod process. If not specified, the module will use the default for your OS distro.

  • logpath (Any) (defaults to: $mongodb::mongos::logpath)

    Specify the path to a file name for the log file that will hold all diagnostic logging information. Unless specified, mongod will output all log information to the standard output.

  • unixsocketprefix (Any) (defaults to: $mongodb::mongos::unixsocketprefix)

    The path for the UNIX socket. If this option has no value, the mongos process creates a socket with /tmp as a prefix.

  • config_data (Any) (defaults to: $mongodb::mongos::config_data)

    Hash containing key-value pairs to allow for additional configuration options to be set in user-provided templ ate.



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'manifests/mongos/config.pp', line 47

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',
  }
}