Skip to content

Latest commit

 

History

History
2425 lines (1144 loc) · 53 KB

REFERENCE.md

File metadata and controls

2425 lines (1144 loc) · 53 KB

Reference

Table of Contents

Classes

Public Classes

Private Classes

  • mongodb::client::params
  • mongodb::repo::zypper: This is a repo class for zypper

Defined types

  • mongodb::db: == Class: mongodb::db Class for creating mongodb databases and users. == Parameters user - Database username. auth_mechanism - Authentic

Resource types

  • mongodb_conn_validator: Verify that a connection can be successfully established between a node and the mongodb server. Its primary use is as a precondition to prev
  • mongodb_database: Manage MongoDB databases.
  • mongodb_replset: Manage a MongoDB replicaSet
  • mongodb_shard: Manage a MongoDB Shard
  • mongodb_user: Manage a MongoDB user. This includes management of users password as well as privileges.

Functions

Classes

mongodb::client

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:

ensure

Data type: String[1]

Default value: $mongodb::client::params::package_ensure

package_name

Data type: String[1]

Default value: $mongodb::client::params::package_name

mongodb::globals

Class for setting cross-class global overrides. See README.md for more details.

Parameters

The following parameters are available in the mongodb::globals class:

server_package_name

Data type: Any

Default value: undef

client_package_name

Data type: Any

Default value: undef

mongod_service_manage

Data type: Any

Default value: undef

service_enable

Data type: Any

Default value: undef

service_ensure

Data type: Any

Default value: undef

service_name

Data type: Any

Default value: undef

service_provider

Data type: Any

Default value: undef

service_status

Data type: Any

Default value: undef

user

Data type: Any

Default value: undef

group

Data type: Any

Default value: undef

ipv6

Data type: Any

Default value: undef

bind_ip

Data type: Any

Default value: undef

version

Data type: Any

Default value:

