Skip to content

Commit b5f6935

Browse files
Johan De Witstevenpost
authored andcommitted
Move documentation from README into the manifests
Documentation can be more easily generated using docstrings.
1 parent 1c6c5a2 commit b5f6935

File tree

19 files changed

+1115
-969
lines changed

19 files changed

+1115
-969
lines changed

README.md

Lines changed: 2 additions & 637 deletions
Large diffs are not rendered by default.

REFERENCE.md

Lines changed: 461 additions & 306 deletions
Large diffs are not rendered by default.

lib/puppet/type/mongodb_conn_validator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
purposes such as monitoring."
99

1010
ensurable do
11-
desc 'Ensurable property'
11+
desc 'Ensure to verify the connection to mongodb'
1212
defaultvalues
1313
defaultto :present
1414
end

lib/puppet/type/mongodb_replset.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@doc = 'Manage a MongoDB replicaSet'
99

1010
ensurable do
11-
desc 'Ensurable property'
11+
desc 'Ensure the replicaset is either present or absent'
1212
defaultto :present
1313

1414
newvalue(:present) do

lib/puppet/type/mongodb_shard.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@doc = 'Manage a MongoDB Shard'
99

1010
ensurable do
11-
desc 'Ensurable property'
11+
desc 'Ensure the shard is either present or absent'
1212
defaultto :present
1313

1414
newvalue(:present) do

