forked from voxpupuli/puppet-mongodb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobals.pp
More file actions
109 lines (108 loc) · 3.68 KB
/
globals.pp
File metadata and controls
109 lines (108 loc) · 3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# @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 => '6.0',
# }
# -> 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 => '6.0',
# use_enterprise_repo => true,
# }
# -> class {'mongodb::client': }
# -> class {'mongodb::server': }
#
# @example Use a custom MongoDB apt repository.
#
# class {'mongodb::globals':
# manage_package_repo => true,
# repo_location => 'https://example.com/repo',
# keyring_location => 'https://example.com/keyring.asc'
# }
# -> class {'mongodb::client': }
# -> class {'mongodb::server': }
#
# @example To disable managing of repository, but still enable managing packages.
#
# class {'mongodb::globals':
# manage_package_repo => false,
# }
# -> class {'mongodb::server': }
# -> class {'mongodb::client': }
#
# @param version
# The version of MonogDB to install/manage.
# If not specified, the module will ensure packages with `present`.
#
# @param client_version
# The version of MongoDB Shell to install/manage.
# If not specified, the module will ensure packages with `present`.
#
# @param manage_package_repo
# Whether to manage MongoDB software repository.
#
# @param repo_version
# The version of the package repo.
# If not specified, the module will default to the latest supported version for your OS distro.
# When `repo_location` is specified `repo_version` is ignored.
#
# @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 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 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 keyring_location
# When `repo_location` is used for an apt repository this setting can be used for the keyring
# file to download.
#
# @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
#
class mongodb::globals (
String[1] $repo_version,
Optional[String[1]] $version = undef,
Optional[String[1]] $client_version = undef,
Boolean $manage_package_repo = true,
Boolean $use_enterprise_repo = false,
Optional[String] $repo_location = undef,
Optional[String] $keyring_location = undef,
Optional[String] $repo_proxy = undef,
Optional[String] $proxy_username = undef,
Optional[String] $proxy_password = undef,
) {
if $use_enterprise_repo {
$edition = 'enterprise'
} else {
$edition = 'org'
}
# Setup of the repo only makes sense globally, so we are doing it here.
if $manage_package_repo {
class { 'mongodb::repo':
ensure => present,
version => $repo_version,
use_enterprise_repo => $use_enterprise_repo,
repo_location => $repo_location,
keyring_location => $keyring_location,
proxy => $repo_proxy,
proxy_username => $proxy_username,
proxy_password => $proxy_password,
}
}
}