fact('os.distro.codename') ? { # Debian 10 doesn't provide mongodb 3.6.
    'buster' => '4.4.8',
    default  => undef
manage_package_repo

Data type: Any

Default value:

fact('os.distro.codename') ? { # Debian 10 doesn't provide mongodb packages. So manage it!
    'buster' => true,
    default  => undef
manage_package

Data type: Any

Default value: undef

repo_proxy

Data type: Any

Default value: undef

proxy_username

Data type: Any

Default value: undef

proxy_password

Data type: Any

Default value: undef

repo_location

Data type: Any

Default value: undef

use_enterprise_repo

Data type: Any

Default value: undef

pidfilepath

Data type: Any

Default value: undef

pidfilemode

Data type: Any

Default value: undef

manage_pidfile

Data type: Any

Default value: undef

mongodb::mongos

This installs a Mongo Shard daemon. See README.md for more details.

Parameters

The following parameters are available in the mongodb::mongos class:

config

Data type: Stdlib::Absolutepath

Default value: $mongodb::mongos::params::config

config_content

Data type: Optional[String[1]]

Default value: $mongodb::mongos::params::config_content

config_template

Data type: Optional[String[1]]

Default value: $mongodb::mongos::params::config_template

configdb

Data type: Variant[String[1], Array[String[1]]]

Default value: $mongodb::mongos::params::configdb

config_data

Data type: Optional[Hash]

Default value: $mongodb::mongos::params::config_data

service_manage

Data type: Boolean

Default value: $mongodb::mongos::params::service_manage

service_provider

Data type: Optional[String]

Default value: $mongodb::mongos::params::service_provider

service_name

Data type: Optional[String]

Default value: $mongodb::mongos::params::service_name

service_template

Data type: Optional[String[1]]

Default value: $mongodb::mongos::params::service_template

service_enable

Data type: Boolean

Default value: $mongodb::mongos::params::service_enable

service_ensure

Data type: Stdlib::Ensure::Service

Default value: $mongodb::mongos::params::service_ensure

service_status

Data type: Optional[String]

Default value: $mongodb::mongos::params::service_status

package_ensure

Data type: Variant[Boolean, String]

Default value: $mongodb::mongos::params::package_ensure

package_name

Data type: String

Default value: $mongodb::mongos::params::package_name

unixsocketprefix

Data type: Optional[Stdlib::Absolutepath]

Default value: $mongodb::mongos::params::unixsocketprefix

pidfilepath

Data type: Optional[Stdlib::Absolutepath]

Default value: $mongodb::mongos::params::pidfilepath

logpath

Data type: Optional[Variant[Boolean, Stdlib::Absolutepath]]

Default value: $mongodb::mongos::params::logpath

fork

Data type: Optional[Boolean]

Default value: $mongodb::mongos::params::fork

bind_ip

Data type: Optional[Array[Stdlib::IP::Address]]

Default value: $mongodb::mongos::params::bind_ip

port

Data type: Optional[Stdlib::Port]

Default value: $mongodb::mongos::params::port

restart

Data type: Boolean

Default value: $mongodb::mongos::params::restart

mongodb::mongos::config

PRIVATE CLASS: do not call directly

Parameters

The following parameters are available in the mongodb::mongos::config class:

package_ensure

Data type: Any

Default value: $mongodb::mongos::package_ensure

config

Data type: Any

Default value: $mongodb::mongos::config

config_content

Data type: Any

Default value: $mongodb::mongos::config_content

config_template

Data type: Any

Default value: $mongodb::mongos::config_template

service_manage

Data type: Any

Default value: $mongodb::mongos::service_manage

configdb

Data type: Any

Default value: $mongodb::mongos::configdb

bind_ip

Data type: Any

Default value: $mongodb::mongos::bind_ip

port

Data type: Any

Default value: $mongodb::mongos::port

fork

Data type: Any

Default value: $mongodb::mongos::fork

pidfilepath

Data type: Any

Default value: $mongodb::mongos::pidfilepath

logpath

Data type: Any

Default value: $mongodb::mongos::logpath

unixsocketprefix

Data type: Any

Default value: $mongodb::mongos::unixsocketprefix

config_data

Data type: Any

Default value: $mongodb::mongos::config_data

mongodb::mongos::install

PRIVATE CLASS: do not call directly

Parameters

The following parameters are available in the mongodb::mongos::install class:

package_ensure

Data type: Any

Default value: $mongodb::mongos::package_ensure

package_name

Data type: Any

Default value: $mongodb::mongos::package_name

mongodb::mongos::params

PRIVATE CLASS: do not use directly

mongodb::mongos::service

PRIVATE CLASS: do not call directly

Parameters

The following parameters are available in the mongodb::mongos::service class:

package_ensure

Data type: Any

Default value: $mongodb::mongos::package_ensure

service_manage

Data type: Any

Default value: $mongodb::mongos::service_manage

service_name

Data type: Any

Default value: $mongodb::mongos::service_name

service_enable

Data type: Any

Default value: $mongodb::mongos::service_enable

service_ensure

Data type: Any

Default value: $mongodb::mongos::service_ensure

service_status

Data type: Any

Default value: $mongodb::mongos::service_status

service_provider

Data type: Any

Default value: $mongodb::mongos::service_provider

bind_ip

Data type: Any

Default value: $mongodb::mongos::bind_ip

port

Data type: Any

Default value: $mongodb::mongos::port

service_template

Data type: Any

Default value: $mongodb::mongos::service_template

mongodb::opsmanager

This installs Ops Manager

Parameters

The following parameters are available in the mongodb::opsmanager class:

user

Data type: String[1]

The user that owns the config file

Default value: 'mongodb-mms'

group

Data type: String[1]

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']

Default value: 'running'

package_name

Data type: String[1]

Default value: 'mongodb-mms'

package_ensure

Data type: String[1]

Default value: 'present'

service_enable

Data type: Boolean

Default value: true

service_manage

Data type: Boolean

Default value: true

service_name

Data type: String[1]

Default value: 'mongodb-mms'

download_url

Data type: Stdlib::Httpurl

Default value: 'https://downloads.mongodb.com/on-prem-mms/rpm/mongodb-mms-4.0.1.50101.20180801T1117Z-1.x86_64.rpm'

mongo_uri

Data type: String[1]

Default value: 'mongodb://127.0.0.1:27017'

client_certificate_mode

Data type: String[1]

Default value: 'None'

from_email_addr

Data type: String[1]

Default value: '[email protected]'

reply_to_email_addr

Data type: String[1]

Default value: '[email protected]'

admin_email_addr

Data type: String[1]

Default value: '[email protected]'

email_dao_class

Data type: String[1]

Default value: 'com.xgen.svc.core.dao.email.JavaEmailDao'

mail_transport

Data type: Enum['smtp','smtps']

Default value: 'smtp'

smtp_server_hostname

Data type: Stdlib::Host

Default value: 'smtp.example.com'

smtp_server_port

Data type: Stdlib::Port

Default value: 25

ssl

Data type: Boolean

Default value: false

ignore_ui_setup

Data type: Boolean

Default value: true

user_svc_class

Data type: Optional[String[1]]

Default value: undef

snapshot_interval

Data type: Optional[Integer]

Default value: undef

snapshot_interval_retention

Data type: Optional[Integer]

Default value: undef

snapshot_daily_retention

Data type: Optional[Integer]

Default value: undef

snapshot_weekly_retention

Data type: Optional[Integer]

Default value: undef

snapshot_monthly_retention

Data type: Optional[Integer]

Default value: undef

versions_directory

Data type: Optional[Integer]

Default value: undef

mongodb::params

PRIVATE CLASS: do not use directly

mongodb::replset

Wrapper class useful for hiera based deployments

Parameters

The following parameters are available in the mongodb::replset class:

sets

Data type: Any

Default value: undef

mongodb::repo

PRIVATE CLASS: do not use directly

Parameters

The following parameters are available in the mongodb::repo class:

ensure

Data type: Variant[Enum['present', 'absent'], Boolean]

Default value: 'present'

version

Data type: Optional[String]

Default value: undef

use_enterprise_repo

Data type: Boolean

Default value: false

repo_location

Data type: Optional[String]

Default value: undef

proxy

Data type: Optional[String]

Default value: undef

proxy_username

Data type: Optional[String]

Default value: undef

proxy_password

Data type: Optional[String]

Default value: undef

aptkey_options

Data type: Optional[String[1]]

Default value: undef

mongodb::repo::apt

PRIVATE CLASS: do not use directly

mongodb::repo::yum

PRIVATE CLASS: do not use directly

mongodb::server

This installs a MongoDB server. See README.md for more details.

Parameters

The following parameters are available in the mongodb::server class:

tls

Data type: Boolean

Ensure tls is enabled.

Default value: false

tls_key

Data type: Optional[Stdlib::Absolutepath]

Defines the path of the file that contains the TLS/SSL certificate and key.

Default value: undef

tls_ca

Data type: Optional[Stdlib::Absolutepath]

Defines the path of the file that contains the certificate chain for verifying client certificates.

Default value: undef

tls_conn_without_cert

Data type: Boolean

Set to true to bypass client certificate validation for clients that do not present a certificate.

Default value: false

tls_invalid_hostnames

Data type: Boolean

Set to true to disable the validation of the hostnames in TLS certificates.

Default value: false

tls_mode

Data type: Enum['requireTLS', 'preferTLS', 'allowTLS']

Defines if TLS is used for all network connections. Allowed values are 'requireTLS', 'preferTLS' or 'allowTLS'.

Default value: 'requireTLS'

ensure

Data type: Variant[Boolean, String]

Default value: $mongodb::params::ensure

user

Data type: String

Default value: $mongodb::params::user

group

Data type: String

Default value: $mongodb::params::group

config

Data type: Stdlib::Absolutepath

Default value: $mongodb::params::config

dbpath

Data type: Stdlib::Absolutepath

Default value: $mongodb::params::dbpath

dbpath_fix

Data type: Boolean

Default value: $mongodb::params::dbpath_fix

pidfilepath

Data type: Optional[Stdlib::Absolutepath]

Default value: $mongodb::params::pidfilepath

pidfilemode

Data type: String

Default value: $mongodb::params::pidfilemode

manage_pidfile

Data type: Boolean

Default value: $mongodb::params::manage_pidfile

rcfile

Data type: String

Default value: $mongodb::params::rcfile

service_manage

Data type: Boolean

Default value: $mongodb::params::service_manage

service_provider

Data type: Optional[String]

Default value: $mongodb::params::service_provider

service_name

Data type: Optional[String]

Default value: $mongodb::params::service_name

service_enable

Data type: Boolean

Default value: $mongodb::params::service_enable

service_ensure

Data type: Enum['stopped', 'running']

Default value: $mongodb::params::service_ensure

service_status

Data type: Optional[Enum['stopped', 'running']]

Default value: $mongodb::params::service_status

package_ensure

Data type: Variant[Boolean, String]

Default value: $mongodb::params::package_ensure

package_name

Data type: String

Default value: $mongodb::params::server_package_name

mongosh_package_name

Data type: String

Default value: $mongodb::params::mongosh_package_name

logpath

Data type: Variant[Boolean, Stdlib::Absolutepath]

Default value: $mongodb::params::logpath

bind_ip

Data type: Array[Stdlib::IP::Address]

Default value: $mongodb::params::bind_ip

ipv6

Data type: Optional[Boolean]

Default value: undef

logappend

Data type: Boolean

Default value: true

system_logrotate

Data type: Optional[String]

Default value: undef

fork

Data type: Optional[Boolean]

Default value: $mongodb::params::fork

port

Data type: Optional[Integer[1, 65535]]

Default value: undef

journal

Data type: Optional[Boolean]

Default value: $mongodb::params::journal

nojournal

Data type: Optional[Boolean]

Default value: undef

smallfiles

Data type: Optional[Boolean]

Default value: undef

cpu

Data type: Optional[Boolean]

Default value: undef

auth

Data type: Boolean

Default value: false

noauth

Data type: Optional[Boolean]

Default value: undef

verbose

Data type: Optional[Boolean]

Default value: undef

verbositylevel

Data type: Optional[String]

Default value: undef

objcheck

Data type: Optional[Boolean]

Default value: undef

quota

Data type: Optional[Boolean]

Default value: undef

quotafiles

Data type: Optional[Integer]

Default value: undef

diaglog

Data type: Optional[Integer[0, 7]]

Default value: undef

directoryperdb

Data type: Optional[Boolean]

Default value: undef

profile

Data type: Any

Default value: undef

maxconns

Data type: Optional[Integer]

Default value: undef

oplog_size

Data type: Optional[Integer]

Default value: undef

nohints

Data type: Any

Default value: undef

nohttpinterface

Data type: Optional[Boolean]

Default value: undef

noscripting

Data type: Optional[Boolean]

Default value: undef

notablescan

Data type: Optional[Boolean]

Default value: undef

noprealloc

Data type: Optional[Boolean]

Default value: undef

nssize

Data type: Optional[Integer]

Default value: undef

mms_token

Data type: Any

Default value: undef

mms_name

Data type: Any

Default value: undef

mms_interval

Data type: Any

Default value: undef

replset

Data type: Optional[String]

Default value: undef

replset_config

Data type: Optional[Hash]

Default value: undef

replset_members

Data type: Optional[Array]

Default value: undef

configsvr

Data type: Optional[Boolean]

Default value: undef

shardsvr

Data type: Optional[Boolean]

Default value: undef

rest

Data type: Optional[Boolean]

Default value: undef

quiet

Data type: Optional[Boolean]

Default value: undef

slowms

Data type: Optional[Integer]

Default value: undef

keyfile

Data type: Optional[Stdlib::Absolutepath]

Default value: undef

key

Data type: Optional[Variant[String[6], Sensitive[String[6]]]]

Default value: undef

set_parameter

Data type: Optional[Variant[String[1], Array[String[1]]]]

Default value: undef

syslog

Data type: Optional[Boolean]

Default value: undef

config_content

Data type: Any

Default value: undef

config_template

Data type: Optional[String]

Default value: undef

config_data

Data type: Optional[Hash]

Default value: undef

ssl

Data type: Optional[Boolean]

Default value: undef

ssl_key

Data type: Optional[Stdlib::Absolutepath]

Default value: undef

ssl_ca

Data type: Optional[Stdlib::Absolutepath]

Default value: undef

ssl_weak_cert

Data type: Boolean

Default value: false

ssl_invalid_hostnames

Data type: Boolean

Default value: false

ssl_mode

Data type: Enum['requireSSL', 'preferSSL', 'allowSSL']

Default value: 'requireSSL'

restart

Data type: Boolean

Default value: $mongodb::params::restart

storage_engine

Data type: Optional[String]

Default value: undef

create_admin

Data type: Boolean

Default value: $mongodb::params::create_admin

admin_username

Data type: String

Default value: $mongodb::params::admin_username

admin_password

Data type: Optional[Variant[String, Sensitive[String]]]

Default value: undef

admin_auth_mechanism

Data type: Enum['scram_sha_1', 'scram_sha_256']

Default value: $mongodb::params::admin_auth_mechanism

admin_update_password

Data type: Boolean

Default value: false

handle_creds

Data type: Boolean

Default value: $mongodb::params::handle_creds

store_creds

Data type: Boolean

Default value: $mongodb::params::store_creds

admin_roles

Data type: Array

Default value: $mongodb::params::admin_roles

mongodb::server::config

PRIVATE CLASS: do not call directly

mongodb::server::install

PRIVATE CLASS: do not call directly

mongodb::server::service

PRIVATE CLASS: do not call directly

mongodb::shardsvr

Wrapper class useful for hiera based deployments

Parameters

The following parameters are available in the mongodb::shardsvr class:

shards

Data type: Any

Default value: undef

Defined types

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:

user

Data type: String

auth_mechanism

Data type: Enum['scram_sha_1', 'scram_sha_256']

Default value: 'scram_sha_1'

db_name

Data type: String

Default value: $name

password_hash

Data type: Optional[Variant[String[1], Sensitive[String[1]]]]

Default value: undef

password

Data type: Optional[Variant[String[1], Sensitive[String[1]]]]

Default value: undef

roles

Data type: Array[String]

Default value: ['dbAdmin']

tries

Data type: Integer[0]

Default value: 10

update_password

Data type: Boolean

Default value: false

Resource types

mongodb_conn_validator

Verify that a connection can be successfully established between a node and the mongodb server. Its primary use is as a precondition to prevent configuration changes from being applied if the mongodb server cannot be reached, but it could potentially be used for other purposes such as monitoring.

Properties

The following properties are available in the mongodb_conn_validator type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

Parameters

The following parameters are available in the mongodb_conn_validator type.

name

namevar

An arbitrary name used as the identity of the resource. It can also be the connection string to test (ie. 127.0.0.1:27017)

port

The port that the mongodb server should be listening on.

Default value: 27017

provider

The specific backend to use for this mongodb_conn_validator resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

server

An array containing DNS names or IP addresses of the server where mongodb should be running.

Default value: 127.0.0.1

timeout

The max number of seconds that the validator should wait before giving up and deciding that puppetdb is not running; defaults to 60 seconds.

Default value: 60

mongodb_database

Manage MongoDB databases.

Properties

The following properties are available in the mongodb_database type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

Parameters

The following parameters are available in the mongodb_database type.

name

Valid values: %r{^[\w-]+$}

namevar

The name of the database.

provider

The specific backend to use for this mongodb_database resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

tries

Valid values: %r{^\d+$}

The maximum amount of two second tries to wait MongoDB startup.

Default value: 10

mongodb_replset

Manage a MongoDB replicaSet

Properties

The following properties are available in the mongodb_replset type.

ensure

Valid values: present

The basic property that the resource should be in.

Default value: present

members

The replicaSet members config

settings

The replicaSet settings config

Parameters

The following parameters are available in the mongodb_replset type.

arbiter

The replicaSet arbiter

initialize_host

Host to use for Replicaset initialization

Default value: 127.0.0.1

name

namevar

The name of the replicaSet

provider

The specific backend to use for this mongodb_replset resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

mongodb_shard

Manage a MongoDB Shard

Properties

The following properties are available in the mongodb_shard type.

ensure

Valid values: present

The basic property that the resource should be in.

Default value: present

keys

The sharding keys

member

The shard member

Parameters

The following parameters are available in the mongodb_shard type.

name

namevar

The name of the shard

provider

The specific backend to use for this mongodb_shard resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

mongodb_user

Manage a MongoDB user. This includes management of users password as well as privileges.

Properties

The following properties are available in the mongodb_user type.

database

Valid values: %r{^[\w-]+$}

The user's target database.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

password

The plaintext password of the user.

password_hash

Valid values: %r{^\w+$}

The password hash of the user. Use mongodb_password() for creating hash. Only available on MongoDB 3.0 and later. SCRAM-SHA-256 authentication mechanism is not supported.

roles

Valid values: %r{^\w+(@\w+)?$}

The user's roles.

Default value: ['dbAdmin']

scram_credentials

The SCRAM-SHA-1 credentials of a user. These are read only and change when password or password_hash changes.

username

The name of the user.

Parameters

The following parameters are available in the mongodb_user type.

auth_mechanism

Valid values: scram_sha_256, scram_sha_1

Authentication mechanism. Password verification is not supported with SCRAM-SHA-256.

Default value: scram_sha_1

name

namevar

The name of the resource.

provider

The specific backend to use for this mongodb_user resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

tries

Valid values: %r{^\d+$}

The maximum amount of two second tries to wait MongoDB startup.

Default value: 10

update_password

Update password. Used with SCRAM-SHA-256 because password verification is not supported.

Default value: false

Functions

mongodb_password

Type: Ruby 4.x API

Get the mongodb password hash from the clear text password.

mongodb_password(String[1] $username, Variant[String[1], Sensitive[String[1]]] $password, Optional[Boolean] $sensitive)

Get the mongodb password hash from the clear text password.

Returns: Variant[String, Sensitive[String]]

username

Data type: String[1]

password

Data type: Variant[String[1], Sensitive[String[1]]]

sensitive

Data type: Optional[Boolean]