Skip to content

Commit

Permalink
Move documentation from README into the manifests
Browse files Browse the repository at this point in the history
Documentation can be more easily generated using docstrings.
  • Loading branch information
Johan De Wit authored and stevenpost committed Mar 21, 2024
1 parent 1c6c5a2 commit cb2c4de
Show file tree
Hide file tree
Showing 19 changed files with 1,128 additions and 969 deletions.
639 changes: 2 additions & 637 deletions README.md

Large diffs are not rendered by default.

780 changes: 474 additions & 306 deletions REFERENCE.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/puppet/type/mongodb_conn_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/mongodb_replset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/mongodb_shard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions manifests/client.pp
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
9 changes: 8 additions & 1 deletion manifests/db.pp
Original file line number Diff line number Diff line change
@@ -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.
#
Expand Down
98 changes: 94 additions & 4 deletions manifests/globals.pp
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
62 changes: 61 additions & 1 deletion manifests/mongos.pp
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
32 changes: 30 additions & 2 deletions manifests/mongos/config.pp
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
8 changes: 6 additions & 2 deletions manifests/mongos/install.pp
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
27 changes: 25 additions & 2 deletions manifests/mongos/service.pp
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Loading

0 comments on commit cb2c4de

Please sign in to comment.