From 6c26e839b5058dca52219258ba467b8397069784 Mon Sep 17 00:00:00 2001 From: Johan De Wit Date: Fri, 7 Jul 2023 11:18:09 +0200 Subject: [PATCH] Move documentation from README into the manifests Documentation can be more easily generated using docstrings. --- lib/puppet/type/mongodb_conn_validator.rb | 2 +- lib/puppet/type/mongodb_replset.rb | 2 +- lib/puppet/type/mongodb_shard.rb | 2 +- manifests/client.pp | 9 +- manifests/db.pp | 9 +- manifests/globals.pp | 97 ++++++- manifests/mongos.pp | 62 ++++- manifests/mongos/config.pp | 32 ++- manifests/mongos/install.pp | 8 +- manifests/mongos/service.pp | 27 +- manifests/opsmanager.pp | 70 +++++ manifests/params.pp | 4 +- manifests/replset.pp | 11 + manifests/repo.pp | 23 +- manifests/repo/zypper.pp | 2 +- manifests/server.pp | 306 +++++++++++++++++++++- manifests/shardsvr.pp | 11 + 17 files changed, 651 insertions(+), 26 deletions(-) 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..dd3a17234 100644 --- a/manifests/globals.pp +++ b/manifests/globals.pp @@ -1,29 +1,118 @@ -# @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 more recent MongoDB version to install from the community repository. +# +# class {'mongodb::globals': +# manage_package_repo => true, +# version => '3.6', +# } +# -> class {'mongodb::client': } +# -> class {'mongodb::server': } +# +# @example Install MongoDB from a custom repository. +# +# class {'mongodb::globals': +# manage_package_repo => true, +# repo_location => 'http://example.com/repo' +# } +# -> class {'mongodb::server': } +# -> class {'mongodb::client': } +# +# @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