Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit 1e557cad1d7645028dc208dd0624051d2e820249 @phlipper committed May 3, 2012
Showing with 752 additions and 0 deletions.
  1. +6 −0 .gitignore
  2. +20 −0 LICENSE.txt
  3. +113 −0 README.md
  4. +55 −0 attributes/default.rb
  5. +15 −0 metadata.rb
  6. +14 −0 recipes/default.rb
  7. +8 −0 recipes/doc.rb
  8. +8 −0 recipes/server.rb
  9. +513 −0 templates/default/redis.conf.erb
@@ -0,0 +1,6 @@
+*.tgz
+*.tar.gz
+vendor/bundle
+.bundle
+.DS_Store
+build/*
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+Copyright © 2012 Phil Cohen <github@phlippers.net>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the “Software”), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
113 README.md
@@ -0,0 +1,113 @@
+# chef-redis
+
+## Description
+
+This cookbook installs [Redis](http://redis.io) from Chris Lea's [ppa archive](https://launchpad.net/~chris-lea/+archive/redis-server).
+
+Redis is an open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.
+
+
+## Requirements
+
+### Supported Platforms
+
+The following platforms are supported by this cookbook, meaning that the recipes run on these platforms without error:
+
+* Ubuntu
+
+
+## Recipes
+
+* `redis` - The default recipe. Setup apt with ppa details.
+* `redis::server` - Install the Redis server.
+* `redis::doc` - Install the Redis documentation.
+
+# Usage
+
+This cookbook installs the Redis components if not present, and pulls updates if they are installed on the system.
+
+
+## Attributes
+
+```ruby
+default["redis"]["pidfile"] = "/var/run/redis/redis-server.pid"
+default["redis"]["daemonize"] = "yes"
+default["redis"]["port"] = 6379
+default["redis"]["bind"] = "127.0.0.1"
+default["redis"]["unixsocket"] = "/var/run/redis/redis.sock"
+default["redis"]["unixsocketperm"] = 755
+default["redis"]["timeout"] = 300
+default["redis"]["loglevel"] = "notice"
+default["redis"]["logfile"] = "/var/log/redis/redis-server.log"
+default["redis"]["syslog_enabled"] = "no"
+default["redis"]["syslog_ident"] = "redis"
+default["redis"]["syslog_facility"] = "local0"
+default["redis"]["databases"] = 16
+default["redis"]["snapshots"] = {
+ 900 => 1,
+ 300 => 10,
+ 60 => 10000
+}
+default["redis"]["rdbcompression"] = "yes"
+default["redis"]["dbfilename"] = "dump.rdb"
+default["redis"]["dir"] = "/var/lib/redis"
+default["redis"]["slaveof"] = ""
+default["redis"]["masterauth"] = ""
+default["redis"]["slave_serve_stale_data"] = "yes"
+default["redis"]["repl_ping_slave_period"] = 10
+default["redis"]["repl_timeout"] = 60
+default["redis"]["requirepass"] = ""
+default["redis"]["rename_commands"] = []
+default["redis"]["maxclients"] = 128
+default["redis"]["maxmemory"] = "64mb"
+default["redis"]["maxmemory_policy"] = "volatile-lru"
+default["redis"]["maxmemory_samples"] = 3
+default["redis"]["appendonly"] = "no"
+default["redis"]["appendfilename"] = "appendonly.aof"
+default["redis"]["appendfsync"] = "everysec"
+default["redis"]["no_appendfsync_on_rewrite"] = "no"
+default["redis"]["auto_aof_rewrite_percentage"] = 100
+default["redis"]["auto_aof_rewrite_min_size"] = "64mb"
+default["redis"]["slowlog_log_slower_than"] = 10000
+default["redis"]["slowlog_max_len"] = 1024
+default["redis"]["vm_enabled"] = "no"
+default["redis"]["vm_swap_file"] = "/var/lib/redis/redis.swap"
+default["redis"]["vm_max_memory"] = 0
+default["redis"]["vm_page_size"] = 32
+default["redis"]["vm_pages"] = 134217728
+default["redis"]["vm_max_threads"] = 4
+default["redis"]["hash_max_zipmap_entries"] = 512
+default["redis"]["hash_max_zipmap_value"] = 64
+default["redis"]["list_max_ziplist_entries"] = 512
+default["redis"]["list_max_ziplist_value"] = 64
+default["redis"]["set_max_intset_entries"] = 512
+default["redis"]["zset_max_ziplist_entries"] = 128
+default["redis"]["zset_max_ziplist_value"] = 64
+default["redis"]["activerehashing"] = "yes"
+default["redis"]["include_config_files"] = []
+```
+
+
+## Basic Settings
+
+None
+
+
+## Contributing
+
+This cookbook could have way more personality... Help make it so!
+
+1. Fork it
+2. Create your feature branch (`git checkout -b my-new-feature`)
+3. Commit your changes (`git commit -am 'Added some feature'`)
+4. Push to the branch (`git push origin my-new-feature`)
+5. Create new Pull Request
+
+
+## License
+
+**chef-redis**
+
+* Freely distributable and licensed under the [MIT license](http://phlipper.mit-license.org/2012/license.html).
+* Copyright (c) 2012 Phil Cohen (github@phlippers.net) [![endorse](http://api.coderwall.com/phlipper/endorsecount.png)](http://coderwall.com/phlipper)
+* http://phlippers.net/
@@ -0,0 +1,55 @@
+default["redis"]["pidfile"] = "/var/run/redis/redis-server.pid"
+default["redis"]["daemonize"] = "yes"
+default["redis"]["port"] = 6379
+default["redis"]["bind"] = "127.0.0.1"
+default["redis"]["unixsocket"] = "/var/run/redis/redis.sock"
+default["redis"]["unixsocketperm"] = 755
+default["redis"]["timeout"] = 300
+default["redis"]["loglevel"] = "notice"
+default["redis"]["logfile"] = "/var/log/redis/redis-server.log"
+default["redis"]["syslog_enabled"] = "no"
+default["redis"]["syslog_ident"] = "redis"
+default["redis"]["syslog_facility"] = "local0"
+default["redis"]["databases"] = 16
+default["redis"]["snapshots"] = {
+ 900 => 1,
+ 300 => 10,
+ 60 => 10000
+}
+default["redis"]["rdbcompression"] = "yes"
+default["redis"]["dbfilename"] = "dump.rdb"
+default["redis"]["dir"] = "/var/lib/redis"
+default["redis"]["slaveof"] = ""
+default["redis"]["masterauth"] = ""
+default["redis"]["slave_serve_stale_data"] = "yes"
+default["redis"]["repl_ping_slave_period"] = 10
+default["redis"]["repl_timeout"] = 60
+default["redis"]["requirepass"] = ""
+default["redis"]["rename_commands"] = []
+default["redis"]["maxclients"] = 128
+default["redis"]["maxmemory"] = "64mb"
+default["redis"]["maxmemory_policy"] = "volatile-lru"
+default["redis"]["maxmemory_samples"] = 3
+default["redis"]["appendonly"] = "no"
+default["redis"]["appendfilename"] = "appendonly.aof"
+default["redis"]["appendfsync"] = "everysec"
+default["redis"]["no_appendfsync_on_rewrite"] = "no"
+default["redis"]["auto_aof_rewrite_percentage"] = 100
+default["redis"]["auto_aof_rewrite_min_size"] = "64mb"
+default["redis"]["slowlog_log_slower_than"] = 10000
+default["redis"]["slowlog_max_len"] = 1024
+default["redis"]["vm_enabled"] = "no"
+default["redis"]["vm_swap_file"] = "/var/lib/redis/redis.swap"
+default["redis"]["vm_max_memory"] = 0
+default["redis"]["vm_page_size"] = 32
+default["redis"]["vm_pages"] = 134217728
+default["redis"]["vm_max_threads"] = 4
+default["redis"]["hash_max_zipmap_entries"] = 512
+default["redis"]["hash_max_zipmap_value"] = 64
+default["redis"]["list_max_ziplist_entries"] = 512
+default["redis"]["list_max_ziplist_value"] = 64
+default["redis"]["set_max_intset_entries"] = 512
+default["redis"]["zset_max_ziplist_entries"] = 128
+default["redis"]["zset_max_ziplist_value"] = 64
+default["redis"]["activerehashing"] = "yes"
+default["redis"]["include_config_files"] = []
@@ -0,0 +1,15 @@
+maintainer "Phil Cohen"
+maintainer_email "github@phlippers.net"
+license "MIT"
+description "Installs and configures Redis"
+version "0.1.0"
+
+recipe "redis", "Sets up ppa apt repository"
+recipe "redis::server", "Installs redis server"
+recipe "redis::doc", "Installs redis documentation"
+
+%w{ ubuntu debian }.each do |os|
+ supports os
+end
+
+depends "build-essential"
@@ -0,0 +1,14 @@
+#
+# Cookbook Name:: redis
+# Recipe:: default
+#
+
+apt_repository "chris-lea-redis-server" do
+ uri "http://ppa.launchpad.net/chris-lea/redis-server/ubuntu"
+ distribution node["lsb"]["codename"]
+ components ["main"]
+ keyserver "keyserver.ubuntu.com"
+ key "C7917B12"
+ action :add
+ notifies :run, "execute[apt-get update]", :immediately
+end
@@ -0,0 +1,8 @@
+#
+# Cookbook Name:: redis
+# Recipe:: doc
+#
+
+include_recipe "redis::default"
+
+package "redis-doc"
@@ -0,0 +1,8 @@
+#
+# Cookbook Name:: redis
+# Recipe:: server
+#
+
+include_recipe "redis::default"
+
+package "redis-server"
Oops, something went wrong.

0 comments on commit 1e557ca

Please sign in to comment.