diff --git a/README.md b/README.md index ac8ddd960..7773211c4 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,8 @@ 2. [Module Description - What does the module do?](#module-description) 3. [Setup - The basics of getting started with mongodb](#setup) 4. [Usage - Configuration options and additional functionality](#usage) -5. [Reference - An under-the-hood peek at what the module is doing and how](#reference) -6. [Limitations - OS compatibility, etc.](#limitations) -7. [Development - Guide for contributing to the module](#development) +5. [Limitations - OS compatibility, etc.](#limitations) +6. [Development - Guide for contributing to the module](#development) ## Overview @@ -136,640 +135,6 @@ and then set the emails later. Most of the interaction for the server is done via `mongodb::opsmanager`. For more options please have a look at [mongodb::opsmanager](#class-mongodbopsmanager). -## Reference - -### Classes - -#### Public classes -* `mongodb::server`: Installs and configure MongoDB -* `mongodb::client`: Installs the MongoDB client shell (for Red Hat family systems) -* `mongodb::globals`: Configure main settings in a global way -* `mongodb::mongos`: Installs and configure Mongos server (for sharding support) -* `mongodb::opsmanager`: Installs and configure Ops Manager - -#### Private classes -* `mongodb::repo`: Manage MongoDB software repository -* `mongodb::repo::apt`: Manage Debian/Ubuntu apt MongoDB repository -* `mongodb::repo::yum`: Manage Redhat/CentOS yum MongoDB repository -* `mongodb::server::config`: Configures MongoDB configuration files -* `mongodb::server::install`: Install MongoDB software packages -* `mongodb::server::service`: Manages service -* `mongodb::client::install`: Installs the MongoDB client software package -* `mongodb::mongos::config`: Configures Mongos configuration files -* `mongodb::mongos::install`: Install Mongos software packages -* `mongodb::mongos::service`: Manages Mongos service - -#### Class: mongodb::globals -*Note:* most server specific defaults should be overridden in the `mongodb::server` -class. This class should only be used if you are using a non-standard OS or -if you are changing elements such as `version` or `manage_package_repo` that -can only be changed here. - -This class allows you to configure the main settings for this module in a -global way, to be used by the other classes and defined resources. On its -own it does nothing. - -##### `server_package_name` -This setting can be used to override the default MongoDB server package -name. If not specified, the module will use whatever package name is the -default for your OS distro. - -##### `service_name` -This setting can be used to override the default MongoDB service name. If not -specified, the module will use whatever service name is the default for your OS distro. - -##### `service_provider` -This setting can be used to override the default MongoDB service provider. If -not specified, the module will use whatever service provider is the default for -your OS distro. - -##### `service_status` -This setting can be used to override the default status check command for -your MongoDB service. If not specified, the module will use whatever service -name is the default for your OS distro. - -##### `mongod_service_manage` -This setting can be used to override the default management of the mongod service. -By default the module will manage the mongod process. - -##### `mongos_service_manage` -This setting can be used to override the default management of the mongos service. -By default the module will manage the mongos process. - -##### `user` -This setting can be used to override the default MongoDB user and owner of the -service and related files in the file system. If not specified, the module will -use the default for your OS distro. - -##### `group` -This setting can be used to override the default MongoDB user group to be used -for related files in the file system. If not specified, the module will use -the default for your OS distro. - -##### `ipv6` -This setting is used to configure MongoDB to turn on ipv6 support. If not specified -and ipv6 address is passed to MongoDB bind_ip it will just fail. - -##### `bind_ip` -This setting can be used to configure MonogDB 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. -*Note:* This value should be passed as an array. - -##### `use_enterprise_repo` -When `manage_package_repo` is set to true, this setting indicates if it will -use the Community Edition (false, the default) or the Enterprise one (true). - -##### `version` -The version of MonogDB to install/manage. This is needed when managing -repositories. If not specified, the module will use the default for your OS -distro. - -##### `repo_location` -This setting can be used to override the default MongoDB repository location. -If not specified, the module will use the default repository for your OS distro. - -##### `repo_proxy` -This will allow you to set a proxy for your repository in case you are behind a corporate firewall. Currently this is only supported with yum repositories - -##### `proxy_username` -This sets the username for the proxyserver, should authentication be required - -##### `proxy_password` -This sets the password for the proxyserver, should authentication be required - -#### Class: mongodb::server - -Most of the parameters manipulate the mongod.conf file. - -For more details about configuration parameters consult the -[MongoDB Configuration File Options](http://docs.mongodb.org/manual/reference/configuration-options/). - -##### `ensure` -Used to ensure that the package is installed and the service is running, or that the package is absent/purged and the service is stopped. Valid values are true/false/present/absent/purged. - -##### `config` -Path of the config file. If not specified, the module will use the default -for your OS distro. - -##### `dbpath` -Set this value to designate a directory for the mongod instance to store -it's data. If not specified, the module will use the default for your OS distro. - -##### `dbpath_fix` -Set this value to true if you want puppet to recursively manage the permissions -of the files in the dbpath directory. If you are using the default dbpath, this -should probably be false. Set this to true if you are using a custom dbpath. The -default is false. - -##### `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. - -##### `manage_pidfile` -Should puppet create the pidfile. Mondod 6.2.10 will not start if pidfile exists - -##### `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. - -##### `ipv6` -This setting has to be true to configure MongoDB to turn on ipv6 support. If not specified -and ipv6 address is passed to MongoDB bind_ip it will just fail. - -##### `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. Example: bind_ip=['127.0.0.1', '192.168.0.3'] -*Note*: bind_ip accepts an array as a value. - -##### `logappend` -Set to true to add new entries to the end of the logfile rather than overwriting -the content of the log when the process restarts. Default: True - -##### `system_logrotate` -Set to reopen for mongo to close a log file then reopen it so that logrotations handled -outside of mongo perform as expected. Default: undef - -##### `fork` -Set to true to fork server process at launch time. The default setting depends on -the operating system. - -##### `port` -Specifies a TCP port for the server instance to listen for client connections. -Default: 27017 - -##### `journal` -Set to true to enable operation journaling to ensure write durability and -data consistency. Default: on 64-bit systems true and on 32-bit systems false - -##### `nojournal` -Set nojournal = true to disable durability journaling. By default, mongod -enables journaling in 64-bit versions after v2.0. -Default: on 64-bit systems false and on 32-bit systems true - -*Note*: You must use journal to enable journaling on 32-bit systems. - -##### `smallfiles` -Set to true to modify MongoDB to use a smaller default data file size. -Specifically, smallfiles reduces the initial size for data files and -limits them to 512 megabytes. Default: false - -##### `cpu` -Set to true to force mongod to report every four seconds CPU utilization -and the amount of time that the processor waits for I/O operations to -complete (i.e. I/O wait.) Default: false - -##### `auth` -Set to true to enable database authentication for users connecting from -remote hosts. If no users exist, the localhost interface will continue -to have access to the database until you create the first user. -Default: false - -##### `noauth` -Disable authentication. Currently the default. Exists for future compatibility - and clarity. - -##### `verbose` -Increases the amount of internal reporting returned on standard output or in -the log file generated by `logpath`. Default: false - -##### `verbositylevel` -MongoDB has the following levels of verbosity: v, vv, vvv, vvvv and vvvvv. -Default: None - -##### `objcheck` -Forces the mongod to validate all requests from clients upon receipt to ensure -that clients never insert invalid documents into the database. - -##### `quota` -Set to true to enable a maximum limit for the number of data files each database -can have. The default quota is 8 data files, when quota is true. Default: false - -##### `quotafiles` -Modify limit on the number of data files per database. This option requires the -`quota` setting. Default: 8 - -##### `diaglog` -Creates a very verbose diagnostic log for troubleshooting and recording various -errors. Valid values: 0, 1, 2, 3 and 7. -For more information please refer to [MongoDB Configuration File Options](http://docs.mongodb.org/manual/reference/configuration-options/). - -##### `directoryperdb` -Set to true to modify the storage pattern of the data directory to store each -database’s files in a distinct folder. Default: false - -##### `profile` -Modify this value to changes the level of database profiling, which inserts -information about operation performance into output of mongod or the -log file if specified by `logpath`. - -##### `maxconns` -Specifies a value to set the maximum number of simultaneous connections -that MongoDB will accept. Default: depends on system (i.e. ulimit and file descriptor) -limits. Unless set, MongoDB will not limit its own connections. - -##### `oplog_size` -Specifies a maximum size in megabytes for the replication operation log -(e.g. oplog.) mongod creates an oplog based on the maximum amount of space -available. For 64-bit systems, the oplog is typically 5% of available disk space. - -##### `nohints` -Ignore query hints. Default: None - -##### `nohttpinterface` -Set to true to disable the HTTP interface. This command will override the rest -and disable the HTTP interface if you specify both. Default: false - -##### `noscripting` -Set noscripting = true to disable the scripting engine. Default: false - -##### `notablescan` -Set notablescan = true to forbid operations that require a table scan. Default: false - -##### `noprealloc` -Set noprealloc = true to disable the preallocation of data files. This will shorten -the start up time in some cases, but can cause significant performance penalties -during normal operations. Default: false - -##### `nssize` -Use this setting to control the default size for all newly created namespace -files (i.e .ns). Default: 16 - -##### `mms_token` -MMS token for mms monitoring. Default: None - -##### `mms_name` -MMS identifier for mms monitoring. Default: None - -##### `mms_interval` -MMS interval for mms monitoring. Default: None - -##### `configsvr` -Use this setting to enable config server mode for mongod. - -##### `shardsvr` -Use this setting to enable shard server mode for mongod. - -##### `replset` -Use this setting to configure replication with replica sets. Specify a replica -set name as an argument to this set. All hosts must have the same set name. - -##### `replset_members` -An array of member hosts for the replica set. -Mutually exclusive with `replset_config` param. - -##### `replset_config` -A hash that is used to configure the replica set. -Mutually exclusive with `replset_members` param. - -```puppet -class mongodb::server { - replset => 'rsmain', - replset_config => { 'rsmain' => { ensure => present, settings => { heartbeatTimeoutSecs => 15, getLastErrorModes => { ttmode => { dc => 1 } } }, members => [{'host'=>'host1:27017', 'tags':{ 'dc' : 'east'}}, { 'host' => 'host2:27017'}, 'host3:27017'] } } - -} -``` - -##### `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 - -##### `quiet` -Runs the mongod or mongos instance in a quiet mode that attempts to limit the -amount of output. This option suppresses : "output from database commands, including drop, dropIndexes, diagLogging, validate, and clean", "replication activity", "connection accepted events" and "connection closed events". -Default: false - -> For production systems this option is **not** recommended as it may make tracking -problems during particular connections much more difficult. - -##### `slowms` -Sets the threshold for mongod to consider a query “slow” for the database profiler. -Default: 100 ms - -##### `keyfile` -Specify the path to a key file to store authentication information. This option -is only useful for the connection between replica set members. Default: None - -##### `key` -Specify the key contained within the keyfile. This option -is only useful for the connection between replica set members. Default: None - -##### `master` -Set to true to configure the current instance to act as master instance in a -replication configuration. Default: False *Note*: deprecated – use replica sets - -##### `set_parameter` -Specify extra configuration file parameters (i.e. -textSearchEnabled=true). Default: None - -##### `syslog` -Sends all logging output to the host’s syslog system rather than to standard -output or a log file. Default: None -*Important*: You cannot use syslog with logpath. Set logpath to false to disable it. - -##### `slave` -Set to true to configure the current instance to act as slave instance in a -replication configuration. Default: false -*Note*: deprecated – use replica sets - -##### `only` -Used with the slave option, only specifies only a single database to -replicate. Default: <> -*Note*: deprecated – use replica sets - -##### `source` -Used with the slave setting to specify the master instance from which -this slave instance will replicate. Default: <> -*Note*: deprecated – use replica sets - -##### `ssl` -Set to true to enable ssl. Default: <> -*Important*: You need to have ssl_key set as well, and the file needs to -pre-exist on node. If you wish to use certificate validation, ssl_ca must also -be set. - -##### `ssl_key` -Default: <> - -##### `ssl_ca` -Default: <> - -##### `ssl_weak_cert` -Set to true to disable mandatory SSL client authentication -Default: False - -##### `ssl_invalid_hostnames` -Set to true to disable fqdn SSL cert check -Default: False - -##### `ssl_mode` -Ssl authorization mode. Valid options are: requireSSL, preferSSL, allowSSL. -Default: requireSSL - -##### `tls` -Set to true to enable tls. Default: <> -*Important*: You need to have tls_key set as well, and the file needs to -pre-exist on node. If you wish to use certificate validation, tls_ca must also -be set. - -##### `tls_key` -Default: <> - -##### `tls_ca` -Default: <> - -##### `tls_conn_without_cert` -Set to true to disable mandatory TLS client authentication -Default: False - -##### `tls_invalid_hostnames` -Set to true to disable fqdn TLS cert check -Default: False - -##### `tls_mode` -Tls authorization mode. Valid options are: requireTLS, preferTLS, allowTLS. -Default: requireTLS - -##### `service_manage` -Whether or not the MongoDB service resource should be part of the catalog. -Default: true - -##### `storage_engine` -Only needed for MongoDB 3.x versions, where it's possible to select the -'wiredTiger' engine in addition to the default 'mmapv1' engine. If not set, the -config is left out and mongo will default to 'mmapv1'. -You should not set this for MongoDB versions < 3.x - -##### `restart` -Specifies whether the service should be restarted on config changes. Default: 'true' - -##### `create_admin` -Allows to create admin user for admin database. -Redefine these parameters if needed: - -##### `admin_username` -Administrator user name - -##### `admin_password` -Administrator user password - -##### `admin_auth_mechanism` -Administrator authentication mechanism. -scram_sha_256 password synchronization verification is not supported. -Default: 'scram_sha_1' - -##### `admin_update_password` -Update password. -Used with SCRAM-SHA-256 because password verification is not supported. -Default: false - -##### `admin_roles` -Administrator user roles - -##### `store_creds` -Store admin credentials in mongorc.js file. Uses with `create_admin` parameter - -##### `handle_creds` -Set this to false to avoid having puppet handle .mongorc.js in case you wish to deliver it by other means. -This is needed for facts to work if you have auth set to true. Default is true. - - -#### Class: mongodb::mongos -class. This class should only be used if you want to implement sharding within -your mongodb deployment. - -This class allows you to configure the mongos daemon (responsible for routing) -on your platform. - -##### `ensure` -Used to ensure that the package is installed and the service is running, or that the package is absent/purged and the service is stopped. Valid values are true/false/present/absent/purged. - -##### `config` -Path of the config file. If not specified, the module will use the default -for your OS distro. - -##### `config_content` -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. - -##### `service_manage` -Whether or not the MongoDB sharding service resource should be part of the catalog. -Default: true - -##### `service_name` -This setting can be used to override the default Mongos service name. If not -specified, the module will use whatever service name is the default for your OS distro. - -##### `service_provider` -This setting can be used to override the default Mongos service provider. If -not specified, the module will use whatever service provider is the default for -your OS distro. - -##### `service_status` -This setting can be used to override the default status check command for -your Mongos service. If not specified, the module will use whatever service -name is the default for your OS distro. - -##### `service_enable` -This setting can be used to specify if the service should be enable at boot - -##### `service_ensure` -This setting can be used to specify if the service should be running - -##### `package_ensure` -This setting can be used to specify if puppet should install the package or not - -##### `package_name` -This setting can be used to specify the name of the package that should be installed. -If not specified, the module will use whatever service name is the default for your OS distro. - -##### `restart` -Specifies whether the service should be restarted on config changes. Default: 'true' - -### Definitions - -#### Definition: mongodb:db - -Creates database with user. Resource title used as database name. - -##### `user` -Name of the user for database - -##### `password_hash` -Hex encoded md5 hash of "$username:mongo:$password". -For more information please refer to [MongoDB Authentication Process](http://docs.mongodb.org/meta-driver/latest/legacy/implement-authentication-in-driver/#authentication-process). - -##### `password` -Plain-text user password (will be hashed) - -##### `auth_mechanism` -Authentication mechanism. -Can be either 'scram_sha_1' or 'scram_sha_256'. -scram_sha_256 password synchronization verification is not supported. -Default: 'scram_sha_1' - -##### `update_password` -Update password. -Used with SCRAM-SHA-256 because password verification is not supported. -Default: false - -##### `roles` -Array with user roles as string. -Roles will be granted to user's database if no alternative database is explicitly defined. -Example: ['dbAdmin', 'readWrite@other_database'] -Default: ['dbAdmin'] - -### Providers - -#### Provider: mongodb_database -'mongodb_database' can be used to create and manage databases within MongoDB. - -```puppet -mongodb_database { testdb: - ensure => present, - tries => 10, - require => Class['mongodb::server'], -} -``` -##### `tries` -The maximum amount of two second tries to wait MongoDB startup. Default: 10 - - -#### Provider: mongodb_user -'mongodb_user' can be used to create and manage users within MongoDB database. - -*Note:* if replica set is enabled, replica initialization has to come before -any user operations. - -```puppet -mongodb_user { testuser: - name => 'testuser', - ensure => present, - password_hash => mongodb_password('testuser', 'p@ssw0rd'), - database => testdb, - roles => ['readWrite', 'dbAdmin'], - tries => 10, - require => Class['mongodb::server'], -} -``` -##### `username` -Name of the mongodb user. - -##### `password_hash` -Hex encoded md5 hash of "$username:mongo:$password". Only available on MongoDB 3.0 and later. - -##### `password` -Plaintext password of the user. - -##### `database` -Name of database. It will be created, if not exists. - -##### `roles` -Array with user roles as string. -Roles will be granted to user's database if no alternative database is explicitly defined. -Example: ['dbAdmin', 'readWrite@other_database'] -Default: ['dbAdmin'] - -##### `tries` -The maximum amount of two second tries to wait MongoDB startup. Default: 10 - -#### Provider: mongodb_replset -'mongodb_replset' can be used to create and manage MongoDB replicasets. - -```puppet -mongodb_replset { rsmain: - ensure => present, - members => ['host1:27017', 'host2:27017', 'host3:27017'] -} -``` - -Ideally the ```mongodb_replset``` resource will be declared on the initial -desired primary node (arbitrarily the first of the list) and this node will be -processed once the secondary nodes are up. This will ensure all the nodes are -in the first configuration of the replicaset, else it will require running -puppet again to add them. - -##### `members` -Array of 'host:port' of the replicaset members. - -It currently only adds members without options. - -#### Provider: mongodb_shard -'mongodb_shard' can be used to create and manage MongoDB shards. -*Note:* Removing a shard is not yet supported. Shard can only be added. - -```puppet -mongodb_shard { 'rsmain': - member => 'rsmain/host1:27017', - keys => [{'rsmain.foo' => {'name' => 1}}], -} -``` -##### `member` -Member of the shard in the form; - -* [hostname] -* [hostname]:[port] -* [replica-set-name]/[hostname] -* [replica-set-name]/[hostname]:port - -##### `keys` -Sharding keys for a specific database. This variable should be an array -of sharding keys. - ## Limitations This module has been tested on: diff --git a/REFERENCE.md b/REFERENCE.md index 66ef6e4f7..1169a603d 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -8,19 +8,19 @@ #### Public Classes -* [`mongodb::client`](#mongodb--client): Class for installing a MongoDB client shell (CLI). -* [`mongodb::globals`](#mongodb--globals): Class for setting cross-class global overrides. See README.md for more details. -* [`mongodb::mongos`](#mongodb--mongos): This installs a Mongo Shard daemon. See README.md for more details. -* [`mongodb::opsmanager`](#mongodb--opsmanager): This installs Ops Manager +* [`mongodb::client`](#mongodb--client) +* [`mongodb::globals`](#mongodb--globals): Class for setting cross-class global overrides. +* [`mongodb::mongos`](#mongodb--mongos): This installs a Mongo Shard daemon. +* [`mongodb::opsmanager`](#mongodb--opsmanager) * [`mongodb::replset`](#mongodb--replset): Wrapper class useful for hiera based deployments -* [`mongodb::server`](#mongodb--server): This installs a MongoDB server. See README.md for more details. +* [`mongodb::server`](#mongodb--server): This installs a MongoDB server. * [`mongodb::shardsvr`](#mongodb--shardsvr): Wrapper class useful for hiera based deployments #### Private Classes * `mongodb::client::params`: mongodb client params * `mongodb::mongos::config`: Manages mongos config -* `mongodb::mongos::install`: Manages the mongos package +* `mongodb::mongos::install`: Installs mongos * `mongodb::mongos::params`: mongos params * `mongodb::mongos::service`: Manages the mongos service * `mongodb::params`: mongodb params @@ -52,7 +52,7 @@ ### `mongodb::client` -Class for installing a MongoDB client shell (CLI). +The mongodb::client class. #### Parameters @@ -65,7 +65,7 @@ The following parameters are available in the `mongodb::client` class: Data type: `String[1]` -Desired ensure state of the package. +Used to ensure that the package is installed, or that the package is absent/purged Default value: `$mongodb::client::params::package_ensure` @@ -73,13 +73,53 @@ Default value: `$mongodb::client::params::package_ensure` Data type: `String[1]` -Name of the package to install the client from. Default is repository dependent. +This setting can be used to specify the name of the package that should be installed. +If not specified, the module will use whatever service name is the default for your OS distro. Default value: `$mongodb::client::params::package_name` ### `mongodb::globals` -Class for setting cross-class global overrides. See README.md for more details. +Class for setting cross-class global overrides. + +#### Examples + +##### Use a specific MongoDB version to install from the community repository. + +```puppet + +class {'mongodb::globals': + manage_package_repo => true, + repo_version => '4.4', +} +-> class {'mongodb::client': } +-> class {'mongodb::server': } +``` + +##### Use a specific MongoDB version to install from the enterprise repository. + +```puppet + +class {'mongodb::globals': + manage_package_repo => true, + repo_version => '4.4', + use_enterprise_repo => true, +} +-> class {'mongodb::client': } +-> class {'mongodb::server': } +``` + +##### To disable managing of repository, but still enable managing packages. + +```puppet + +class {'mongodb::globals': + manage_package_repo => false, + manage_package => true, +} +-> class {'mongodb::server': } +-> class {'mongodb::client': } +``` #### Parameters @@ -114,7 +154,8 @@ The following parameters are available in the `mongodb::globals` class: Data type: `Any` - +This setting can be used to override the default MongoDB server package name. +If not specified, the module will use whatever package name is the default for your OS distro. Default value: `undef` @@ -122,7 +163,8 @@ Default value: `undef` Data type: `Any` - +This setting can be used to specify the name of the client package that should be installed. +If not specified, the module will use whatever service name is the default for your OS distro. Default value: `undef` @@ -130,7 +172,8 @@ Default value: `undef` Data type: `Any` - +This setting can be used to override the default management of the mongod service. +By default the module will manage the mongod process. Default value: `undef` @@ -138,7 +181,7 @@ Default value: `undef` Data type: `Any` - +This setting can be used to specify if the service should be enable at boot Default value: `undef` @@ -146,7 +189,7 @@ Default value: `undef` Data type: `Any` - +This setting can be used to specify if the service should be running Default value: `undef` @@ -154,7 +197,8 @@ Default value: `undef` Data type: `Any` - +This setting can be used to override the default MongoDB service name. +If not specified, the module will use whatever service name is the default for your OS distro. Default value: `undef` @@ -162,7 +206,8 @@ Default value: `undef` Data type: `Any` - +This setting can be used to override the default MongoDB service provider. +If not specified, the module will use whatever service provider is the default for your OS distro. Default value: `undef` @@ -170,7 +215,8 @@ Default value: `undef` Data type: `Any` - +This setting can be used to override the default status check command for your MongoDB service. + If not specified, the module will use whatever service name is the default for your OS distro. Default value: `undef` @@ -178,7 +224,8 @@ Default value: `undef` Data type: `Any` - +This setting can be used to override the default MongoDB user and owner of the service and related files in the file system. +If not specified, the module will use the default for your OS distro. Default value: `undef` @@ -186,7 +233,8 @@ Default value: `undef` Data type: `Any` - +This setting can be used to override the default MongoDB user group to be used for related files in the file system. +If not specified, the module will use the default for your OS distro. Default value: `undef` @@ -194,7 +242,8 @@ Default value: `undef` Data type: `Any` - +This setting is used to configure MongoDB to turn on ipv6 support. +If not specified and ipv6 address is passed to MongoDB bind_ip it will just fail. Default value: `undef` @@ -202,7 +251,9 @@ Default value: `undef` Data type: `Any` - +This setting can be used to configure MonogDB 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. +Note: This value should be passed as an array. Default value: `undef` @@ -210,7 +261,8 @@ Default value: `undef` Data type: `Optional[String[1]]` -Version of mongodb to install +The version of MonogDB to install/manage. This is needed when managing repositories. +If not specified, the module will use the default for your OS distro. Default value: `undef` @@ -218,7 +270,7 @@ Default value: `undef` Data type: `String[1]` -Version of mongodb repo to install +The version of the package repo. Default value: `'5.0'` @@ -226,7 +278,7 @@ Default value: `'5.0'` Data type: `Boolean` -If `true` configure upstream mongodb repos +Whether to use the MongoDB software repository or the OS packages (True) or a Custom repo (False) Default value: `true` @@ -234,7 +286,7 @@ Default value: `true` Data type: `Any` - +wgether this module willm manage the mongoDB server package Default value: `undef` @@ -242,7 +294,8 @@ Default value: `undef` Data type: `Any` - +This will allow you to set a proxy for your repository in case you are behind a corporate firewall. +Currently this is only supported with yum repositories Default value: `undef` @@ -250,7 +303,7 @@ Default value: `undef` Data type: `Any` - +This sets the username for the proxyserver, should authentication be required. Default value: `undef` @@ -258,7 +311,7 @@ Default value: `undef` Data type: `Any` - +This sets the password for the proxyserver, should authentication be required Default value: `undef` @@ -266,7 +319,8 @@ Default value: `undef` Data type: `Any` - +This setting can be used to override the default MongoDB repository location. +If not specified, the module will use the default repository for your OS distro. Default value: `undef` @@ -274,7 +328,8 @@ Default value: `undef` Data type: `Any` - +When manage_package_repo is set to true, this setting indicates if it will use the Community Edition +(false, the default) or the Enterprise one (true). Default value: `undef` @@ -282,7 +337,8 @@ Default value: `undef` Data type: `Any` - +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. Default value: `undef` @@ -290,7 +346,7 @@ Default value: `undef` Data type: `Any` - +The file mode of the pid file Default value: `undef` @@ -298,13 +354,25 @@ Default value: `undef` Data type: `Any` - +If true, the pidfile will be managed by puppet Default value: `undef` ### `mongodb::mongos` -This installs a Mongo Shard daemon. See README.md for more details. +This class should only be used if you want to implement sharding within your mongodb deployment. + This class allows you to configure the mongos daemon (responsible for routing) on your platform. + + } + +#### Examples + +##### mongos can be installed the following way. + +```puppet +class {'mongodb::mongos' : + configdb => ['configsvr1.example.com:27018'], +``` #### Parameters @@ -338,7 +406,7 @@ The following parameters are available in the `mongodb::mongos` class: Data type: `Stdlib::Absolutepath` - +Path of the config file. If not specified, the module will use the default for your OS distro. Default value: `$mongodb::mongos::params::config` @@ -346,7 +414,7 @@ Default value: `$mongodb::mongos::params::config` Data type: `Optional[String[1]]` - +Config content if the default doesn't match one needs. Default value: `$mongodb::mongos::params::config_content` @@ -354,7 +422,7 @@ Default value: `$mongodb::mongos::params::config_content` Data type: `Optional[String[1]]` - +Path to the config template if the default doesn't match one needs. Default value: `$mongodb::mongos::params::config_template` @@ -362,7 +430,7 @@ Default value: `$mongodb::mongos::params::config_template` Data type: `Variant[String[1], Array[String[1]]]` - +Array of the config servers IP addresses the mongos should connect to. Default value: `$mongodb::mongos::params::configdb` @@ -370,7 +438,7 @@ Default value: `$mongodb::mongos::params::configdb` Data type: `Optional[Hash]` - +Hash containing key-value pairs to allow for additional configuration options to be set in user-provided template. Default value: `$mongodb::mongos::params::config_data` @@ -378,7 +446,7 @@ Default value: `$mongodb::mongos::params::config_data` Data type: `Boolean` - +Whether or not the MongoDB sharding service resource should be part of the catalog. Default value: `$mongodb::mongos::params::service_manage` @@ -386,7 +454,8 @@ Default value: `$mongodb::mongos::params::service_manage` Data type: `Optional[String]` - +This setting can be used to override the default Mongos service provider. +If not specified, the module will use whatever service provider is the default for your OS distro. Default value: `$mongodb::mongos::params::service_provider` @@ -394,7 +463,8 @@ Default value: `$mongodb::mongos::params::service_provider` Data type: `Optional[String]` - +This setting can be used to override the default Mongos service name. +If not specified, the module will use whatever service name is the default for your OS distro. Default value: `$mongodb::mongos::params::service_name` @@ -402,7 +472,7 @@ Default value: `$mongodb::mongos::params::service_name` Data type: `String` - +The user used by Systemd for running the service. Default value: `'mongodb'` @@ -410,7 +480,7 @@ Default value: `'mongodb'` Data type: `String` - +The group used by Systemd for running the service Default value: `'mongodb'` @@ -418,7 +488,7 @@ Default value: `'mongodb'` Data type: `Optional[String[1]]` - +Path to the service template if the default doesn't match one needs. Default value: `$mongodb::mongos::params::service_template` @@ -426,7 +496,7 @@ Default value: `$mongodb::mongos::params::service_template` Data type: `Boolean` - +This setting can be used to specify if the service should be enable at boot Default value: `$mongodb::mongos::params::service_enable` @@ -434,7 +504,7 @@ Default value: `$mongodb::mongos::params::service_enable` Data type: `Stdlib::Ensure::Service` - +This setting can be used to specify if the service should be running Default value: `$mongodb::mongos::params::service_ensure` @@ -442,7 +512,8 @@ Default value: `$mongodb::mongos::params::service_ensure` Data type: `Optional[String]` - +This setting can be used to override the default status check command for your Mongos service. +If not specified, the module will use whatever service name is the default for your OS distro. Default value: `$mongodb::mongos::params::service_status` @@ -450,7 +521,7 @@ Default value: `$mongodb::mongos::params::service_status` Data type: `Variant[Boolean, String]` - +This setting can be used to specify if puppet should install the package or not Default value: `$mongodb::mongos::params::package_ensure` @@ -458,7 +529,8 @@ Default value: `$mongodb::mongos::params::package_ensure` Data type: `String` - +This setting can be used to specify the name of the package that should be installed. +If not specified, the module will use whatever service name is the default for your OS distro. Default value: `$mongodb::mongos::params::package_name` @@ -466,7 +538,7 @@ Default value: `$mongodb::mongos::params::package_name` Data type: `Optional[Stdlib::Absolutepath]` - +The path for the UNIX socket. If this option has no value, the mongos process creates a socket with /tmp as a prefix. Default value: `$mongodb::mongos::params::unixsocketprefix` @@ -474,7 +546,8 @@ Default value: `$mongodb::mongos::params::unixsocketprefix` Data type: `Optional[Stdlib::Absolutepath]` - +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. Default value: `$mongodb::mongos::params::pidfilepath` @@ -482,7 +555,8 @@ Default value: `$mongodb::mongos::params::pidfilepath` Data type: `Optional[Variant[Boolean, Stdlib::Absolutepath]]` - +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. Default value: `$mongodb::mongos::params::logpath` @@ -490,7 +564,7 @@ Default value: `$mongodb::mongos::params::logpath` Data type: `Optional[Boolean]` - +Set to true to fork server process at launch time. The default setting depends on the operating system. Default value: `$mongodb::mongos::params::fork` @@ -498,7 +572,8 @@ Default value: `$mongodb::mongos::params::fork` Data type: `Optional[Array[Stdlib::IP::Address]]` - +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. Default value: `$mongodb::mongos::params::bind_ip` @@ -506,7 +581,7 @@ Default value: `$mongodb::mongos::params::bind_ip` Data type: `Optional[Stdlib::Port]` - +Specifies a TCP port for the server instance to listen for client connections. Default value: `$mongodb::mongos::params::port` @@ -514,18 +589,26 @@ Default value: `$mongodb::mongos::params::port` Data type: `Boolean` - +Specifies whether the service should be restarted on config changes. Default value: `$mongodb::mongos::params::restart` ### `mongodb::opsmanager` -This installs Ops Manager +The mongodb::opsmanager class. #### Parameters The following parameters are available in the `mongodb::opsmanager` class: +* [`pem_key_password`](#-mongodb--opsmanager--pem_key_password) +* [`user_svc_class`](#-mongodb--opsmanager--user_svc_class) +* [`snapshot_interval`](#-mongodb--opsmanager--snapshot_interval) +* [`snapshot_interval_retention`](#-mongodb--opsmanager--snapshot_interval_retention) +* [`snapshot_daily_retention`](#-mongodb--opsmanager--snapshot_daily_retention) +* [`snapshot_weekly_retention`](#-mongodb--opsmanager--snapshot_weekly_retention) +* [`snapshot_monthly_retention`](#-mongodb--opsmanager--snapshot_monthly_retention) +* [`versions_directory`](#-mongodb--opsmanager--versions_directory) * [`user`](#-mongodb--opsmanager--user) * [`group`](#-mongodb--opsmanager--group) * [`ensure`](#-mongodb--opsmanager--ensure) @@ -549,20 +632,79 @@ The following parameters are available in the `mongodb::opsmanager` class: * [`ignore_ui_setup`](#-mongodb--opsmanager--ignore_ui_setup) * [`ca_file`](#-mongodb--opsmanager--ca_file) * [`pem_key_file`](#-mongodb--opsmanager--pem_key_file) -* [`pem_key_password`](#-mongodb--opsmanager--pem_key_password) -* [`user_svc_class`](#-mongodb--opsmanager--user_svc_class) -* [`snapshot_interval`](#-mongodb--opsmanager--snapshot_interval) -* [`snapshot_interval_retention`](#-mongodb--opsmanager--snapshot_interval_retention) -* [`snapshot_daily_retention`](#-mongodb--opsmanager--snapshot_daily_retention) -* [`snapshot_weekly_retention`](#-mongodb--opsmanager--snapshot_weekly_retention) -* [`snapshot_monthly_retention`](#-mongodb--opsmanager--snapshot_monthly_retention) -* [`versions_directory`](#-mongodb--opsmanager--versions_directory) + +##### `pem_key_password` + +Data type: `Optional[String[1]]` + +The password to the pem key file. + +Default value: `undef` + +##### `user_svc_class` + +Data type: `Optional[String[1]]` + +The user svc class +Default: com.xgen.svc.mms.svc.user.UserSvcDb +External Source: com.xgen.svc.mms.svc.user.UserSvcCrowd +Internal Database: com.xgen.svc.mms.svc.user.UserSvcDb + +Default value: `undef` + +##### `snapshot_interval` + +Data type: `Optional[Integer]` + +The snapshot interval to use + +Default value: `undef` + +##### `snapshot_interval_retention` + +Data type: `Optional[Integer]` + +The snapshot interval retention period + +Default value: `undef` + +##### `snapshot_daily_retention` + +Data type: `Optional[Integer]` + +The dayly snapshot interval retention period + +Default value: `undef` + +##### `snapshot_weekly_retention` + +Data type: `Optional[Integer]` + +The weekly snapshot interval retention period + +Default value: `undef` + +##### `snapshot_monthly_retention` + +Data type: `Optional[Integer]` + +The monthly snapshot interval retention period + +Default value: `undef` + +##### `versions_directory` + +Data type: `Optional[Integer]` + +The directory where to store the snapshot versions + +Default value: `undef` ##### `user` Data type: `String[1]` -The user that owns the config file + Default value: `'mongodb-mms'` @@ -570,7 +712,7 @@ Default value: `'mongodb-mms'` Data type: `String[1]` -The group that owns the config file + Default value: `'mongodb-mms'` @@ -642,7 +784,7 @@ Default value: `'mongodb://127.0.0.1:27017'` Data type: `Stdlib::Httpurl` -The fully qualified url where opsmanager runs. Must include the port. + Default value: `"http://${facts['networking']['fqdn']}:8080"` @@ -730,27 +872,11 @@ Default value: `true` Data type: `Optional[String[1]]` -Ca file for secure connection to backup agents. - -Default value: `undef` - -##### `pem_key_file` - -Data type: `Optional[String[1]]` - -Pem key file containing the cert and private key used for secure connections to backup agents. -Default value: `undef` - -##### `pem_key_password` - -Data type: `Optional[String[1]]` - -The password to the pem key file. Default value: `undef` -##### `user_svc_class` +##### `pem_key_file` Data type: `Optional[String[1]]` @@ -758,57 +884,24 @@ Data type: `Optional[String[1]]` Default value: `undef` -##### `snapshot_interval` - -Data type: `Optional[Integer]` - - - -Default value: `undef` - -##### `snapshot_interval_retention` - -Data type: `Optional[Integer]` - - - -Default value: `undef` - -##### `snapshot_daily_retention` - -Data type: `Optional[Integer]` - - - -Default value: `undef` - -##### `snapshot_weekly_retention` - -Data type: `Optional[Integer]` - - - -Default value: `undef` - -##### `snapshot_monthly_retention` - -Data type: `Optional[Integer]` - - - -Default value: `undef` - -##### `versions_directory` - -Data type: `Optional[Integer]` +### `mongodb::replset` +Wrapper class useful for hiera based deployments +#### Examples -Default value: `undef` +##### hieradata -### `mongodb::replset` +```puppet -Wrapper class useful for hiera based deployments +mongodb::replset::sets: + replicaset01: + ensure: present + members: + - member01.example.com:27017 + - member02.example.com:27017 + - member03.example.com:27017 +``` #### Parameters @@ -820,41 +913,39 @@ The following parameters are available in the `mongodb::replset` class: Data type: `Any` - +Hash of attributes as described in the mongodb_replset custom type Default value: `undef` ### `mongodb::server` -This installs a MongoDB server. See README.md for more details. +Most of the parameters manipulate the mongod.conf file. + + For more details about configuration parameters consult the MongoDB Configuration File Options. + +This setting can be used to specify if the service should be running. #### Parameters The following parameters are available in the `mongodb::server` class: -* [`tls`](#-mongodb--server--tls) -* [`tls_key`](#-mongodb--server--tls_key) -* [`tls_ca`](#-mongodb--server--tls_ca) -* [`tls_conn_without_cert`](#-mongodb--server--tls_conn_without_cert) -* [`tls_invalid_hostnames`](#-mongodb--server--tls_invalid_hostnames) -* [`tls_mode`](#-mongodb--server--tls_mode) -* [`admin_password_hash`](#-mongodb--server--admin_password_hash) * [`ensure`](#-mongodb--server--ensure) * [`user`](#-mongodb--server--user) * [`group`](#-mongodb--server--group) * [`config`](#-mongodb--server--config) * [`dbpath`](#-mongodb--server--dbpath) * [`dbpath_fix`](#-mongodb--server--dbpath_fix) -* [`pidfilepath`](#-mongodb--server--pidfilepath) * [`pidfilemode`](#-mongodb--server--pidfilemode) +* [`pidfilepath`](#-mongodb--server--pidfilepath) * [`manage_pidfile`](#-mongodb--server--manage_pidfile) * [`rcfile`](#-mongodb--server--rcfile) * [`service_manage`](#-mongodb--server--service_manage) -* [`service_provider`](#-mongodb--server--service_provider) +* [`service_manage`](#-mongodb--server--service_manage) * [`service_name`](#-mongodb--server--service_name) +* [`service_provider`](#-mongodb--server--service_provider) +* [`service_status`](#-mongodb--server--service_status) * [`service_enable`](#-mongodb--server--service_enable) * [`service_ensure`](#-mongodb--server--service_ensure) -* [`service_status`](#-mongodb--server--service_status) * [`package_ensure`](#-mongodb--server--package_ensure) * [`package_name`](#-mongodb--server--package_name) * [`logpath`](#-mongodb--server--logpath) @@ -910,6 +1001,13 @@ The following parameters are available in the `mongodb::server` class: * [`ssl_weak_cert`](#-mongodb--server--ssl_weak_cert) * [`ssl_invalid_hostnames`](#-mongodb--server--ssl_invalid_hostnames) * [`ssl_mode`](#-mongodb--server--ssl_mode) +* [`tls`](#-mongodb--server--tls) +* [`tls_key`](#-mongodb--server--tls_key) +* [`tls_ca`](#-mongodb--server--tls_ca) +* [`tls_conn_without_cert`](#-mongodb--server--tls_conn_without_cert) +* [`tls_invalid_hostnames`](#-mongodb--server--tls_invalid_hostnames) +* [`tls_mode`](#-mongodb--server--tls_mode) +* [`admin_password_hash`](#-mongodb--server--admin_password_hash) * [`restart`](#-mongodb--server--restart) * [`storage_engine`](#-mongodb--server--storage_engine) * [`create_admin`](#-mongodb--server--create_admin) @@ -917,71 +1015,16 @@ The following parameters are available in the `mongodb::server` class: * [`admin_password`](#-mongodb--server--admin_password) * [`admin_auth_mechanism`](#-mongodb--server--admin_auth_mechanism) * [`admin_update_password`](#-mongodb--server--admin_update_password) +* [`admin_roles`](#-mongodb--server--admin_roles) * [`handle_creds`](#-mongodb--server--handle_creds) * [`store_creds`](#-mongodb--server--store_creds) -* [`admin_roles`](#-mongodb--server--admin_roles) - -##### `tls` - -Data type: `Boolean` - -Ensure tls is enabled. - -Default value: `false` - -##### `tls_key` - -Data type: `Optional[Stdlib::Absolutepath]` - -Defines the path of the file that contains the TLS/SSL certificate and key. - -Default value: `undef` - -##### `tls_ca` - -Data type: `Optional[Stdlib::Absolutepath]` - -Defines the path of the file that contains the certificate chain for verifying client certificates. - -Default value: `undef` - -##### `tls_conn_without_cert` - -Data type: `Boolean` - -Set to true to bypass client certificate validation for clients that do not present a certificate. - -Default value: `false` - -##### `tls_invalid_hostnames` - -Data type: `Boolean` - -Set to true to disable the validation of the hostnames in TLS certificates. - -Default value: `false` - -##### `tls_mode` - -Data type: `Enum['requireTLS', 'preferTLS', 'allowTLS']` - -Defines if TLS is used for all network connections. Allowed values are 'requireTLS', 'preferTLS' or 'allowTLS'. - -Default value: `'requireTLS'` - -##### `admin_password_hash` - -Data type: `Optional[Variant[String[1], Sensitive[String[1]]]]` - -Hashed password. Hex encoded md5 hash of mongodb password. - -Default value: `undef` ##### `ensure` Data type: `Variant[Boolean, String]` - +Used to ensure that the package is installed and the service is running, or that the package is +absent/purged and the service is stopped. Default value: `$mongodb::params::ensure` @@ -989,7 +1032,8 @@ Default value: `$mongodb::params::ensure` Data type: `String` - +This setting can be used to override the default MongoDB user and owner of the service and related files in the file system. +If not specified, the module will use the default for your OS distro. Default value: `$mongodb::params::user` @@ -997,7 +1041,8 @@ Default value: `$mongodb::params::user` Data type: `String` - +This setting can be used to override the default MongoDB user group to be used for related files in the file system. +If not specified, the module will use the default for your OS distro. Default value: `$mongodb::params::group` @@ -1005,7 +1050,7 @@ Default value: `$mongodb::params::group` Data type: `Stdlib::Absolutepath` - +Path of the config file. If not specified, the module will use the default for your OS distro. Default value: `$mongodb::params::config` @@ -1013,7 +1058,8 @@ Default value: `$mongodb::params::config` Data type: `Stdlib::Absolutepath` - +Set this value to designate a directory for the mongod instance to store it's data. +If not specified, the module will use the default for your OS distro. Default value: `$mongodb::params::dbpath` @@ -1021,31 +1067,34 @@ Default value: `$mongodb::params::dbpath` Data type: `Boolean` - +Set this value to true if you want puppet to recursively manage the permissions of the files in the dbpath +directory. If you are using the default dbpath, this should probably be false. Set this to true if you are +using a custom dbpath. Default value: `$mongodb::params::dbpath_fix` -##### `pidfilepath` - -Data type: `Optional[Stdlib::Absolutepath]` - +##### `pidfilemode` +Data type: `String` -Default value: `$mongodb::params::pidfilepath` +The file mode of the pidfilepath -##### `pidfilemode` +Default value: `$mongodb::params::pidfilemode` -Data type: `String` +##### `pidfilepath` +Data type: `Optional[Stdlib::Absolutepath]` +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. -Default value: `$mongodb::params::pidfilemode` +Default value: `$mongodb::params::pidfilepath` ##### `manage_pidfile` Data type: `Boolean` - +Should puppet create the pidfile. Mongod 6.2.10 will not start if pidfile exists Default value: `$mongodb::params::manage_pidfile` @@ -1053,7 +1102,7 @@ Default value: `$mongodb::params::manage_pidfile` Data type: `String` - +The path to the custom mongosh rc file. Default value: `$mongodb::params::rcfile` @@ -1061,31 +1110,48 @@ Default value: `$mongodb::params::rcfile` Data type: `Boolean` +Whether or not the MongoDB service resource should be part of the catalog. +Default value: `$mongodb::params::service_manage` + +##### `service_manage` + +Whether or not the MongoDB sharding service resource should be part of the catalog. Default value: `$mongodb::params::service_manage` -##### `service_provider` +##### `service_name` Data type: `Optional[String]` +This setting can be used to override the default Mongos service name. +If not specified, the module will use whatever service name is the default for your OS distro. +Default value: `$mongodb::params::service_name` -Default value: `$mongodb::params::service_provider` - -##### `service_name` +##### `service_provider` Data type: `Optional[String]` +This setting can be used to override the default Mongos service provider. +If not specified, the module will use whatever service provider is the default for your OS distro. +Default value: `$mongodb::params::service_provider` -Default value: `$mongodb::params::service_name` +##### `service_status` + +Data type: `Optional[Enum['stopped', 'running']]` + +This setting can be used to override the default status check command for your Mongos service. +If not specified, the module will use whatever service name is the default for your OS distro. + +Default value: `$mongodb::params::service_status` ##### `service_enable` Data type: `Boolean` - +This setting can be used to specify if the service should be enable at boot. Default value: `$mongodb::params::service_enable` @@ -1097,19 +1163,11 @@ Data type: `Enum['stopped', 'running']` Default value: `$mongodb::params::service_ensure` -##### `service_status` - -Data type: `Optional[Enum['stopped', 'running']]` - - - -Default value: `$mongodb::params::service_status` - ##### `package_ensure` Data type: `Variant[Boolean, String]` - +This setting can be used to specify if puppet should install the package or not. Default value: `$mongodb::params::package_ensure` @@ -1117,7 +1175,8 @@ Default value: `$mongodb::params::package_ensure` Data type: `String` - +This setting can be used to specify the name of the package that should be installed. +If not specified, the module will use whatever service name is the default for your OS distro. Default value: `$mongodb::params::server_package_name` @@ -1125,7 +1184,8 @@ Default value: `$mongodb::params::server_package_name` Data type: `Variant[Boolean, Stdlib::Absolutepath]` - +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. Default value: `$mongodb::params::logpath` @@ -1133,7 +1193,8 @@ Default value: `$mongodb::params::logpath` Data type: `Array[Stdlib::IP::Address]` - +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. Default value: `$mongodb::params::bind_ip` @@ -1141,7 +1202,8 @@ Default value: `$mongodb::params::bind_ip` Data type: `Optional[Boolean]` - +This setting has to be true to configure MongoDB to turn on ipv6 support. If not specified and ipv6 +address is passed to MongoDB bind_ip it will just fail. Default value: `undef` @@ -1149,7 +1211,8 @@ Default value: `undef` Data type: `Boolean` - +Set to true to add new entries to the end of the logfile rather than overwriting the content of the log +when the process restarts. Default value: `true` @@ -1157,7 +1220,8 @@ Default value: `true` Data type: `Optional[String]` - +Set to reopen for mongo to close a log file then reopen it so that logrotations handled outside of mongo +perform as expected. Default value: `undef` @@ -1165,7 +1229,7 @@ Default value: `undef` Data type: `Optional[Boolean]` - +Set to true to fork server process at launch time. The default setting depends on the operating system. Default value: `$mongodb::params::fork` @@ -1173,7 +1237,7 @@ Default value: `$mongodb::params::fork` Data type: `Optional[Integer[1, 65535]]` - +Specifies a TCP port for the server instance to listen for client connections. Default value: `undef` @@ -1181,7 +1245,7 @@ Default value: `undef` Data type: `Optional[Boolean]` - +Set to true to enable operation journaling to ensure write durability and data consistency. Default value: `$mongodb::params::journal` @@ -1189,7 +1253,8 @@ Default value: `$mongodb::params::journal` Data type: `Optional[Boolean]` - +Set nojournal = true to disable durability journaling. By default, mongod enables journaling in 64-bit versions after v2.0. +Note: You must use journal to enable journaling on 32-bit systems. Default value: `undef` @@ -1197,7 +1262,8 @@ Default value: `undef` Data type: `Optional[Boolean]` - +Set to true to modify MongoDB to use a smaller default data file size. Specifically, smallfiles reduces +the initial size for data files and limits them to 512 megabytes. Default value: `undef` @@ -1205,7 +1271,8 @@ Default value: `undef` Data type: `Optional[Boolean]` - +Set to true to force mongod to report every four seconds CPU utilization and the amount of time that the +processor waits for I/O operations to complete (i.e. I/O wait.) Default value: `undef` @@ -1213,7 +1280,8 @@ Default value: `undef` Data type: `Boolean` - +et to true to enable database authentication for users connecting from remote hosts. If no users exist, +the localhost interface will continue to have access to the database until you create the first user. Default value: `false` @@ -1221,7 +1289,7 @@ Default value: `false` Data type: `Optional[Boolean]` - +Disable authentication. Default value: `undef` @@ -1229,7 +1297,7 @@ Default value: `undef` Data type: `Optional[Boolean]` - +Increases the amount of internal reporting returned on standard output or in the log file generated by logpath. Default value: `undef` @@ -1237,7 +1305,7 @@ Default value: `undef` Data type: `Optional[String]` - +MongoDB has the following levels of verbosity: v, vv, vvv, vvvv and vvvvv. Default value: `undef` @@ -1245,7 +1313,8 @@ Default value: `undef` Data type: `Optional[Boolean]` - +Forces the mongod to validate all requests from clients upon receipt to ensure that clients never insert +invalid documents into the database. Default value: `undef` @@ -1253,7 +1322,8 @@ Default value: `undef` Data type: `Optional[Boolean]` - +Set to true to enable a maximum limit for the number of data files each database can have. The default +quota is 8 data files, when quota is true. Default value: `undef` @@ -1261,7 +1331,7 @@ Default value: `undef` Data type: `Optional[Integer]` - +Modify limit on the number of data files per database. This option requires the quota setting. Default value: `undef` @@ -1269,7 +1339,8 @@ Default value: `undef` Data type: `Optional[Integer[0, 7]]` - +Creates a very verbose diagnostic log for troubleshooting and recording various errors. For more +information please refer to MongoDB Configuration File Options. Default value: `undef` @@ -1277,7 +1348,7 @@ Default value: `undef` Data type: `Optional[Boolean]` - +Set to true to modify the storage pattern of the data directory to store each database’s files in a distinct folder. Default value: `undef` @@ -1285,7 +1356,8 @@ Default value: `undef` Data type: `Any` - +Modify this value to changes the level of database profiling, which inserts information about operation +performance into output of mongod or the log file if specified by logpath. Default value: `undef` @@ -1293,7 +1365,8 @@ Default value: `undef` Data type: `Optional[Integer]` - +Specifies a value to set the maximum number of simultaneous connections that MongoDB will accept. +Unless set, MongoDB will not limit its own connections. Default value: `undef` @@ -1301,7 +1374,9 @@ Default value: `undef` Data type: `Optional[Integer]` - +Specifies a maximum size in megabytes for the replication operation log (e.g. oplog.) mongod creates an +oplog based on the maximum amount of space available. For 64-bit systems, the oplog is typically 5% of +available disk space. Default value: `undef` @@ -1309,7 +1384,7 @@ Default value: `undef` Data type: `Any` - +Ignore query hints. Default value: `undef` @@ -1317,7 +1392,8 @@ Default value: `undef` Data type: `Optional[Boolean]` - +Set to true to disable the HTTP interface. This command will override the rest and disable the HTTP +interface if you specify both. Default value: `undef` @@ -1325,7 +1401,7 @@ Default value: `undef` Data type: `Optional[Boolean]` - +Set noscripting = true to disable the scripting engine. Default value: `undef` @@ -1333,7 +1409,7 @@ Default value: `undef` Data type: `Optional[Boolean]` - +Set notablescan = true to forbid operations that require a table scan. Default value: `undef` @@ -1341,7 +1417,8 @@ Default value: `undef` Data type: `Optional[Boolean]` - +Set noprealloc = true to disable the preallocation of data files. This will shorten the start up time in +some cases, but can cause significant performance penalties during normal operations. Default value: `undef` @@ -1349,7 +1426,7 @@ Default value: `undef` Data type: `Optional[Integer]` - +Use this setting to control the default size for all newly created namespace files (i.e .ns). Default value: `undef` @@ -1357,7 +1434,7 @@ Default value: `undef` Data type: `Any` - +MMS token for mms monitoring. Default value: `undef` @@ -1365,7 +1442,7 @@ Default value: `undef` Data type: `Any` - +MMS identifier for mms monitoring. Default value: `undef` @@ -1373,7 +1450,7 @@ Default value: `undef` Data type: `Any` - +MMS interval for mms monitoring. Default value: `undef` @@ -1381,7 +1458,8 @@ Default value: `undef` Data type: `Optional[String]` - +Use this setting to configure replication with replica sets. Specify a replica set name as an argument to +this set. All hosts must have the same set name. Default value: `undef` @@ -1389,7 +1467,14 @@ Default value: `undef` Data type: `Optional[Hash]` - +A hash that is used to configure the replica set. Mutually exclusive with replset_members param. +class mongodb::server { + replset => 'rsmain', + replset_config => { 'rsmain' => { + ensure => present, + settings => { heartbeatTimeoutSecs => 15, getLastErrorModes => { ttmode => { dc => 1 } } }, + members => [{'host' => 'host1:27017', 'tags':{ 'dc' : 'east'}}, { 'host' => 'host2:27017'}, 'host3:27017'] }}, +} Default value: `undef` @@ -1397,7 +1482,7 @@ Default value: `undef` Data type: `Optional[Array]` - +An array of member hosts for the replica set. Mutually exclusive with replset_config param. Default value: `undef` @@ -1405,7 +1490,7 @@ Default value: `undef` Data type: `Optional[Boolean]` - +Use this setting to enable config server mode for mongod. Default value: `undef` @@ -1413,7 +1498,7 @@ Default value: `undef` Data type: `Optional[Boolean]` - +Use this setting to enable shard server mode for mongod. Default value: `undef` @@ -1421,7 +1506,7 @@ Default value: `undef` Data type: `Optional[Boolean]` - +Set to true to enable a simple REST interface. Default value: `undef` @@ -1429,7 +1514,12 @@ Default value: `undef` Data type: `Optional[Boolean]` +Runs the mongod or mongos instance in a quiet mode that attempts to limit the amount of output. +This option suppresses : "output from database commands, including drop, dropIndexes, diagLogging, +validate, and clean", "replication activity", "connection accepted events" and "connection closed events". +For production systems this option is not recommended as it may make tracking problems during particular +connections much more difficult. Default value: `undef` @@ -1437,7 +1527,7 @@ Default value: `undef` Data type: `Optional[Integer]` - +Sets the threshold for mongod to consider a query “slow” for the database profiler. Default value: `undef` @@ -1445,7 +1535,8 @@ Default value: `undef` Data type: `Optional[Stdlib::Absolutepath]` - +Specify the path to a key file to store authentication information. This option is only useful for the +connection between replica set members. Default value: `undef` @@ -1453,7 +1544,8 @@ Default value: `undef` Data type: `Optional[Variant[String[6], Sensitive[String[6]]]]` - +Specify the key contained within the keyfile. This option is only useful for the connection between +replica set members. Default value: `undef` @@ -1461,7 +1553,7 @@ Default value: `undef` Data type: `Optional[Variant[String[1], Array[String[1]]]]` - +Specify extra configuration file parameters (i.e. textSearchEnabled=true). Default value: `undef` @@ -1469,7 +1561,8 @@ Default value: `undef` Data type: `Optional[Boolean]` - +Sends all logging output to the host’s syslog system rather than to standard output or a log file. +Important: You cannot use syslog with logpath. Set logpath to false to disable it. Default value: `undef` @@ -1477,7 +1570,7 @@ Default value: `undef` Data type: `Any` - +Config content if the default doesn't match one needs. Default value: `undef` @@ -1485,7 +1578,7 @@ Default value: `undef` Data type: `Optional[String]` - +Path to the config template if the default doesn't match one needs. Default value: `undef` @@ -1493,7 +1586,7 @@ Default value: `undef` Data type: `Optional[Hash]` - +A hash to allow for additional configuration options to be set in user-provided template. Default value: `undef` @@ -1501,7 +1594,9 @@ Default value: `undef` Data type: `Optional[Boolean]` - +Use SSL validation. +Important: You need to have ssl_key set as well, and the file needs to pre-exist on node. If you wish to +use certificate validation, ssl_ca must also be set. Default value: `undef` @@ -1509,7 +1604,7 @@ Default value: `undef` Data type: `Optional[Stdlib::Absolutepath]` - +Defines the path of the file that contains the TLS/SSL certificate and key. Default value: `undef` @@ -1517,7 +1612,7 @@ Default value: `undef` Data type: `Optional[Stdlib::Absolutepath]` - +Defines the path of the file that contains the certificate chain for verifying client certificates. Default value: `undef` @@ -1525,7 +1620,7 @@ Default value: `undef` Data type: `Boolean` - +Set to true to disable mandatory SSL client authentication. Default value: `false` @@ -1533,7 +1628,7 @@ Default value: `false` Data type: `Boolean` - +Set to true to disable fqdn SSL cert check. Default value: `false` @@ -1541,15 +1636,71 @@ Default value: `false` Data type: `Enum['requireSSL', 'preferSSL', 'allowSSL']` - +Ssl authorization mode. Default value: `'requireSSL'` -##### `restart` +##### `tls` Data type: `Boolean` +Ensure tls is enabled. +Default value: `false` + +##### `tls_key` + +Data type: `Optional[Stdlib::Absolutepath]` + +Defines the path of the file that contains the TLS/SSL certificate and key. + +Default value: `undef` + +##### `tls_ca` + +Data type: `Optional[Stdlib::Absolutepath]` + +Defines the path of the file that contains the certificate chain for verifying client certificates. + +Default value: `undef` + +##### `tls_conn_without_cert` + +Data type: `Boolean` + +Set to true to bypass client certificate validation for clients that do not present a certificate. + +Default value: `false` + +##### `tls_invalid_hostnames` + +Data type: `Boolean` + +Set to true to disable the validation of the hostnames in TLS certificates. + +Default value: `false` + +##### `tls_mode` + +Data type: `Enum['requireTLS', 'preferTLS', 'allowTLS']` + +Defines if TLS is used for all network connections. Allowed values are 'requireTLS', 'preferTLS' or 'allowTLS'. + +Default value: `'requireTLS'` + +##### `admin_password_hash` + +Data type: `Optional[Variant[String[1], Sensitive[String[1]]]]` + +Hashed password. Hex encoded md5 hash of mongodb password. + +Default value: `undef` + +##### `restart` + +Data type: `Boolean` + +Specifies whether the service should be restarted on config changes. Default value: `$mongodb::params::restart` @@ -1557,7 +1708,8 @@ Default value: `$mongodb::params::restart` Data type: `Optional[String]` - +Only needed for MongoDB 3.x versions, where it's possible to select the 'wiredTiger' engine in addition to +the default 'mmapv1' engine. If not set, the config is left out and mongo will default to 'mmapv1'. Default value: `undef` @@ -1565,7 +1717,7 @@ Default value: `undef` Data type: `Boolean` - +Allows to create admin user for admin database. Default value: `$mongodb::params::create_admin` @@ -1573,7 +1725,7 @@ Default value: `$mongodb::params::create_admin` Data type: `String` - +Administrator user name Default value: `$mongodb::params::admin_username` @@ -1581,7 +1733,7 @@ Default value: `$mongodb::params::admin_username` Data type: `Optional[Variant[String, Sensitive[String]]]` - +Administrator user password Default value: `undef` @@ -1589,7 +1741,7 @@ Default value: `undef` Data type: `Enum['scram_sha_1', 'scram_sha_256']` - +Administrator authentication mechanism. scram_sha_256 password synchronization verification is not supported. Default value: `$mongodb::params::admin_auth_mechanism` @@ -1597,15 +1749,24 @@ Default value: `$mongodb::params::admin_auth_mechanism` Data type: `Boolean` - +Update password. Used with SCRAM-SHA-256 because password verification is not supported. Default value: `false` +##### `admin_roles` + +Data type: `Array` + +Administrator user roles + +Default value: `$mongodb::params::admin_roles` + ##### `handle_creds` Data type: `Boolean` - +Set this to false to avoid having puppet handle .mongoshrc.js in case you wish to deliver it by other +means. This is needed for facts and providers to work if you have auth set to true. Default value: `$mongodb::params::handle_creds` @@ -1613,21 +1774,28 @@ Default value: `$mongodb::params::handle_creds` Data type: `Boolean` - +Store admin credentials in mongoshrc.js file. Uses with create_admin parameter Default value: `$mongodb::params::store_creds` -##### `admin_roles` - -Data type: `Array` - +### `mongodb::shardsvr` +Wrapper class useful for hiera based deployments -Default value: `$mongodb::params::admin_roles` +#### Examples -### `mongodb::shardsvr` +##### hieradata -Wrapper class useful for hiera based deployments +```puppet +mongodb::shardsvr::shards: + shard01: + keys: + - {x: 1} + members: + - shardhost01.exmaple.com:30000 + - shardhost02.exmaple.com:30000 + - shardhost03.exmaple.com:30000 +``` #### Parameters @@ -1639,7 +1807,7 @@ The following parameters are available in the `mongodb::shardsvr` class: Data type: `Any` - +Hash of attributes as described in the mongodb_shardsvr custom type Default value: `undef` @@ -1742,7 +1910,7 @@ The following properties are available in the `mongodb_conn_validator` type. Valid values: `present`, `absent` -Ensurable property +Ensure to verify the connection to mongodb Default value: `present` @@ -1844,7 +2012,7 @@ The following properties are available in the `mongodb_replset` type. Valid values: `present` -Ensurable property +Ensure the replicaset is either present or absent Default value: `present` @@ -1898,7 +2066,7 @@ The following properties are available in the `mongodb_shard` type. Valid values: `present` -Ensurable property +Ensure the shard is either present or absent Default value: `present` diff --git a/lib/puppet/type/mongodb_conn_validator.rb b/lib/puppet/type/mongodb_conn_validator.rb index 672e58e25..1a8676197 100644 --- a/lib/puppet/type/mongodb_conn_validator.rb +++ b/lib/puppet/type/mongodb_conn_validator.rb @@ -8,7 +8,7 @@ purposes such as monitoring." ensurable do - desc 'Ensurable property' + desc 'Ensure to verify the connection to mongodb' defaultvalues defaultto :present end diff --git a/lib/puppet/type/mongodb_replset.rb b/lib/puppet/type/mongodb_replset.rb index 3fdcbe0c4..07dad5712 100644 --- a/lib/puppet/type/mongodb_replset.rb +++ b/lib/puppet/type/mongodb_replset.rb @@ -8,7 +8,7 @@ @doc = 'Manage a MongoDB replicaSet' ensurable do - desc 'Ensurable property' + desc 'Ensure the replicaset is either present or absent' defaultto :present newvalue(:present) do diff --git a/lib/puppet/type/mongodb_shard.rb b/lib/puppet/type/mongodb_shard.rb index e9ad7955a..b1c2ea18f 100644 --- a/lib/puppet/type/mongodb_shard.rb +++ b/lib/puppet/type/mongodb_shard.rb @@ -8,7 +8,7 @@ @doc = 'Manage a MongoDB Shard' ensurable do - desc 'Ensurable property' + desc 'Ensure the shard is either present or absent' defaultto :present newvalue(:present) do diff --git a/manifests/client.pp b/manifests/client.pp index 817584d97..29b7d0a16 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -1,9 +1,14 @@ # @summary Class for installing a MongoDB client shell (CLI). # +# @example Basic usage +# include mongodb::client + # @param ensure -# Desired ensure state of the package. +# Used to ensure that the package is installed, or that the package is absent/purged +# # @param package_name -# Name of the package to install the client from. Default is repository dependent. +# This setting can be used to specify the name of the package that should be installed. +# If not specified, the module will use whatever service name is the default for your OS distro. # class mongodb::client ( String[1] $ensure = $mongodb::client::params::package_ensure, diff --git a/manifests/db.pp b/manifests/db.pp index 3d20b9864..eb66b6765 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -1,19 +1,26 @@ # @summary Class for creating mongodb databases and users. # -# @param user +# @param user # Database username. +# # @param auth_mechanism # Authentication mechanism. scram_sha_256 password verification is not supported. Defaults to 'scram_sha_1'. +# # @param db_name # Database name. Defaults to $name. +# # @param password_hash # Hashed password. Hex encoded md5 hash of "$username:mongo:$password". +# # @param password # Plain text user password. This is UNSAFE, use 'password_hash' instead. +# # @param roles # Array with user roles. Deaults to ['dbAdmin'] +# # @param tries # The maximum amount of two second tries to wait MongoDB startup. Defaults to 10. +# # @param update_password # Force an update of the password when scram_sha_256 is used. Defaults to false. # diff --git a/manifests/globals.pp b/manifests/globals.pp index 3517921b9..6e32eb432 100644 --- a/manifests/globals.pp +++ b/manifests/globals.pp @@ -1,29 +1,119 @@ -# @summary Class for setting cross-class global overrides. See README.md for more details. +# @summary Class for setting cross-class global overrides. +# +# @example Use a specific MongoDB version to install from the community repository. +# +# class {'mongodb::globals': +# manage_package_repo => true, +# repo_version => '4.4', +# } +# -> class {'mongodb::client': } +# -> class {'mongodb::server': } +# +# @example Use a specific MongoDB version to install from the enterprise repository. +# +# class {'mongodb::globals': +# manage_package_repo => true, +# repo_version => '4.4', +# use_enterprise_repo => true, +# } +# -> class {'mongodb::client': } +# -> class {'mongodb::server': } +# +# @example To disable managing of repository, but still enable managing packages. +# +# class {'mongodb::globals': +# manage_package_repo => false, +# manage_package => true, +# } +# -> class {'mongodb::server': } +# -> class {'mongodb::client': } # # @param server_package_name +# This setting can be used to override the default MongoDB server package name. +# If not specified, the module will use whatever package name is the default for your OS distro. +# # @param client_package_name +# This setting can be used to specify the name of the client package that should be installed. +# If not specified, the module will use whatever service name is the default for your OS distro. +# # @param mongod_service_manage +# This setting can be used to override the default management of the mongod service. +# By default the module will manage the mongod process. # @param service_enable +# This setting can be used to specify if the service should be enable at boot +# # @param service_ensure +# This setting can be used to specify if the service should be running +# # @param service_name +# This setting can be used to override the default MongoDB service name. +# If not specified, the module will use whatever service name is the default for your OS distro. +# # @param service_provider +# This setting can be used to override the default MongoDB service provider. +# If not specified, the module will use whatever service provider is the default for your OS distro. +# # @param service_status +# This setting can be used to override the default status check command for your MongoDB service. +# If not specified, the module will use whatever service name is the default for your OS distro. +# # @param user +# This setting can be used to override the default MongoDB user and owner of the service and related files in the file system. +# If not specified, the module will use the default for your OS distro. +# # @param group +# This setting can be used to override the default MongoDB user group to be used for related files in the file system. +# If not specified, the module will use the default for your OS distro. +# # @param ipv6 +# This setting is used to configure MongoDB to turn on ipv6 support. +# If not specified and ipv6 address is passed to MongoDB bind_ip it will just fail. +# # @param bind_ip -# @param version Version of mongodb to install -# @param repo_version Version of mongodb repo to install -# @param manage_package_repo If `true` configure upstream mongodb repos +# This setting can be used to configure MonogDB 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. +# Note: This value should be passed as an array. +# +# @param version +# The version of MonogDB to install/manage. This is needed when managing repositories. +# If not specified, the module will use the default for your OS distro. +# +# @param repo_version +# The version of the package repo. +# +# @param manage_package_repo +# Whether to use the MongoDB software repository or the OS packages (True) or a Custom repo (False) +# # @param manage_package +# wgether this module willm manage the mongoDB server package +# # @param repo_proxy +# This will allow you to set a proxy for your repository in case you are behind a corporate firewall. +# Currently this is only supported with yum repositories +# # @param proxy_username +# This sets the username for the proxyserver, should authentication be required. +# # @param proxy_password +# This sets the password for the proxyserver, should authentication be required +# # @param repo_location +# This setting can be used to override the default MongoDB repository location. +# If not specified, the module will use the default repository for your OS distro. +# # @param use_enterprise_repo +# When manage_package_repo is set to true, this setting indicates if it will use the Community Edition +# (false, the default) or the Enterprise one (true). +# # @param 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. +# # @param pidfilemode +# The file mode of the pid file +# # @param manage_pidfile +# If true, the pidfile will be managed by puppet # class mongodb::globals ( $server_package_name = undef, diff --git a/manifests/mongos.pp b/manifests/mongos.pp index de34b15b3..1140836be 100644 --- a/manifests/mongos.pp +++ b/manifests/mongos.pp @@ -1,28 +1,88 @@ -# @summary This installs a Mongo Shard daemon. See README.md for more details. +# @summary This installs a Mongo Shard daemon. +# +# This class should only be used if you want to implement sharding within your mongodb deployment. +# This class allows you to configure the mongos daemon (responsible for routing) on your platform. +# +# @example mongos can be installed the following way. +# class {'mongodb::mongos' : +# configdb => ['configsvr1.example.com:27018'], +# } # # @param config +# Path of the config file. If not specified, the module will use the default for your OS distro. +# # @param config_content +# Config content if the default doesn't match one needs. +# # @param config_template +# Path to the config template if the default doesn't match one needs. +# # @param configdb +# Array of the config servers IP addresses the mongos should connect to. +# # @param config_data +# Hash containing key-value pairs to allow for additional configuration options to be set in user-provided template. +# # @param service_manage +# Whether or not the MongoDB sharding service resource should be part of the catalog. +# # @param service_provider +# This setting can be used to override the default Mongos service provider. +# If not specified, the module will use whatever service provider is the default for your OS distro. +# # @param service_name +# This setting can be used to override the default Mongos service name. +# If not specified, the module will use whatever service name is the default for your OS distro. +# # @param service_user +# The user used by Systemd for running the service. +# # @param service_group +# The group used by Systemd for running the service +# # @param service_template +# Path to the service template if the default doesn't match one needs. +# # @param service_enable +# This setting can be used to specify if the service should be enable at boot +# # @param service_ensure +# This setting can be used to specify if the service should be running +# # @param service_status +# This setting can be used to override the default status check command for your Mongos service. +# If not specified, the module will use whatever service name is the default for your OS distro. +# # @param package_ensure +# This setting can be used to specify if puppet should install the package or not +# # @param package_name +# This setting can be used to specify the name of the package that should be installed. +# If not specified, the module will use whatever service name is the default for your OS distro. +# # @param unixsocketprefix +# The path for the UNIX socket. If this option has no value, the mongos process creates a socket with /tmp as a prefix. +# # @param 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. +# # @param 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. +# # @param fork +# Set to true to fork server process at launch time. The default setting depends on the operating system. +# # @param 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. +# # @param port +# Specifies a TCP port for the server instance to listen for client connections. +# # @param restart +# Specifies whether the service should be restarted on config changes. # class mongodb::mongos ( Stdlib::Absolutepath $config = $mongodb::mongos::params::config, diff --git a/manifests/mongos/config.pp b/manifests/mongos/config.pp index adf39161f..852be2299 100644 --- a/manifests/mongos/config.pp +++ b/manifests/mongos/config.pp @@ -1,20 +1,48 @@ -# @summary Manages mongos config -# # @api private # +# @summary Manages mongos config +# # @param package_ensure +# This setting can be used to specify if puppet should install the package or not +# # @param config +# Path of the config file. If not specified, the module will use the default for your OS distro. +# # @param config_content +# Config content if the default doesn't match one needs. +# # @param config_template +# Path to the config template if the default doesn't match one needs. +# # @param service_manage +# Whether or not the MongoDB sharding service resource should be part of the catalog. +# # @param configdb +# Array of the config servers IP addresses the mongos should connect to. +# # @param 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. +# # @param port +# Specifies a TCP port for the server instance to listen for client connections. +# # @param fork +# Set to true to fork server process at launch time. The default setting depends on the operating system. +# # @param 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. +# # @param 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. +# # @param unixsocketprefix +# The path for the UNIX socket. If this option has no value, the mongos process creates a socket with /tmp as a prefix. +# # @param config_data +# Hash containing key-value pairs to allow for additional configuration options to be set in user-provided templ ate. # class mongodb::mongos::config ( $package_ensure = $mongodb::mongos::package_ensure, diff --git a/manifests/mongos/install.pp b/manifests/mongos/install.pp index 6ef4ffe1d..cc1f19c83 100644 --- a/manifests/mongos/install.pp +++ b/manifests/mongos/install.pp @@ -1,9 +1,13 @@ -# @summary Manages the mongos package -# # @api private # +# @summary Installs mongos +# # @param package_ensure +# This setting can be used to specify if puppet should install the package or not +# # @param package_name +# This setting can be used to specify the name of the package that should be installed. +# If not specified, the module will use whatever service name is the default for your OS distro. # class mongodb::mongos::install ( $package_ensure = $mongodb::mongos::package_ensure, diff --git a/manifests/mongos/service.pp b/manifests/mongos/service.pp index d690db4a7..639b24802 100644 --- a/manifests/mongos/service.pp +++ b/manifests/mongos/service.pp @@ -1,17 +1,40 @@ -# @summary Manages the mongos service -# # @api private # +# @summary Manages the mongos service +# # @param package_ensure +# This setting can be used to specify if puppet should install the package or not. +# # @param service_manage +# Whether or not the MongoDB sharding service resource should be part of the catalog. +# # @param service_name +# This setting can be used to override the default Mongos service name. +# If not specified, the module will use whatever service name is the default for your OS distro. +# # @param service_enable +# This setting can be used to specify if the service should be enable at boot. +# # @param service_ensure +# This setting can be used to specify if the service should be running. +# # @param service_status +# This setting can be used to override the default status check command for your Mongos service. +# If not specified, the module will use whatever service name is the default for your OS distro. +# # @param service_provider +# This setting can be used to override the default Mongos service provider. +# If not specified, the module will use whatever service provider is the default for your OS distro. +# # @param bind_ip +# Set this option to configure the mongod or mongos process to bind to and listen for connections from applicati ons on this address. +# If not specified, the module will use the default for your OS distro. +# # @param port +# Specifies a TCP port for the server instance to listen for client connections. +# # @param service_template +# Path to the service template if the default doesn't match one needs. # class mongodb::mongos::service ( $package_ensure = $mongodb::mongos::package_ensure, diff --git a/manifests/opsmanager.pp b/manifests/opsmanager.pp index 7ac1db000..14f1b201d 100644 --- a/manifests/opsmanager.pp +++ b/manifests/opsmanager.pp @@ -1,42 +1,112 @@ # @summary This installs Ops Manager # +# @example To install Ops Manager and have it run with a local MongoDB application server do the following: +# class {'mongodb::opsmanager': +# opsmanager_url => 'http://opsmanager.yourdomain.com' +# mongo_uri => 'mongodb://yourmongocluster:27017, +# from_email_addr => 'opsmanager@yourdomain.com', +# reply_to_email_addr => 'replyto@yourdomain.com', +# admin_email_addr => 'admin@yourdomain.com', +# smtp_server_hostname => 'email-relay.yourdomain.com' +# } +# # @param user # The user that owns the config file # @param group # The group that owns the config file +# # @param ensure +# Used to ensure that the package is installed and the service is running, or that the package is absent/purged +# and the service is stopped. +# # @param package_name +# his setting can be used to specify the name of the package that should be installed. +# If not specified, the module will use whatever service name is the default for your OS distro. +# # @param package_ensure +# This setting can be used to specify if puppet should install the package or not. +# # @param service_enable +# This setting can be used to specify if the service should be enable at boot. +# # @param service_manage +# Whether or not the MongoDB sharding service resource should be part of the catalog. +# # @param service_name +# This setting can be used to override the default Mongos service name. +# If not specified, the module will use whatever service name is the default for your OS distro. +# # @param download_url +# This setting can be used to override the default MongoDB Ops-Manager download location. +# # @param mongo_uri +# Connection string to the mongod cluster. +# # @param opsmanager_url # The fully qualified url where opsmanager runs. Must include the port. +# # @param client_certificate_mode +# Client certificate authorization mode. +# # @param from_email_addr +# Email address ussed as sender +# # @param reply_to_email_addr +# Reply to email address to use +# # @param admin_email_addr +# Adminsitrator's email address +# # @param email_dao_class +# The email delivery agent class to use +# # @param mail_transport +# The email transport type to use +# # @param smtp_server_hostname +# Hostname of the email server to use. +# # @param smtp_server_port +# email port on the email server to use. +# # @param ssl +# Set to true to enable ssl. +# # @param ignore_ui_setup +# Wheter to install ui or not. +# # @param ca_file # Ca file for secure connection to backup agents. + # @param pem_key_file # Pem key file containing the cert and private key used for secure connections to backup agents. + # @param pem_key_password # The password to the pem key file. +# # @param user_svc_class +# The user svc class +# Default: com.xgen.svc.mms.svc.user.UserSvcDb +# External Source: com.xgen.svc.mms.svc.user.UserSvcCrowd +# Internal Database: com.xgen.svc.mms.svc.user.UserSvcDb +# # @param snapshot_interval +# The snapshot interval to use +# # @param snapshot_interval_retention +# The snapshot interval retention period +# # @param snapshot_daily_retention +# The dayly snapshot interval retention period +# # @param snapshot_weekly_retention +# The weekly snapshot interval retention period +# # @param snapshot_monthly_retention +# The monthly snapshot interval retention period +# # @param versions_directory +# The directory where to store the snapshot versions # class mongodb::opsmanager ( String[1] $user = 'mongodb-mms', diff --git a/manifests/params.pp b/manifests/params.pp index 90aab163f..18aab19b9 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,7 +1,7 @@ -# @summary mongodb params -# # @api private # +# @summary mongodb params +# class mongodb::params inherits mongodb::globals { $ensure = true $dbpath = '/var/lib/mongodb' diff --git a/manifests/replset.pp b/manifests/replset.pp index e95191858..0d2eca460 100644 --- a/manifests/replset.pp +++ b/manifests/replset.pp @@ -1,6 +1,17 @@ # @summary Wrapper class useful for hiera based deployments # +# @example hieradata +# +# mongodb::replset::sets: +# replicaset01: +# ensure: present +# members: +# - member01.example.com:27017 +# - member02.example.com:27017 +# - member03.example.com:27017 +# # @param sets +# Hash of attributes as described in the mongodb_replset custom type # class mongodb::replset ( $sets = undef diff --git a/manifests/repo.pp b/manifests/repo.pp index b2db00b07..6d2c69399 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -1,18 +1,31 @@ +# @api private +# # @summary Manages the mongodb repository # -# @api private # -# @param ensure +# @param ensure +# present or absent +# # @param version -# Optional repo version string. +# The version of the mongodb repo +# # @param use_enterprise_repo -# Boolean value to use enterprise repository. Defaults to false. +# Wether to use the OS or Enterprise repo +# # @param repo_location -# Optional location of the repository +# Location of the upstream repository +# # @param proxy +# Proxy hostnam +# # @param proxy_username +# Proxy user name +# # @param proxy_password +# Proxy pasword +# # @param aptkey_options +# Options for debian aptkey # class mongodb::repo ( Enum['present', 'absent'] $ensure = 'present', diff --git a/manifests/repo/zypper.pp b/manifests/repo/zypper.pp index bb463fcbc..15314629a 100644 --- a/manifests/repo/zypper.pp +++ b/manifests/repo/zypper.pp @@ -1,4 +1,4 @@ -# PRIVATE CLASS: do not use directly +# @api private # # @summary This is a repo class for zypper # diff --git a/manifests/server.pp b/manifests/server.pp index e64eb600a..dc43d150a 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -1,20 +1,324 @@ -# @summary This installs a MongoDB server. See README.md for more details. +# @summary This installs a MongoDB server. +# +# Most of the parameters manipulate the mongod.conf file. +# +# For more details about configuration parameters consult the MongoDB Configuration File Options. +# +# @param ensure +# Used to ensure that the package is installed and the service is running, or that the package is +# absent/purged and the service is stopped. +# +# @param user +# This setting can be used to override the default MongoDB user and owner of the service and related files in the file system. +# If not specified, the module will use the default for your OS distro. +# +# @param group +# This setting can be used to override the default MongoDB user group to be used for related files in the file system. +# If not specified, the module will use the default for your OS distro. +# +# @param config +# Path of the config file. If not specified, the module will use the default for your OS distro. +# +# @param dbpath +# Set this value to designate a directory for the mongod instance to store it's data. +# If not specified, the module will use the default for your OS distro. +# +# @param dbpath_fix +# Set this value to true if you want puppet to recursively manage the permissions of the files in the dbpath +# directory. If you are using the default dbpath, this should probably be false. Set this to true if you are +# using a custom dbpath. +# +# @param pidfilemode +# The file mode of the pidfilepath +# +# @param 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. +# +# @param manage_pidfile +# Should puppet create the pidfile. Mongod 6.2.10 will not start if pidfile exists +# +# @param rcfile +# The path to the custom mongosh rc file. +# +# @param service_manage +# Whether or not the MongoDB service resource should be part of the catalog. +# +# @param service_manage +# Whether or not the MongoDB sharding service resource should be part of the catalog. +# +# @param service_name +# This setting can be used to override the default Mongos service name. +# If not specified, the module will use whatever service name is the default for your OS distro. +# +# @param service_provider +# This setting can be used to override the default Mongos service provider. +# If not specified, the module will use whatever service provider is the default for your OS distro. +# +# @param service_status +# This setting can be used to override the default status check command for your Mongos service. +# If not specified, the module will use whatever service name is the default for your OS distro. +# +# @param service_enable +# This setting can be used to specify if the service should be enable at boot. +# +# @param service_ensure +# This setting can be used to specify if the service should be running. +# +# @param package_ensure +# This setting can be used to specify if puppet should install the package or not. +# +# @param package_name +# This setting can be used to specify the name of the package that should be installed. +# If not specified, the module will use whatever service name is the default for your OS distro. +# +# @param 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. +# +# @param 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. +# +# @param ipv6 +# This setting has to be true to configure MongoDB to turn on ipv6 support. If not specified and ipv6 +# address is passed to MongoDB bind_ip it will just fail. +# +# @param logappend +# Set to true to add new entries to the end of the logfile rather than overwriting the content of the log +# when the process restarts. +# +# @param system_logrotate +# Set to reopen for mongo to close a log file then reopen it so that logrotations handled outside of mongo +# perform as expected. +# +# @param fork +# Set to true to fork server process at launch time. The default setting depends on the operating system. +# +# @param port +# Specifies a TCP port for the server instance to listen for client connections. +# +# @param journal +# Set to true to enable operation journaling to ensure write durability and data consistency. +# +# @param nojournal +# Set nojournal = true to disable durability journaling. By default, mongod enables journaling in 64-bit versions after v2.0. +# Note: You must use journal to enable journaling on 32-bit systems. +# +# @param smallfiles +# Set to true to modify MongoDB to use a smaller default data file size. Specifically, smallfiles reduces +# the initial size for data files and limits them to 512 megabytes. +# +# @param cpu +# Set to true to force mongod to report every four seconds CPU utilization and the amount of time that the +# processor waits for I/O operations to complete (i.e. I/O wait.) +# +# @param auth +# et to true to enable database authentication for users connecting from remote hosts. If no users exist, +# the localhost interface will continue to have access to the database until you create the first user. +# +# @param noauth +# Disable authentication. +# +# @param verbose +# Increases the amount of internal reporting returned on standard output or in the log file generated by logpath. +# +# @param verbositylevel +# MongoDB has the following levels of verbosity: v, vv, vvv, vvvv and vvvvv. +# +# @param objcheck +# Forces the mongod to validate all requests from clients upon receipt to ensure that clients never insert +# invalid documents into the database. +# +# @param quota +# Set to true to enable a maximum limit for the number of data files each database can have. The default +# quota is 8 data files, when quota is true. +# +# @param quotafiles +# Modify limit on the number of data files per database. This option requires the quota setting. +# +# @param diaglog +# Creates a very verbose diagnostic log for troubleshooting and recording various errors. For more +# information please refer to MongoDB Configuration File Options. +# +# @param directoryperdb +# Set to true to modify the storage pattern of the data directory to store each database’s files in a distinct folder. +# +# @param profile +# Modify this value to changes the level of database profiling, which inserts information about operation +# performance into output of mongod or the log file if specified by logpath. +# +# @param maxconns +# Specifies a value to set the maximum number of simultaneous connections that MongoDB will accept. +# Unless set, MongoDB will not limit its own connections. +# +# @param oplog_size +# Specifies a maximum size in megabytes for the replication operation log (e.g. oplog.) mongod creates an +# oplog based on the maximum amount of space available. For 64-bit systems, the oplog is typically 5% of +# available disk space. +# +# @param nohints +# Ignore query hints. +# +# @param nohttpinterface +# Set to true to disable the HTTP interface. This command will override the rest and disable the HTTP +# interface if you specify both. +# +# @param noscripting +# Set noscripting = true to disable the scripting engine. +# +# @param notablescan +# Set notablescan = true to forbid operations that require a table scan. +# +# @param noprealloc +# Set noprealloc = true to disable the preallocation of data files. This will shorten the start up time in +# some cases, but can cause significant performance penalties during normal operations. +# +# @param nssize +# Use this setting to control the default size for all newly created namespace files (i.e .ns). +# +# @param mms_token +# MMS token for mms monitoring. +# +# @param mms_name +# MMS identifier for mms monitoring. +# +# @param mms_interval +# MMS interval for mms monitoring. +# +# @param replset +# Use this setting to configure replication with replica sets. Specify a replica set name as an argument to +# this set. All hosts must have the same set name. +# +# @param replset_config +# A hash that is used to configure the replica set. Mutually exclusive with replset_members param. +# class mongodb::server { +# replset => 'rsmain', +# replset_config => { 'rsmain' => { +# ensure => present, +# settings => { heartbeatTimeoutSecs => 15, getLastErrorModes => { ttmode => { dc => 1 } } }, +# members => [{'host' => 'host1:27017', 'tags':{ 'dc' : 'east'}}, { 'host' => 'host2:27017'}, 'host3:27017'] }}, +# } +# +# @param replset_members +# An array of member hosts for the replica set. Mutually exclusive with replset_config param. +# +# @param configsvr +# Use this setting to enable config server mode for mongod. +# +# @param shardsvr +# Use this setting to enable shard server mode for mongod. +# +# @param rest +# Set to true to enable a simple REST interface. +# +# @param quiet +# Runs the mongod or mongos instance in a quiet mode that attempts to limit the amount of output. +# This option suppresses : "output from database commands, including drop, dropIndexes, diagLogging, +# validate, and clean", "replication activity", "connection accepted events" and "connection closed events". +# +# For production systems this option is not recommended as it may make tracking problems during particular +# connections much more difficult. +# +# @param slowms +# Sets the threshold for mongod to consider a query “slow” for the database profiler. +# +# @param keyfile +# Specify the path to a key file to store authentication information. This option is only useful for the +# connection between replica set members. +# +# @param key +# Specify the key contained within the keyfile. This option is only useful for the connection between +# replica set members. +# +# @param set_parameter +# Specify extra configuration file parameters (i.e. textSearchEnabled=true). +# +# @param syslog +# Sends all logging output to the host’s syslog system rather than to standard output or a log file. +# Important: You cannot use syslog with logpath. Set logpath to false to disable it. +# +# @param config_content +# Config content if the default doesn't match one needs. +# +# @param config_template +# Path to the config template if the default doesn't match one needs. +# +# @param config_data +# A hash to allow for additional configuration options to be set in user-provided template. +# +# @param ssl +# Use SSL validation. +# Important: You need to have ssl_key set as well, and the file needs to pre-exist on node. If you wish to +# use certificate validation, ssl_ca must also be set. +# +# @param ssl_key +# Defines the path of the file that contains the TLS/SSL certificate and key. +# +# @param ssl_ca +# Defines the path of the file that contains the certificate chain for verifying client certificates. +# +# @param ssl_weak_cert +# Set to true to disable mandatory SSL client authentication. +# +# @param ssl_invalid_hostnames +# Set to true to disable fqdn SSL cert check. +# +# @param ssl_mode +# Ssl authorization mode. # # @param tls # Ensure tls is enabled. +# # @param tls_key # Defines the path of the file that contains the TLS/SSL certificate and key. +# # @param tls_ca # Defines the path of the file that contains the certificate chain for verifying client certificates. +# # @param tls_conn_without_cert # Set to true to bypass client certificate validation for clients that do not present a certificate. +# # @param tls_invalid_hostnames # Set to true to disable the validation of the hostnames in TLS certificates. +# # @param tls_mode # Defines if TLS is used for all network connections. Allowed values are 'requireTLS', 'preferTLS' or 'allowTLS'. # @param admin_password_hash # Hashed password. Hex encoded md5 hash of mongodb password. # +# @param restart +# Specifies whether the service should be restarted on config changes. +# +# @param storage_engine +# Only needed for MongoDB 3.x versions, where it's possible to select the 'wiredTiger' engine in addition to +# the default 'mmapv1' engine. If not set, the config is left out and mongo will default to 'mmapv1'. +# +# @param create_admin +# Allows to create admin user for admin database. +# +# @param admin_username +# Administrator user name +# +# @param admin_password +# Administrator user password +# +# @param admin_auth_mechanism +# Administrator authentication mechanism. scram_sha_256 password synchronization verification is not supported. +# +# @param admin_update_password +# Update password. Used with SCRAM-SHA-256 because password verification is not supported. +# +# @param admin_roles +# Administrator user roles +# +# @param handle_creds +# Set this to false to avoid having puppet handle .mongoshrc.js in case you wish to deliver it by other +# means. This is needed for facts and providers to work if you have auth set to true. +# +# @param store_creds +# Store admin credentials in mongoshrc.js file. Uses with create_admin parameter +# class mongodb::server ( Variant[Boolean, String] $ensure = $mongodb::params::ensure, String $user = $mongodb::params::user, diff --git a/manifests/shardsvr.pp b/manifests/shardsvr.pp index 486fe5fc7..df8940802 100644 --- a/manifests/shardsvr.pp +++ b/manifests/shardsvr.pp @@ -1,6 +1,17 @@ # @summary Wrapper class useful for hiera based deployments # +# @example hieradata +# mongodb::shardsvr::shards: +# shard01: +# keys: +# - {x: 1} +# members: +# - shardhost01.exmaple.com:30000 +# - shardhost02.exmaple.com:30000 +# - shardhost03.exmaple.com:30000 +# # @param shards +# Hash of attributes as described in the mongodb_shardsvr custom type # class mongodb::shardsvr ( $shards = undef