From 91a9a6deba376dbfbabd91dcfb4aea7ee64f230c Mon Sep 17 00:00:00 2001 From: markuszilch Date: Fri, 26 Jan 2024 14:07:58 +0100 Subject: [PATCH] add docs, doc stubs and descriptions to fix validate warnings --- REFERENCE.md | 136 +++++++++------------- lib/puppet/type/mongodb_conn_validator.rb | 1 + lib/puppet/type/mongodb_replset.rb | 1 + lib/puppet/type/mongodb_shard.rb | 1 + manifests/client.pp | 12 +- manifests/db.pp | 30 ++--- manifests/globals.pp | 28 ++++- manifests/mongos.pp | 25 +++- manifests/mongos/config.pp | 17 ++- manifests/mongos/install.pp | 6 +- manifests/mongos/service.pp | 14 ++- manifests/opsmanager.pp | 35 ++++-- manifests/replset.pp | 5 +- manifests/repo.pp | 13 +++ manifests/shardsvr.pp | 5 +- 15 files changed, 211 insertions(+), 118 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 0240909a4..2f05fb709 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -8,7 +8,7 @@ #### Public Classes -* [`mongodb::client`](#mongodb--client): Class for installing a MongoDB client shell (CLI). == Parameters $ensure:: Desired ensure state of the package. $package_name:: Name of th +* [`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::mongos::config`](#mongodb--mongos--config): PRIVATE CLASS: do not call directly @@ -34,7 +34,7 @@ ### Defined types -* [`mongodb::db`](#mongodb--db): == Class: mongodb::db Class for creating mongodb databases and users. == Parameters user - Database username. auth_mechanism - Authentic +* [`mongodb::db`](#mongodb--db): Class for creating mongodb databases and users. ### Resource types @@ -54,13 +54,6 @@ Class for installing a MongoDB client shell (CLI). -== Parameters - -$ensure:: Desired ensure state of the package. - -$package_name:: Name of the package to install the client from. Default is - repository dependent. - #### Parameters The following parameters are available in the `mongodb::client` class: @@ -72,7 +65,7 @@ The following parameters are available in the `mongodb::client` class: Data type: `String[1]` - +Desired ensure state of the package. Default value: `$mongodb::client::params::package_ensure` @@ -80,14 +73,13 @@ Default value: `$mongodb::client::params::package_ensure` Data type: `String[1]` - +Name of the package to install the client from. Default is repository dependent. 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. See README.md for more details. #### Parameters @@ -777,11 +769,6 @@ The following parameters are available in the `mongodb::opsmanager` class: * [`user`](#-mongodb--opsmanager--user) * [`group`](#-mongodb--opsmanager--group) -* [`opsmanager_url`](#-mongodb--opsmanager--opsmanager_url) -* [`opsmanager_mongo_uri`](#-mongodb--opsmanager--opsmanager_mongo_uri) -* [`ca_file`](#-mongodb--opsmanager--ca_file) -* [`pem_key_file`](#-mongodb--opsmanager--pem_key_file) -* [`pem_key_password`](#-mongodb--opsmanager--pem_key_password) * [`ensure`](#-mongodb--opsmanager--ensure) * [`package_name`](#-mongodb--opsmanager--package_name) * [`package_ensure`](#-mongodb--opsmanager--package_ensure) @@ -790,6 +777,7 @@ The following parameters are available in the `mongodb::opsmanager` class: * [`service_name`](#-mongodb--opsmanager--service_name) * [`download_url`](#-mongodb--opsmanager--download_url) * [`mongo_uri`](#-mongodb--opsmanager--mongo_uri) +* [`opsmanager_url`](#-mongodb--opsmanager--opsmanager_url) * [`client_certificate_mode`](#-mongodb--opsmanager--client_certificate_mode) * [`from_email_addr`](#-mongodb--opsmanager--from_email_addr) * [`reply_to_email_addr`](#-mongodb--opsmanager--reply_to_email_addr) @@ -800,6 +788,9 @@ The following parameters are available in the `mongodb::opsmanager` class: * [`smtp_server_port`](#-mongodb--opsmanager--smtp_server_port) * [`ssl`](#-mongodb--opsmanager--ssl) * [`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) @@ -824,42 +815,6 @@ The group that owns the config file Default value: `'mongodb-mms'` -##### `opsmanager_url` - -Data type: `Stdlib::Httpurl` - -The fully qualified url where opsmanager runs. Must include the port. - -Default value: `"http://${facts['networking']['fqdn']}:8080"` - -##### `opsmanager_mongo_uri` - -Full URI where the Ops Manager application mongodb server(s) can be found. - -##### `ca_file` - -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` - ##### `ensure` Data type: `Enum['running', 'stopped']` @@ -924,6 +879,14 @@ Data type: `String[1]` Default value: `'mongodb://127.0.0.1:27017'` +##### `opsmanager_url` + +Data type: `Stdlib::Httpurl` + +The fully qualified url where opsmanager runs. Must include the port. + +Default value: `"http://${facts['networking']['fqdn']}:8080"` + ##### `client_certificate_mode` Data type: `String[1]` @@ -1004,6 +967,30 @@ Data type: `Boolean` Default value: `true` +##### `ca_file` + +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` Data type: `Optional[String[1]]` @@ -1111,7 +1098,7 @@ Default value: `'present'` Data type: `Optional[String]` - +Optional repo version string. Default value: `undef` @@ -1119,7 +1106,7 @@ Default value: `undef` Data type: `Boolean` - +Boolean value to use enterprise repository. Defaults to false. Default value: `false` @@ -1127,7 +1114,7 @@ Default value: `false` Data type: `Optional[String]` - +Optional location of the repository Default value: `undef` @@ -2006,21 +1993,8 @@ Default value: `undef` ### `mongodb::db` -== Class: mongodb::db - Class for creating mongodb databases and users. -== Parameters - - user - Database username. - auth_mechanism - Authentication mechanism. scram_sha_256 password verification is not supported. Defaults to 'scram_sha_1'. - db_name - Database name. Defaults to $name. - password_hash - Hashed password. Hex encoded md5 hash of "$username:mongo:$password". - password - Plain text user password. This is UNSAFE, use 'password_hash' instead. - roles (default: ['dbAdmin']) - array with user roles. - tries (default: 10) - The maximum amount of two second tries to wait MongoDB startup. - update_password (default: false) - Force an update of the password when scram_sha_256 is used. - #### Parameters The following parameters are available in the `mongodb::db` defined type: @@ -2038,13 +2012,13 @@ The following parameters are available in the `mongodb::db` defined type: Data type: `String` - +Database username. ##### `auth_mechanism` Data type: `Enum['scram_sha_1', 'scram_sha_256']` - +Authentication mechanism. scram_sha_256 password verification is not supported. Defaults to 'scram_sha_1'. Default value: `'scram_sha_1'` @@ -2052,7 +2026,7 @@ Default value: `'scram_sha_1'` Data type: `String` - +Database name. Defaults to $name. Default value: `$name` @@ -2060,7 +2034,7 @@ Default value: `$name` Data type: `Optional[Variant[String[1], Sensitive[String[1]]]]` - +Hashed password. Hex encoded md5 hash of "$username:mongo:$password". Default value: `undef` @@ -2068,7 +2042,7 @@ Default value: `undef` Data type: `Optional[Variant[String[1], Sensitive[String[1]]]]` - +Plain text user password. This is UNSAFE, use 'password_hash' instead. Default value: `undef` @@ -2076,7 +2050,7 @@ Default value: `undef` Data type: `Array[String]` - +Array with user roles. Deaults to ['dbAdmin'] Default value: `['dbAdmin']` @@ -2084,7 +2058,7 @@ Default value: `['dbAdmin']` Data type: `Integer[0]` - +The maximum amount of two second tries to wait MongoDB startup. Defaults to 10. Default value: `10` @@ -2092,7 +2066,7 @@ Default value: `10` Data type: `Boolean` - +Force an update of the password when scram_sha_256 is used. Defaults to false. Default value: `false` @@ -2114,7 +2088,7 @@ The following properties are available in the `mongodb_conn_validator` type. Valid values: `present`, `absent` -The basic property that the resource should be in. +Ensurable property Default value: `present` @@ -2216,7 +2190,7 @@ The following properties are available in the `mongodb_replset` type. Valid values: `present` -The basic property that the resource should be in. +Ensurable property Default value: `present` @@ -2270,7 +2244,7 @@ The following properties are available in the `mongodb_shard` type. Valid values: `present` -The basic property that the resource should be in. +Ensurable property Default value: `present` diff --git a/lib/puppet/type/mongodb_conn_validator.rb b/lib/puppet/type/mongodb_conn_validator.rb index 5f9095610..672e58e25 100644 --- a/lib/puppet/type/mongodb_conn_validator.rb +++ b/lib/puppet/type/mongodb_conn_validator.rb @@ -8,6 +8,7 @@ purposes such as monitoring." ensurable do + desc 'Ensurable property' defaultvalues defaultto :present end diff --git a/lib/puppet/type/mongodb_replset.rb b/lib/puppet/type/mongodb_replset.rb index aa600b564..3fdcbe0c4 100644 --- a/lib/puppet/type/mongodb_replset.rb +++ b/lib/puppet/type/mongodb_replset.rb @@ -8,6 +8,7 @@ @doc = 'Manage a MongoDB replicaSet' ensurable do + desc 'Ensurable property' defaultto :present newvalue(:present) do diff --git a/lib/puppet/type/mongodb_shard.rb b/lib/puppet/type/mongodb_shard.rb index c1cba0e11..e9ad7955a 100644 --- a/lib/puppet/type/mongodb_shard.rb +++ b/lib/puppet/type/mongodb_shard.rb @@ -8,6 +8,7 @@ @doc = 'Manage a MongoDB Shard' ensurable do + desc 'Ensurable property' defaultto :present newvalue(:present) do diff --git a/manifests/client.pp b/manifests/client.pp index 9c5778d13..817584d97 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -1,11 +1,9 @@ -# Class for installing a MongoDB client shell (CLI). +# @summary Class for installing a MongoDB client shell (CLI). # -# == Parameters -# -# $ensure:: Desired ensure state of the package. -# -# $package_name:: Name of the package to install the client from. Default is -# repository dependent. +# @param ensure +# Desired ensure state of the package. +# @param package_name +# Name of the package to install the client from. Default is repository dependent. # class mongodb::client ( String[1] $ensure = $mongodb::client::params::package_ensure, diff --git a/manifests/db.pp b/manifests/db.pp index e89e5980d..3d20b9864 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -1,17 +1,21 @@ -# == Class: mongodb::db +# @summary Class for creating mongodb databases and users. # -# Class for creating mongodb databases and users. -# -# == Parameters -# -# user - Database username. -# auth_mechanism - Authentication mechanism. scram_sha_256 password verification is not supported. Defaults to 'scram_sha_1'. -# db_name - Database name. Defaults to $name. -# password_hash - Hashed password. Hex encoded md5 hash of "$username:mongo:$password". -# password - Plain text user password. This is UNSAFE, use 'password_hash' instead. -# roles (default: ['dbAdmin']) - array with user roles. -# tries (default: 10) - The maximum amount of two second tries to wait MongoDB startup. -# update_password (default: false) - Force an update of the password when scram_sha_256 is used. +# @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. # define mongodb::db ( String $user, diff --git a/manifests/globals.pp b/manifests/globals.pp index 81dd33e0c..d1f823e23 100644 --- a/manifests/globals.pp +++ b/manifests/globals.pp @@ -1,5 +1,29 @@ -# Class for setting cross-class global overrides. See README.md for more -# details. +# @summary Class for setting cross-class global overrides. See README.md for more details. +# +# @param server_package_name +# @param client_package_name +# @param mongod_service_manage +# @param service_enable +# @param service_ensure +# @param service_name +# @param service_provider +# @param service_status +# @param user +# @param group +# @param ipv6 +# @param bind_ip +# @param version +# @param manage_package_repo +# @param manage_package +# @param repo_proxy +# @param proxy_username +# @param proxy_password +# @param repo_location +# @param use_enterprise_repo +# @param pidfilepath +# @param pidfilemode +# @param manage_pidfile +# class mongodb::globals ( $server_package_name = undef, $client_package_name = undef, diff --git a/manifests/mongos.pp b/manifests/mongos.pp index f73a634ca..1d2724576 100644 --- a/manifests/mongos.pp +++ b/manifests/mongos.pp @@ -1,4 +1,27 @@ -# This installs a Mongo Shard daemon. See README.md for more details. +# @summary This installs a Mongo Shard daemon. See README.md for more details. +# +# @param config +# @param config_content +# @param config_template +# @param configdb +# @param config_data +# @param service_manage +# @param service_provider +# @param service_name +# @param service_template +# @param service_enable +# @param service_ensure +# @param service_status +# @param package_ensure +# @param package_name +# @param unixsocketprefix +# @param pidfilepath +# @param logpath +# @param fork +# @param bind_ip +# @param port +# @param restart +# class mongodb::mongos ( Stdlib::Absolutepath $config = $mongodb::mongos::params::config, Optional[String[1]] $config_content = $mongodb::mongos::params::config_content, diff --git a/manifests/mongos/config.pp b/manifests/mongos/config.pp index cff260155..1824202a2 100644 --- a/manifests/mongos/config.pp +++ b/manifests/mongos/config.pp @@ -1,4 +1,19 @@ -# PRIVATE CLASS: do not call directly +# @summary PRIVATE CLASS: do not call directly +# +# @param package_ensure +# @param config +# @param config_content +# @param config_template +# @param service_manage +# @param configdb +# @param bind_ip +# @param port +# @param fork +# @param pidfilepath +# @param logpath +# @param unixsocketprefix +# @param config_data +# class mongodb::mongos::config ( $package_ensure = $mongodb::mongos::package_ensure, $config = $mongodb::mongos::config, diff --git a/manifests/mongos/install.pp b/manifests/mongos/install.pp index ac480db2f..1cf8de4f2 100644 --- a/manifests/mongos/install.pp +++ b/manifests/mongos/install.pp @@ -1,4 +1,8 @@ -# PRIVATE CLASS: do not call directly +# @summary PRIVATE CLASS: do not call directly +# +# @param package_ensure +# @param package_name +# class mongodb::mongos::install ( $package_ensure = $mongodb::mongos::package_ensure, $package_name = $mongodb::mongos::package_name, diff --git a/manifests/mongos/service.pp b/manifests/mongos/service.pp index 3dc2c13e7..99d80e548 100644 --- a/manifests/mongos/service.pp +++ b/manifests/mongos/service.pp @@ -1,4 +1,16 @@ -# PRIVATE CLASS: do not call directly +# @summary PRIVATE CLASS: do not call directly +# +# @param package_ensure +# @param service_manage +# @param service_name +# @param service_enable +# @param service_ensure +# @param service_status +# @param service_provider +# @param bind_ip +# @param port +# @param service_template +# class mongodb::mongos::service ( $package_ensure = $mongodb::mongos::package_ensure, $service_manage = $mongodb::mongos::service_manage, diff --git a/manifests/opsmanager.pp b/manifests/opsmanager.pp index 7844b5409..7ac1db000 100644 --- a/manifests/opsmanager.pp +++ b/manifests/opsmanager.pp @@ -1,25 +1,42 @@ -# This installs Ops Manager +# @summary This installs Ops Manager # # @param user # The user that owns the config file -# # @param group # The group that owns the config file -# +# @param ensure +# @param package_name +# @param package_ensure +# @param service_enable +# @param service_manage +# @param service_name +# @param download_url +# @param mongo_uri # @param opsmanager_url # The fully qualified url where opsmanager runs. Must include the port. -# -# @param opsmanager_mongo_uri -# Full URI where the Ops Manager application mongodb server(s) can be found. -# +# @param client_certificate_mode +# @param from_email_addr +# @param reply_to_email_addr +# @param admin_email_addr +# @param email_dao_class +# @param mail_transport +# @param smtp_server_hostname +# @param smtp_server_port +# @param ssl +# @param ignore_ui_setup # @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 +# @param snapshot_interval +# @param snapshot_interval_retention +# @param snapshot_daily_retention +# @param snapshot_weekly_retention +# @param snapshot_monthly_retention +# @param versions_directory # class mongodb::opsmanager ( String[1] $user = 'mongodb-mms', diff --git a/manifests/replset.pp b/manifests/replset.pp index c08fbb999..e95191858 100644 --- a/manifests/replset.pp +++ b/manifests/replset.pp @@ -1,4 +1,7 @@ -# Wrapper class useful for hiera based deployments +# @summary Wrapper class useful for hiera based deployments +# +# @param sets +# class mongodb::replset ( $sets = undef ) { diff --git a/manifests/repo.pp b/manifests/repo.pp index c6f52049d..4479235c8 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -1,4 +1,17 @@ # PRIVATE CLASS: do not use directly +# +# @param ensure +# @param version +# Optional repo version string. +# @param use_enterprise_repo +# Boolean value to use enterprise repository. Defaults to false. +# @param repo_location +# Optional location of the repository +# @param proxy +# @param proxy_username +# @param proxy_password +# @param aptkey_options +# class mongodb::repo ( Variant[Enum['present', 'absent'], Boolean] $ensure = 'present', Optional[String] $version = undef, diff --git a/manifests/shardsvr.pp b/manifests/shardsvr.pp index 19a214b20..486fe5fc7 100644 --- a/manifests/shardsvr.pp +++ b/manifests/shardsvr.pp @@ -1,4 +1,7 @@ -# Wrapper class useful for hiera based deployments +# @summary Wrapper class useful for hiera based deployments +# +# @param shards +# class mongodb::shardsvr ( $shards = undef ) {