forked from gchef/mongodb-cookbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetadata.rb
278 lines (213 loc) · 8.79 KB
/
metadata.rb
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
maintainer "Paper Cavalier"
maintainer_email "[email protected]"
license "Apache 2.0"
description "Installs and configures MongoDB 1.6.2"
version "0.2.3"
recipe "mongodb::source", "Installs MongoDB from source and includes init.d script"
recipe "mongodb::backup", "Sets up MongoDB backup script, taken from http://github.com/micahwedemeyer/automongobackup"
%w{ ubuntu debian }.each do |os|
supports os
end
depends "build-essential"
# Package info
attribute "mongodb/version",
:display_name => "MongoDB version",
:description => "Which MongoDB version will be installed",
:default => "1.6.2"
attribute "mongodb/source",
:display_name => "MongoDB source file",
:description => "Downloaded location for MongoDB"
attribute "mongodb/i686/checksum",
:display_name => "MongoDB 32bit source file checksum",
:description => "Will make sure the source file is the real deal",
:default => "3ce4485494806648404e1ee96c223ec6"
attribute "mongodb/x86_64/checksum",
:display_name => "MongoDB 64bit source file checksum",
:description => "Will make sure the source file is the real deal",
:default => "73df4aa4be049d733666cebf8f123b55"
# Paths & port
attribute "mongodb/dir",
:display_name => "MongoDB installation path",
:description => "MongoDB will be installed here",
:default => "/opt/mongodb-1.6.2"
attribute "mongodb/datadir",
:display_name => "MongoDB data store",
:description => "All MongoDB data will be stored here",
:default => "/var/db/mongodb"
attribute "mongodb/config",
:display_name => "MongoDB config",
:description => "Path to MongoDB config file",
:default => "/etc/mongo.conf"
attribute "mongodb/logfile",
:display_name => "MongoDB log file",
:description => "MongoDB will log into this file",
:default => "/var/log/mongodb.log"
attribute "mongodb/pidfile",
:display_name => "MongoDB PID file",
:description => "Path to MongoDB PID file",
:default => "/var/run/mongodb.pid"
attribute "mongodb/port",
:display_name => "MongoDB port",
:description => "Accept connections on the specified port",
:default => "27017"
# Logging, access & others
attribute "mongodb/log_cpu_io",
:display_name => "MongoDB CPU & I/O logging",
:description => "Enables periodic logging of CPU utilization and I/O wait",
:default => "false"
attribute "mongodb/auth",
:display_name => "MongoDB authentication",
:description => "Turn on/off security",
:default => "false"
attribute "mongodb/username",
:display_name => "MongoDB useranme",
:description => "If authentication is on, you might want to specify this for the db backups"
attribute "mongodb/password",
:display_name => "MongoDB password",
:description => "If authentication is on, you might want to specify this for the db backups"
attribute "mongodb/verbose",
:display_name => "MongoDB verbose",
:description => "Verbose logging output",
:default => "false"
attribute "mongodb/objcheck",
:display_name => "MongoDB objcheck",
:description => "Inspect all client data for validity on receipt (useful for developing drivers)",
:default => "false"
attribute "mongodb/quota",
:display_name => "MongoDB quota",
:description => "Enable db quota management",
:default => "false"
attribute "mongodb/diaglog",
:display_name => "MongoDB operations loggins",
:description => "Set oplogging level where n is 0=off (default) 1=W 2=R 3=both 7=W+some reads",
:default => "false"
attribute "mongodb/nocursors",
:display_name => "MongoDB nocursors",
:description => "Diagnostic/debugging option",
:default => "false"
attribute "mongodb/nohints",
:display_name => "MongoDB nohints",
:description => "Ignore query hints",
:default => "false"
attribute "mongodb/nohttp",
:display_name => "MongoDB nohttp",
:description => "Disable the HTTP interface (Defaults to localhost:27018)",
:default => "false"
attribute "mongodb/noscripting",
:display_name => "MongoDB noscripting",
:description => "Turns off server-side scripting. This will result in greatly limited functionality.",
:default => "false"
attribute "mongodb/notablescan",
:display_name => "MongoDB notablescan",
:description => "Turns off table scans. Any query that would do a table scan fails.",
:default => "false"
attribute "mongodb/noprealloc",
:display_name => "MongoDB noprealloc",
:description => "Disable data file preallocation",
:default => "false"
attribute "mongodb/nssize",
:display_name => "MongoDB nssize",
:description => "Specify .ns file size for new databases",
:default => "false"
# Daemon options
attribute "mongodb/rest",
:display_name => "MongoDB REST",
:description => "Enables REST interface for extra info on Http Interface",
:default => "false"
attribute "mongodb/syncdelay",
:display_name => "MongoDB syncdelay",
:description => "Controls how often changes are flushed to disk",
:default => "60"
# Monitoring
attribute "mongodb/mms",
:display_name => "MongoDB mms",
:description => "Enable when you have a Mongo monitoring server",
:default => "false"
attribute "mongodb/token",
:display_name => "MongoDB mms-token",
:description => "Accout token for Mongo monitoring server"
attribute "mongodb/name",
:display_name => "MongoDB mms-name",
:description => "Server name for Mongo monitoring server"
attribute "mongodb/interval",
:display_name => "MongoDB mms-interval",
:description => "Ping interval for Mongo monitoring server"
# Replication
attribute "mongodb/replication",
:display_name => "MongoDB replication",
:description => "Enable if you want to configure replication",
:default => "false"
attribute "mongodb/slave",
:display_name => "MongoDB replication slave",
:description => "In replicated mongo databases, specify here whether this is a slave or master",
:default => "false"
attribute "mongodb/slave_source",
:display_name => "MongoDB replication slave source",
:description => "Source for replication"
attribute "mongodb/slave_only",
:display_name => "MongoDB replication slave only",
:description => "Slave only: specify a single database to replicate"
attribute "mongodb/master",
:display_name => "MongoDB replication master",
:description => "In replicated mongo databases, specify here whether this is a slave or master",
:default => "false"
attribute "mongodb/master_source",
:display_name => "MongoDB replication master source",
:description => "Source for replication"
attribute "mongodb/pairwith",
:display_name => "MongoDB replication pairwith",
:description => "Address of a server to pair with"
attribute "mongodb/arbiter",
:display_name => "MongoDB replication arbiter",
:description => "Address of arbiter server"
attribute "mongodb/autoresync",
:display_name => "MongoDB replication autoresync",
:description => "Automatically resync if slave data is stale",
:default => "false"
attribute "mongodb/oplogsize",
:display_name => "MongoDB replication oplogsize",
:description => "Custom size for replication operation log (in MB)",
:default => "0"
attribute "mongodb/opidmem",
:display_name => "MongoDB replication opidmem",
:description => "Custom size limit for in-memory storage of op ids (in MB)",
:default => "0"
# Backups
attribute "mongodb/backup/backupdir",
:display_name => "MongoDB backup directory",
:description => "Backup directory location",
:default => "/var/backups/mongodb"
attribute "mongodb/backup/day",
:display_name => "MongoDB backup day",
:description => "Which day do you want weekly backups? (1 to 7 where 1 is Monday)",
:default => "6"
attribute "mongodb/backup/compression",
:display_name => "MongoDB backup compression",
:description => "Choose Compression type. (gzip or bzip2)",
:default => "bzip2"
attribute "mongodb/backup/cleanup",
:display_name => "MongoDB backup cleanup",
:description => "Choose if the uncompressed folder should be deleted after compression has completed",
:default => "yes"
attribute "mongodb/backup/latest",
:display_name => "MongoDB backup latest",
:description => "Additionally keep a copy of the most recent backup in a seperate directory",
:default => "yes"
attribute "mongodb/backup/mailaddress",
:display_name => "MongoDB backup mail",
:description => "Email Address to send mail to after each backup",
:default => "false"
attribute "mongodb/backup/mailcontent",
:display_name => "MongoDB backup mailcontent",
:description => %{
What would you like to be mailed to you?
- log : send only log file
- files : send log file and sql files as attachments (see docs)
- stdout : will simply output the log to the screen if run manually
- quiet : Only send logs if an error occurs
}.strip,
:default => "stdout"
attribute "mongodb/backup/maxemailsize",
:display_name => "MongoDB backup max email size",
:description => "Set the maximum allowed email size in k. (4000 = approx 5MB email)",
:default => "4000"