-
-
Notifications
You must be signed in to change notification settings - Fork 299
/
default.rb
171 lines (159 loc) · 6.55 KB
/
default.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
package_bin_path = '/usr/bin'
config_dir = '/etc/redis'
default_package_install = false
case node['platform_family']
when 'debian'
shell = '/bin/false'
homedir = '/var/lib/redis'
package_name = 'redis-server'
when 'rhel', 'fedora'
shell = '/bin/sh'
homedir = '/var/lib/redis'
package_name = 'redis'
when 'freebsd'
shell = '/bin/sh'
homedir = '/var/lib/redis'
package_name = 'redis'
package_bin_path = '/usr/local/bin'
config_dir = '/usr/local/etc/redis'
default_package_install = true
else
shell = '/bin/sh'
homedir = '/redis'
package_name = 'redis'
end
# Overwite template used for the Redis Server config (not sentinel)
default['redisio']['redis_config']['template_cookbook'] = 'redisio'
default['redisio']['redis_config']['template_source'] = 'redis.conf.erb'
# Install related attributes
default['redisio']['safe_install'] = true
default['redisio']['package_install'] = default_package_install
default['redisio']['package_name'] = package_name
default['redisio']['bypass_setup'] = false
# Tarball and download related defaults
default['redisio']['mirror'] = 'http://download.redis.io/releases/'
default['redisio']['base_name'] = 'redis-'
default['redisio']['artifact_type'] = 'tar.gz'
default['redisio']['base_piddir'] = '/var/run/redis'
# Version
default['redisio']['version'] = if node['redisio']['package_install']
# latest version (only for package install)
nil
else
# force version for tarball
'3.2.11'
end
# Custom installation directory
default['redisio']['install_dir'] = nil
# Job control related options (initd, upstart, or systemd)
default['redisio']['job_control'] = if systemd?
'systemd'
elsif platform_family?('freebsd')
'rcinit'
else
'initd'
end
# Init.d script related options
default['redisio']['init.d']['required_start'] = []
default['redisio']['init.d']['required_stop'] = []
# Default settings for all redis instances, these can be overridden on a per server basis in the 'servers' hash
default['redisio']['default_settings'] = {
'user' => 'redis',
'group' => 'redis',
'permissions' => '0644',
'homedir' => homedir,
'shell' => shell,
'systemuser' => true,
'uid' => nil,
'ulimit' => 0,
'configdir' => config_dir,
'name' => nil,
'tcpbacklog' => '511',
'address' => nil,
'databases' => '16',
'backuptype' => 'rdb',
'datadir' => '/var/lib/redis',
'unixsocket' => nil,
'unixsocketperm' => nil,
'timeout' => '0',
'keepalive' => '0',
'loglevel' => 'notice',
'logfile' => nil,
'syslogenabled' => 'yes',
'syslogfacility' => 'local0',
'shutdown_save' => false,
'save' => nil, # Defaults to ['900 1','300 10','60 10000'] inside of template. Needed due to lack of hash subtraction
'stopwritesonbgsaveerror' => 'yes',
'rdbcompression' => 'yes',
'rdbchecksum' => 'yes',
'dbfilename' => nil,
'slaveof' => nil,
'protected_mode' => nil, # unspecified by default but could be set explicitly to 'yes' or 'no'
'masterauth' => nil,
'slaveservestaledata' => 'yes',
'slavereadonly' => 'yes',
'repldisklesssync' => 'no',
'repldisklesssyncdelay' => '5',
'replpingslaveperiod' => '10',
'repltimeout' => '60',
'repldisabletcpnodelay' => 'no',
'replbacklogsize' => '1mb',
'replbacklogttl' => 3600,
'slavepriority' => '100',
'requirepass' => nil,
'rename_commands' => nil,
'maxclients' => 10000,
'maxmemory' => nil,
'maxmemorypolicy' => nil,
'maxmemorysamples' => nil,
'appendfilename' => nil,
'appendfsync' => 'everysec',
'noappendfsynconrewrite' => 'no',
'aofrewritepercentage' => '100',
'aofrewriteminsize' => '64mb',
'aofloadtruncated' => 'yes',
'luatimelimit' => '5000',
'slowloglogslowerthan' => '10000',
'slowlogmaxlen' => '1024',
'notifykeyspaceevents' => '',
'hashmaxziplistentries' => '512',
'hashmaxziplistvalue' => '64',
'listmaxziplistentries' => '512',
'listmaxziplistvalue' => '64',
'setmaxintsetentries' => '512',
'zsetmaxziplistentries' => '128',
'zsetmaxziplistvalue' => '64',
'hllsparsemaxbytes' => '3000',
'activerehasing' => 'yes',
'clientoutputbufferlimit' => [
%w(normal 0 0 0),
%w(slave 256mb 64mb 60),
%w(pubsub 32mb 8mb 60),
],
'hz' => '10',
'aofrewriteincrementalfsync' => 'yes',
'clusterenabled' => 'no',
'clusterconfigfile' => nil, # Defaults to redis instance name inside of template if cluster is enabled.
'clusternodetimeout' => 5000,
'includes' => nil,
'data_bag_name' => nil,
'data_bag_item' => nil,
'data_bag_key' => nil,
'minslavestowrite' => nil,
'minslavesmaxlag' => nil,
'breadcrumb' => true,
}
# The default for this is set inside of the "install" recipe. This is due to the way deep merge handles arrays
default['redisio']['servers'] = nil
# Define binary path
default['redisio']['bin_path'] = if node['redisio']['package_install']
package_bin_path
else
'/usr/local/bin'
end
# Ulimit
default['ulimit']['pam_su_template_cookbook'] = nil
default['ulimit']['users'] = Mash.new
default['ulimit']['security_limits_directory'] = '/etc/security/limits.d'
default['ulimit']['ulimit_overriding_sudo_file_name'] = 'sudo'
default['ulimit']['ulimit_overriding_sudo_file_cookbook'] = nil