manifests/client.pp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
# @summary Class for installing a MongoDB client shell (CLI).
22
#
3+
# @example Basic usage
4+
# include mongodb::client
5+
36
# @param ensure
4-
# Desired ensure state of the package.
7+
# Used to ensure that the package is installed, or that the package is absent/purged
8+
#
59
# @param package_name
6-
# Name of the package to install the client from. Default is repository dependent.
10+
# This setting can be used to specify the name of the package that should be installed.
11+
# If not specified, the module will use whatever service name is the default for your OS distro.
712
#
813
class mongodb::client (
914
String[1] $ensure = $mongodb::client::params::package_ensure,

manifests/db.pp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
# @summary Class for creating mongodb databases and users.
22
#
3-
# @param user
3+
# @param user
44
# Database username.
5+
#
56
# @param auth_mechanism
67
# Authentication mechanism. scram_sha_256 password verification is not supported. Defaults to 'scram_sha_1'.
8+
#
79
# @param db_name
810
# Database name. Defaults to $name.
11+
#
912
# @param password_hash
1013
# Hashed password. Hex encoded md5 hash of "$username:mongo:$password".
14+
#
1115
# @param password
1216
# Plain text user password. This is UNSAFE, use 'password_hash' instead.
17+
#
1318
# @param roles
1419
# Array with user roles. Deaults to ['dbAdmin']
20+
#
1521
# @param tries
1622
# The maximum amount of two second tries to wait MongoDB startup. Defaults to 10.
23+
#
1724
# @param update_password
1825
# Force an update of the password when scram_sha_256 is used. Defaults to false.
1926
#

manifests/globals.pp

Lines changed: 94 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,119 @@
1-
# @summary Class for setting cross-class global overrides. See README.md for more details.
1+
# @summary Class for setting cross-class global overrides.
2+
#
3+
# @example Use a specific MongoDB version to install from the community repository.
4+
#
5+
# class {'mongodb::globals':
6+
# manage_package_repo => true,
7+
# repo_version => '4.4',
8+
# }
9+
# -> class {'mongodb::client': }
10+
# -> class {'mongodb::server': }
11+
#
12+
# @example Use a specific MongoDB version to install from the enterprise repository.
13+
#
14+
# class {'mongodb::globals':
15+
# manage_package_repo => true,
16+
# repo_version => '4.4',
17+
# use_enterprise_repo => true,
18+
# }
19+
# -> class {'mongodb::client': }
20+
# -> class {'mongodb::server': }
21+
#
22+
# @example To disable managing of repository, but still enable managing packages.
23+
#
24+
# class {'mongodb::globals':
25+
# manage_package_repo => false,
26+
# manage_package => true,
27+
# }
28+
# -> class {'mongodb::server': }
29+
# -> class {'mongodb::client': }
230
#
331
# @param server_package_name
32+
# This setting can be used to override the default MongoDB server package name.
33+
# If not specified, the module will use whatever package name is the default for your OS distro.
34+
#
435
# @param client_package_name
36+
# This setting can be used to specify the name of the client package that should be installed.
37+
# If not specified, the module will use whatever service name is the default for your OS distro.
38+
#
539
# @param mongod_service_manage
40+
# This setting can be used to override the default management of the mongod service.
41+
# By default the module will manage the mongod process.
642
# @param service_enable
43+
# This setting can be used to specify if the service should be enable at boot
44+
#
745
# @param service_ensure
46+
# This setting can be used to specify if the service should be running
47+
#
848
# @param service_name
49+
# This setting can be used to override the default MongoDB service name.
50+
# If not specified, the module will use whatever service name is the default for your OS distro.
51+
#
952
# @param service_provider
53+
# This setting can be used to override the default MongoDB service provider.
54+
# If not specified, the module will use whatever service provider is the default for your OS distro.
55+
#
1056
# @param service_status
57+
# This setting can be used to override the default status check command for your MongoDB service.
58+
# If not specified, the module will use whatever service name is the default for your OS distro.
59+
#
1160
# @param user
61+
# This setting can be used to override the default MongoDB user and owner of the service and related files in the file system.
62+
# If not specified, the module will use the default for your OS distro.
63+
#
1264
# @param group
65+
# This setting can be used to override the default MongoDB user group to be used for related files in the file system.
66+
# If not specified, the module will use the default for your OS distro.
67+
#
1368
# @param ipv6
69+
# This setting is used to configure MongoDB to turn on ipv6 support.
70+
# If not specified and ipv6 address is passed to MongoDB bind_ip it will just fail.
71+
#
1472
# @param bind_ip
15-
# @param version Version of mongodb to install
16-
# @param repo_version Version of mongodb repo to install
17-
# @param manage_package_repo If `true` configure upstream mongodb repos
73+
# This setting can be used to configure MonogDB process to bind to and listen for connections from applications on this address.
74+
# If not specified, the module will use the default for your OS distro.
75+
# Note: This value should be passed as an array.
76+
#
77+
# @param version
78+
# The version of MonogDB to install/manage. This is needed when managing repositories.
79+
# If not specified, the module will use the default for your OS distro.
80+
#
81+
# @param repo_version
82+
# The version of the package repo.
83+
#
84+
# @param manage_package_repo
85+
# Whether to use the MongoDB software repository or the OS packages (True) or a Custom repo (False)
86+
#
1887
# @param manage_package
88+
# wgether this module willm manage the mongoDB server package
89+
#
1990
# @param repo_proxy
91+
# This will allow you to set a proxy for your repository in case you are behind a corporate firewall.
92+
# Currently this is only supported with yum repositories
93+
#
2094
# @param proxy_username
95+
# This sets the username for the proxyserver, should authentication be required.
96+
#
2197
# @param proxy_password
98+
# This sets the password for the proxyserver, should authentication be required
99+
#
22100
# @param repo_location
101+
# This setting can be used to override the default MongoDB repository location.
102+
# If not specified, the module will use the default repository for your OS distro.
103+
#
23104
# @param use_enterprise_repo
105+
# When manage_package_repo is set to true, this setting indicates if it will use the Community Edition
106+
# (false, the default) or the Enterprise one (true).
107+
#
24108
# @param pidfilepath
109+
# Specify a file location to hold the PID or process ID of the mongod process.
110+
# If not specified, the module will use the default for your OS distro.
111+
#
25112
# @param pidfilemode
113+
# The file mode of the pid file
114+
#
26115
# @param manage_pidfile
116+
# If true, the pidfile will be managed by puppet
27117
#
28118
class mongodb::globals (
29119
$server_package_name = undef,

manifests/mongos.pp

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,88 @@
1-
# @summary This installs a Mongo Shard daemon. See README.md for more details.
1+
# @summary This installs a Mongo Shard daemon.
2+
#
3+
# This class should only be used if you want to implement sharding within your mongodb deployment.
4+
# This class allows you to configure the mongos daemon (responsible for routing) on your platform.
5+
#
6+
# @example mongos can be installed the following way.
7+
# class {'mongodb::mongos' :
8+
# configdb => ['configsvr1.example.com:27018'],
9+
# }
210
#
311
# @param config
12+
# Path of the config file. If not specified, the module will use the default for your OS distro.
13+
#
414
# @param config_content
15+
# Config content if the default doesn't match one needs.
16+
#
517
# @param config_template
18+
# Path to the config template if the default doesn't match one needs.
19+
#
620
# @param configdb
21+
# Array of the config servers IP addresses the mongos should connect to.
22+
#
723
# @param config_data
24+
# Hash containing key-value pairs to allow for additional configuration options to be set in user-provided template.
25+
#
826
# @param service_manage
27+
# Whether or not the MongoDB sharding service resource should be part of the catalog.
28+
#
929
# @param service_provider
30+
# This setting can be used to override the default Mongos service provider.
31+
# If not specified, the module will use whatever service provider is the default for your OS distro.
32+
#
1033
# @param service_name
34+
# This setting can be used to override the default Mongos service name.
35+
# If not specified, the module will use whatever service name is the default for your OS distro.
36+
#
1137
# @param service_user
38+
# The user used by Systemd for running the service.
39+
#
1240
# @param service_group
41+
# The group used by Systemd for running the service
42+
#
1343
# @param service_template
44+
# Path to the service template if the default doesn't match one needs.
45+
#
1446
# @param service_enable
47+
# This setting can be used to specify if the service should be enable at boot
48+
#
1549
# @param service_ensure
50+
# This setting can be used to specify if the service should be running
51+
#
1652
# @param service_status
53+
# This setting can be used to override the default status check command for your Mongos service.
54+
# If not specified, the module will use whatever service name is the default for your OS distro.
55+
#
1756
# @param package_ensure
57+
# This setting can be used to specify if puppet should install the package or not
58+
#
1859
# @param package_name
60+
# This setting can be used to specify the name of the package that should be installed.
61+
# If not specified, the module will use whatever service name is the default for your OS distro.
62+
#
1963
# @param unixsocketprefix
64+
# The path for the UNIX socket. If this option has no value, the mongos process creates a socket with /tmp as a prefix.
65+
#
2066
# @param pidfilepath
67+
# Specify a file location to hold the PID or process ID of the mongod process.
68+
# If not specified, the module will use the default for your OS distro.
69+
#
2170
# @param logpath
71+
# Specify the path to a file name for the log file that will hold all diagnostic logging information.
72+
# Unless specified, mongod will output all log information to the standard output.
73+
#
2274
# @param fork
75+
# Set to true to fork server process at launch time. The default setting depends on the operating system.
76+
#
2377
# @param bind_ip
78+
# Set this option to configure the mongod or mongos process to bind to and listen for connections from applications on this address.
79+
# If not specified, the module will use the default for your OS distro.
80+
#
2481
# @param port
82+
# Specifies a TCP port for the server instance to listen for client connections.
83+
#
2584
# @param restart
85+
# Specifies whether the service should be restarted on config changes.
2686
#
2787
class mongodb::mongos (
2888
Stdlib::Absolutepath $config = $mongodb::mongos::params::config,

manifests/mongos/config.pp

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,48 @@
1-
# @summary Manages mongos config
2-
#
31
# @api private
42
#
3+
# @summary Manages mongos config
4+
#
55
# @param package_ensure
6+
# This setting can be used to specify if puppet should install the package or not
7+
#
68
# @param config
9+
# Path of the config file. If not specified, the module will use the default for your OS distro.
10+
#
711
# @param config_content
12+
# Config content if the default doesn't match one needs.
13+
#
814
# @param config_template
15+
# Path to the config template if the default doesn't match one needs.
16+
#
917
# @param service_manage
18+
# Whether or not the MongoDB sharding service resource should be part of the catalog.
19+
#
1020
# @param configdb
21+
# Array of the config servers IP addresses the mongos should connect to.
22+
#
1123
# @param bind_ip
24+
# Set this option to configure the mongod or mongos process to bind to and listen for connections from applications on this address.
25+
# If not specified, the module will use the default for your OS distro.
26+
#
1227
# @param port
28+
# Specifies a TCP port for the server instance to listen for client connections.
29+
#
1330
# @param fork
31+
# Set to true to fork server process at launch time. The default setting depends on the operating system.
32+
#
1433
# @param pidfilepath
34+
# Specify a file location to hold the PID or process ID of the mongod process.
35+
# If not specified, the module will use the default for your OS distro.
36+
#
1537
# @param logpath
38+
# Specify the path to a file name for the log file that will hold all diagnostic logging information.
39+
# Unless specified, mongod will output all log information to the standard output.
40+
#
1641
# @param unixsocketprefix
42+
# The path for the UNIX socket. If this option has no value, the mongos process creates a socket with /tmp as a prefix.
43+
#
1744
# @param config_data
45+
# Hash containing key-value pairs to allow for additional configuration options to be set in user-provided templ ate.
1846
#
1947
class mongodb::mongos::config (
2048
$package_ensure = $mongodb::mongos::package_ensure,

0 commit comments

Comments
 (0)