Skip to content

Commit 7aa1a72

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

File tree

18 files changed

+1124
-332
lines changed

18 files changed

+1124
-332
lines changed

REFERENCE.md

Lines changed: 473 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: 93 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,118 @@
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 more recent MongoDB version to install from the community repository.
4+
#
5+
# class {'mongodb::globals':
6+
# manage_package_repo => true,
7+
# version => '3.6',
8+
# }
9+
# -> class {'mongodb::client': }
10+
# -> class {'mongodb::server': }
11+
#
12+
# @example Install MongoDB from a custom repository.
13+
#
14+
# class {'mongodb::globals':
15+
# manage_package_repo => true,
16+
# repo_location => 'http://example.com/repo'
17+
# }
18+
# -> class {'mongodb::server': }
19+
# -> class {'mongodb::client': }
20+
#
21+
# @example To disable managing of repository, but still enable managing packages.
22+
#
23+
# class {'mongodb::globals':
24+
# manage_package_repo => false,
25+
# manage_package => true,
26+
# }
27+
# -> class {'mongodb::server': }
28+
# -> class {'mongodb::client': }
229
#
330
# @param server_package_name
31+
# This setting can be used to override the default MongoDB server package name.
32+
# If not specified, the module will use whatever package name is the default for your OS distro.
33+
#
434
# @param client_package_name
35+
# This setting can be used to specify the name of the client package that should be installed.
36+
# If not specified, the module will use whatever service name is the default for your OS distro.
37+
#
538
# @param mongod_service_manage
39+
# This setting can be used to override the default management of the mongod service.
40+
# By default the module will manage the mongod process.
641
# @param service_enable
42+
# This setting can be used to specify if the service should be enable at boot
43+
#
744
# @param service_ensure
45+
# This setting can be used to specify if the service should be running
46+
#
847
# @param service_name
48+
# This setting can be used to override the default MongoDB service name.
49+
# If not specified, the module will use whatever service name is the default for your OS distro.
50+
#
951
# @param service_provider
52+
# This setting can be used to override the default MongoDB service provider.
53+
# If not specified, the module will use whatever service provider is the default for your OS distro.
54+
#
1055
# @param service_status
56+
# This setting can be used to override the default status check command for your MongoDB service.
57+
# If not specified, the module will use whatever service name is the default for your OS distro.
58+
#
1159
# @param user
60+
# This setting can be used to override the default MongoDB user and owner of the service and related files in the file system.
61+
# If not specified, the module will use the default for your OS distro.
62+
#
1263
# @param group
64+
# This setting can be used to override the default MongoDB user group to be used for related files in the file system.
65+
# If not specified, the module will use the default for your OS distro.
66+
#
1367
# @param ipv6
68+
# This setting is used to configure MongoDB to turn on ipv6 support.
69+
# If not specified and ipv6 address is passed to MongoDB bind_ip it will just fail.
70+
#
1471
# @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
72+
# This setting can be used to configure MonogDB process to bind to and listen for connections from applications on this address.
73+
# If not specified, the module will use the default for your OS distro.
74+
# Note: This value should be passed as an array.
75+
#
76+
# @param version
77+
# The version of MonogDB to install/manage. This is needed when managing repositories.
78+
# If not specified, the module will use the default for your OS distro.
79+
#
80+
# @param repo_version
81+
# The version of the package repo.
82+
#
83+
# @param manage_package_repo
84+
# Whether to use the MongoDB software repository or the OS packages (True) or a Custom repo (False)
85+
#
1886
# @param manage_package
87+
# wgether this module willm manage the mongoDB server package
88+
#
1989
# @param repo_proxy
90+
# This will allow you to set a proxy for your repository in case you are behind a corporate firewall.
91+
# Currently this is only supported with yum repositories
92+
#
2093
# @param proxy_username
94+
# This sets the username for the proxyserver, should authentication be required.
95+
#
2196
# @param proxy_password
97+
# This sets the password for the proxyserver, should authentication be required
98+
#
2299
# @param repo_location
100+
# This setting can be used to override the default MongoDB repository location.
101+
# If not specified, the module will use the default repository for your OS distro.
102+
#
23103
# @param use_enterprise_repo
104+
# When manage_package_repo is set to true, this setting indicates if it will use the Community Edition
105+
# (false, the default) or the Enterprise one (true).
106+
#
24107
# @param pidfilepath
108+
# Specify a file location to hold the PID or process ID of the mongod process.
109+
# If not specified, the module will use the default for your OS distro.
110+
#
25111
# @param pidfilemode
112+
# The file mode of the pid file
113+
#
26114
# @param manage_pidfile
115+
# If true, the pidfile will be managed by puppet
27116
#
28117
class mongodb::globals (
29118
$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,

manifests/mongos/install.pp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
# @summary Manages the mongos package
2-
#
31
# @api private
42
#
3+
# @summary Installs mongos
4+
#
55
# @param package_ensure
6+
# This setting can be used to specify if puppet should install the package or not
7+
#
68
# @param package_name
9+
# This setting can be used to specify the name of the package that should be installed.
10+
# If not specified, the module will use whatever service name is the default for your OS distro.
711
#
812
class mongodb::mongos::install (
913
$package_ensure = $mongodb::mongos::package_ensure,

0 commit comments

Comments
 (0)