You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixed formatting in all files (except the templates). Added a .gitignore to ignore unwanted system files. Fixed syntax formatting in the README. Removed old default file that got added as "git junk".
Copy file name to clipboardExpand all lines: README.md
+71-45
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
Description
2
2
===========
3
3
4
-
Website:: https://github.com/brianbianco/redisio
4
+
Website:: https://github.com/brianbianco/redisio
5
5
6
6
Installs and configures Redis server instances
7
7
8
8
Requirements
9
9
============
10
10
11
-
This cookbook builds redis from source, so it should work on any architecture for the supported distributions. Init scripts are installed into /etc/init.d/
11
+
This cookbook builds redis from source, so it should work on any architecture for the supported distributions. Init scripts are installed into /etc/init.d/
12
12
13
13
Platforms
14
14
---------
@@ -29,7 +29,7 @@ Usage
29
29
30
30
The redisio cookbook has 3 LWRP's and 4 recipes. For most use cases it isn't necessary to use the "install" LWRP and you should use the install recipe unless
31
31
you have a good understanding of the required fields for the install LWRP. The service LWRP can be more useful if you have situations where you want to start,
32
-
stop, or restart the redis service based on certain conditions.
32
+
stop, or restart the redis service based on certain conditions.
33
33
34
34
If all you are interested in is having redis started and running as well as set to run in the default run levels, I suggest just using the install recipe followed by the enable recipe and not using the LWRP directly.
35
35
@@ -42,16 +42,18 @@ Role File Examples
42
42
43
43
Install redis and setup an instance with default settings on default port, and start the service through a role file
44
44
45
+
```ruby
45
46
run_list *%w[
46
47
recipe[redisio::install]
47
48
recipe[redisio::enable]
48
49
]
49
50
50
-
default_attributes({
51
-
})
51
+
default_attributes({})
52
+
```
52
53
53
54
Install redis and setup two instances on the same server, on different ports, with one slaved to the other through a role file
Install redis and setup three instances on the same server, changing the default data directory to /mnt/redis, each instance will use a different backup type, and one instance will use a different data dir
It is important to note that this call has certain expectations for example, it expects the redis package to be in the format `redis-VERSION.tar.gz'. The servers resource expects an array of hashes where each hash is required to contain at a key-value pair of 'port' => '<port numbers'.
'user' => 'redis' - the user to own the redis datadir
180
-
'group' => 'redis' - the group to own the redis datadir
181
-
'homedir' => '/var/lib/redis' - the homedirectory of the user
182
-
'shell' => Varies on distribution, check attributes file
183
-
'configdir' => '/etc/redis' - config directory
184
-
'homedir' => '/var/lib/redis', - home directory for the user
185
-
'address' => nil,
186
-
'backuptype' => 'rdb',
187
-
'datadir' => '/var/lib/redis',
188
-
'timeout' => '0',
189
-
'loglevel' => 'verbose',
190
-
'save' => ['900 1','300 10','60 10000'],
191
-
'slaveof' => nil,
192
-
'masterauth' => nil,
193
-
'requirepass' => nil,
194
-
'maxclients' => '0',
195
-
'maxmemory' => nil,
196
-
'maxmemorypolicy' => 'volatile-lru',
197
-
'appendfsync' => 'everysec',
198
-
'includes' => nil
196
+
197
+
```
198
+
'user' => 'redis' - the user to own the redis datadir
199
+
'group' => 'redis' - the group to own the redis datadir
200
+
'homedir' => '/var/lib/redis' - the homedirectory of the user
201
+
'shell' => Varies on distribution, check attributes file
202
+
'configdir' => '/etc/redis' - config directory
203
+
'homedir' => '/var/lib/redis', - home directory for the user
204
+
'address' => nil,
205
+
'backuptype' => 'rdb',
206
+
'datadir' => '/var/lib/redis',
207
+
'timeout' => '0',
208
+
'loglevel' => 'verbose',
209
+
'save' => ['900 1','300 10','60 10000'],
210
+
'slaveof' => nil,
211
+
'masterauth' => nil,
212
+
'requirepass' => nil,
213
+
'maxclients' => '0',
214
+
'maxmemory' => nil,
215
+
'maxmemorypolicy' => 'volatile-lru',
216
+
'appendfsync' => 'everysec',
217
+
'includes' => nil
218
+
```
199
219
200
220
*`redisio['servers']` - An array where each item is a set of key value pairs for redis instance specific settings. The only required option is 'port'. These settings will override the options in 'default_settings', default is set to [{'port' => '6379'}]
201
221
@@ -230,9 +250,11 @@ package file should be in the format <base_name><version_number>.<artifact_type>
230
250
231
251
package file after extraction should be inside of the directory <base_name><version_number>
232
252
253
+
```ruby
233
254
install "redis"do
234
255
action [:run,:nothing]
235
256
end
257
+
```
236
258
237
259
`uninstall`
238
260
----------
@@ -244,17 +266,19 @@ Actions:
244
266
245
267
Attribute Parameters
246
268
247
-
*`servers` - an array of hashes containing the port number of instances to remove along with the binarires. (it is fine to pass in the same hash you used to install, even if there are additional
269
+
*`servers` - an array of hashes containing the port number of instances to remove along with the binarires. (it is fine to pass in the same hash you used to install, even if there are additional
248
270
only the port is used)
249
271
272
+
```ruby
250
273
uninstall "redis"do
251
274
action [:run,:nothing]
252
275
end
276
+
```
253
277
254
278
`service`
255
279
---------
256
280
257
-
Actions:
281
+
Actions:
258
282
259
283
*`start`
260
284
*`stop`
@@ -264,15 +288,17 @@ Actions:
264
288
265
289
The name of the service must be the port that the redis server you want to perform the action on is identified by
homedir='/var/lib/redis'#this is necessary because selinux by default prevents the homedir from being managed in /var/lib/
27
+
when'fedora'
28
+
shell='/sbin/nologin'
29
+
homedir='/home/redis'
30
+
else
31
+
shell='/bin/sh'
32
+
homedir='/redis'
33
33
end
34
34
35
35
#Tarball and download related defaults
@@ -39,28 +39,27 @@
39
39
default['redisio']['version']='2.4.10'
40
40
41
41
#Default settings for all redis instances, these can be overridden on a per server basis in the 'servers' hash
42
-
default['redisio']['default_settings']={
43
-
44
-
'user'=>'redis',
45
-
'group'=>'redis',
46
-
'homedir'=>homedir,
47
-
'shell'=>shell,
48
-
'configdir'=>'/etc/redis',
49
-
'address'=>nil,
50
-
'backuptype'=>'rdb',
51
-
'datadir'=>'/var/lib/redis',
52
-
'timeout'=>'0',
53
-
'loglevel'=>'verbose',
54
-
'save'=>['900 1','300 10','60 10000'],
55
-
'slaveof'=>nil,
56
-
'masterauth'=>nil,
57
-
'requirepass'=>nil,
58
-
'maxclients'=>'0',
59
-
'maxmemory'=>nil,
60
-
'maxmemorypolicy'=>'volatile-lru',
61
-
'appendfsync'=>'everysec',
62
-
'includes'=>nil
63
-
}
42
+
default['redisio']['default_settings']={
43
+
'user'=>'redis',
44
+
'group'=>'redis',
45
+
'homedir'=>homedir,
46
+
'shell'=>shell,
47
+
'configdir'=>'/etc/redis',
48
+
'address'=>nil,
49
+
'backuptype'=>'rdb',
50
+
'datadir'=>'/var/lib/redis',
51
+
'timeout'=>'0',
52
+
'loglevel'=>'verbose',
53
+
'save'=>['900 1','300 10','60 10000'],
54
+
'slaveof'=>nil,
55
+
'masterauth'=>nil,
56
+
'requirepass'=>nil,
57
+
'maxclients'=>'0',
58
+
'maxmemory'=>nil,
59
+
'maxmemorypolicy'=>'volatile-lru',
60
+
'appendfsync'=>'everysec',
61
+
'includes'=>nil
62
+
}
64
63
65
64
#Individual server overrides, port is required and must be unique per instance, by default we setup a single redis instance on the default redis port of 6379
0 commit comments